|
-
Apr 18th, 2005, 03:33 PM
#1
Thread Starter
Lively Member
How many combinations??
Hi there. I need some help here because I am not all that clued up on maths. I have a 3d array, 4x4x4, totalling 64 cells. Now I need to know how many possible combinations there are too have 4 cells in a row, imagine in a connect 4 style. I have done it on paper and reckon there are 64 different combinations. Now if this is correct then I need to a formula to work out how many there are, a general formula so if the grid size was changed then it would still work.
Many thanks
-
Apr 19th, 2005, 02:13 AM
#2
transcendental analytic
Re: How many combinations??
case study:
along x axis: yz(x-3) or 0 if x<4
along y axis: xz(y-3) or 0 if y<4
along z axis: xy(z-3) or 0 if z<4
diagonally along xy plane: 2*z(x-3)(y-3) or 0 if x<4 and y<4
diagonally along yz plane: 2*x(z-3)(y-3) or 0 if z<4 and y<4
diagonally along xz plane: 2*y(x-3)(z-3) or 0 if x<4 and z<4
diagonally across space: 4*(y-3)(x-3)(z-3) or 0 if x<4 and z<4 and y<4
then sum them up.
edit: btw there should be 76 ways of having 4 in a row in 4x4x4 space
Last edited by kedaman; Apr 19th, 2005 at 02:19 AM.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 20th, 2005, 01:16 PM
#3
Frenzied Member
Re: How many combinations??
Why not 48 + 4 = 52?
There are 16 sets of cells parallel to each of the xyz-axes: 3 * 16 = 48
There are 4 diagonals: 48 + 4 = 52
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
Apr 20th, 2005, 11:49 PM
#4
transcendental analytic
Re: How many combinations??
there are also 8 diagonals along each plane, adding another 24
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 21st, 2005, 09:40 AM
#5
Frenzied Member
Re: How many combinations??
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|