By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,761 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

tricky statistics problem

P: n/a
Hi there

I need help with a tricky problem.
I have a 2 dimensional array with qualities such as
ball size, ball color, ball weight.

Now I have to print out all the possible combinations of this.

assume I have it stored as such
i have two dimensional array ball:
ball (x,y)
x = the number of possible things a ball can be, like color, size ,weight,
bounce height, smootheness for example.
y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1
lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy

now, how can I loop thru this array and pring all the combinations:
like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball(4,0)= red+2inches+3
lbs+3 feet hi+smooth
ball(0,0)+ball(1,0)+ball(2,0)+ball(3,0)+ball(4,1) = red+2inches+3lbs+3feet
hig+rough

etc

thanks in advance
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Do you want to do a numeric or a text field addition?? Your question is
unclear to me but I think I can give the answer if you spell out what you
want to achieve a bit more.

Do you want a string or a code or a number or what?
---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004
Nov 12 '05 #2

P: n/a
Thanks for your response.
I would like the actual strings to show what the combinations are.
Assume the actual strings are already in the multidimensional array as show
in my post.

I just dont know how to loop through the array to build this string.
since you can really only access one element of the array at a time with the
loop

Would be great if you could help

Thanks
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:ZS*******************@news.xtra.co.nz...
Do you want to do a numeric or a text field addition?? Your question is
unclear to me but I think I can give the answer if you spell out what you
want to achieve a bit more.

Do you want a string or a code or a number or what?
---
Please immediately let us know (by phone or return email) if (a) this email contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.688 / Virus Database: 449 - Release Date: 18/05/2004

Nov 12 '05 #3

P: n/a
On Thu, 20 May 2004 11:01:06 GMT, "Danny" <da********@hotmail.com>
wrote:
Try something like:
dim x as integer
dim y as integer
for x=0 to ubound(ball(1))
for y = 0 to ubound(ball(2))
debug.print "ball(" & x & "," & y & ")=" & ball(x,y)
next y
next x

-Tom.

Hi there

I need help with a tricky problem.
I have a 2 dimensional array with qualities such as
ball size, ball color, ball weight.

Now I have to print out all the possible combinations of this.

assume I have it stored as such
i have two dimensional array ball:
ball (x,y)
x = the number of possible things a ball can be, like color, size ,weight,
bounce height, smootheness for example.
y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1
lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy

now, how can I loop thru this array and pring all the combinations:
like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball(4,0)= red+2inches+3
lbs+3 feet hi+smooth
ball(0,0)+ball(1,0)+ball(2,0)+ball(3,0)+ball(4, 1) = red+2inches+3lbs+3feet
hig+rough

etc

thanks in advance


Nov 12 '05 #4

P: n/a
This just prints each feature out, I need to print out all possbile
combinations.
like:
red+2inches+3lbs+3 feet hi+smooth
not just
red
2inches
3 lbs
3 feet hi
smooth

This is tricky
"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:ks********************************@4ax.com...
On Thu, 20 May 2004 11:01:06 GMT, "Danny" <da********@hotmail.com>
wrote:
Try something like:
dim x as integer
dim y as integer
for x=0 to ubound(ball(1))
for y = 0 to ubound(ball(2))
debug.print "ball(" & x & "," & y & ")=" & ball(x,y)
next y
next x

-Tom.

Hi there

I need help with a tricky problem.
I have a 2 dimensional array with qualities such as
ball size, ball color, ball weight.

Now I have to print out all the possible combinations of this.

assume I have it stored as such
i have two dimensional array ball:
ball (x,y)
x = the number of possible things a ball can be, like color, size ,weight,bounce height, smootheness for example.
y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1
lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy

now, how can I loop thru this array and pring all the combinations:
like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball(4,0)= red+2inches+3
lbs+3 feet hi+smooth
ball(0,0)+ball(1,0)+ball(2,0)+ball(3,0)+ball(4, 1) = red+2inches+3lbs+3feethig+rough

etc

thanks in advance

Nov 12 '05 #5

P: n/a
On Thu, 20 May 2004 15:11:46 GMT, "Danny" <da********@hotmail.com>
wrote:

Now I'm confused. It appears you want all permutations, but that
wouldn't make sense if the data is stored in a 2-dimensional array.

-Tom.
This just prints each feature out, I need to print out all possbile
combinations.
like:
red+2inches+3lbs+3 feet hi+smooth
not just
red
2inches
3 lbs
3 feet hi
smooth

This is tricky
"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:ks********************************@4ax.com.. .
On Thu, 20 May 2004 11:01:06 GMT, "Danny" <da********@hotmail.com>
wrote:
Try something like:
dim x as integer
dim y as integer
for x=0 to ubound(ball(1))
for y = 0 to ubound(ball(2))
debug.print "ball(" & x & "," & y & ")=" & ball(x,y)
next y
next x

-Tom.

>Hi there
>
>I need help with a tricky problem.
>I have a 2 dimensional array with qualities such as
>ball size, ball color, ball weight.
>
>Now I have to print out all the possible combinations of this.
>
>assume I have it stored as such
>i have two dimensional array ball:
>ball (x,y)
>x = the number of possible things a ball can be, like color, size,weight, >bounce height, smootheness for example.
>y = is that feature like red,green, blue - 3 inches, 2 inches - 3 lbs, 1
>lbs - 3 feet hi, 1 foot hi, 5 ft hi - smooth, rough, bumpy
>
>now, how can I loop thru this array and pring all the combinations:
>like bal(0,0) + bal(1,0) + ball(2,0) + ball(3,0)+ball(4,0)= red+2inches+3
>lbs+3 feet hi+smooth
>ball(0,0)+ball(1,0)+ball(2,0)+ball(3,0)+ball(4, 1) =red+2inches+3lbs+3feet >hig+rough
>
>etc
>
>thanks in advance
>


Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.