# All possible combinations of numbers in a set

Hi...

I have to find ALL possible combinations of the following.

I have 8 questions and all  8 can have an answer of "A" (Any) or "V" (Value) only.

So

1.  (A or V)
2.  (A or V)
3.  (A or V)
4.  (A or V)
5.  (A or V)
6.  (A or V)
7.  (A or V)
8.  (A or V)

I need all possible combinations that could be chosen using the 8 questions.
So all 8 answers could be A or all could be V and need every other combination possible in between i.e 4. = V and the rest are A OR 7,8 = A and rest are V etc. There are obviously quite a few :)

1. Probably be good to know how many possible combinations there are
2. What all the combinations are

Kind regards

Alto999
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
How many possible combinations are there for one question?  What are they?
How many possible combinations are there for two questions?
See any pattern yet?
Commented:
So where you have "V" it will actually have a real value of 0-9?
Then each of your 8 questions will have a possible 11 answers
If you have more values for "V" then you'll still have that number plus 1 answers for each.
But if the value of "V" is unlimited then your possible outcomes will be unlimited also.
How does that fit your problem?
Author Commented:

There are only 8 questions and only have 2 possible answers.

Its ALL possible combinations possible as per question explains.

so some examples of the MANY.

1.A
2.A
3.A
4.A
5.A
6.A
7.A
8.V

OR

1.A
2.A
3.V
4.A
5.A
6.A
7.A
8.V

There are lots of the above its knowing ALL of them and how to work out ALL of them.
Commented:
calculating is the easy part, drawing all of them out is the pain.

you have the important data, knowing that each of the eight questions have two possible answers. so now, account for that... remember that how you answer one question has no bearing on any of the others.

so in this case, you figure out the number of possible combinations for each question, then multiply all of those numbers. ( combinations for #1 x combinations for #2 x ... )

if you are familiar with decision trees, that would make a good way for you to draw out the combinations and also make it easy to count. here is a wikipedia link, just let me know if you feel that it does not clarify it enough: http://en.wikipedia.org/wiki/Decision_tree
Commented:
If you had one question with 2 possible answers you have 1 to the second = 2 or 1 squared
If you had two questions with 2 possible answers you have 2 to the second = 4 or 2 squared.

Since you have 8 questions with 2 possible answers you have 8 to the second = 64 or 8 squared.

if you had three possible answers it would be 8 to the 3rd, or 8 x 8 x 8 = much bigger number.
Commented:
Ha! This is so simple... you have 256 possibilities there (2 to the power of 8).
All possible combinations are drawn out by counting up from 0 to 255 in binary, like this:

00000000
00000001
00000010
00000011
...

Just replace (0,1) with whatever your two possibilities are.
You can do that in just about any programming or scripting language.

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
Ha! This is so simple... you have 256 possibilities there (2 to the power of 8).
All possible combinations are drawn out by counting up from 0 to 255 in binary, like this:

00000000
00000001
00000010
00000011
...

Just replace (0,1) with whatever your two possibilities are.
You can do that in just about any programming or scripting language.

anyone know how to do this in excel??
Author Commented:
LESS COMBINATIONS

Eight bits have 256 combinations, but if you know that eight out of eight bits are zero, than there's just one combination possible: 00000000. Thus knowing how many bits are 0 and 1, can reduce the amount of possible combinations extremely. The more information there is about a data block, the less combinations are possible. Not just knowing how many zeros and ones there are but knowing more; how many groups of each: 00, 01, 10, and 11 there are (or larger groups), reduces the amount of possible combinations even more.

Next are all 256 combinations of 8 bits, in order of the ratio 1/0

00000000

00000001
00000010
00000100
00001000
00010000
00100000
01000000
10000000

00000011
00000101
00000110
00001001
00001010
00001100
00010001
00010010
00010100
00011000
00100001
00100010
00100100
00101000
00110000
01000001
01000010
01000100
01001000
01010000
01100000
10000001
10000010
10000100
10001000
10010000
10100000
11000000

00000111
00001011
00001101
00001110
00010011
00010101
00010110
00011001
00011010
00011100
00100011
00100101
00100110
00101001
00101010
00101100
00110001
00110010
00110100
00111000
01000011
01000101
01000110
01001001
01001010
01001100
01010001
01010010
01010100
01011000
01100001
01100010
01100100
01101000
01110000
10000011
10000101
10000110
10001001
10001010
10001100
10010001
10010010
10010100
10011000
10100001
10100010
10100100
10101000
10110000
11000001
11000010
11000100
11001000
11010000
11100000

00001111
00010111
00011101
00011110
00011011
00100111
00101011
00101101
00101110
00110011
00110101
00110110
00111001
00111010
00111100
01000111
01001011
01001101
01001110
01010011
01010101
01010110
01011001
01011010
01011100
01100011
01100101
01100110
01101001
01101010
01101100
01110001
01110010
01110100
01111000
10000111
10001011
10001101
10001110
10010011
10010101
10010110
10011001
10011010
10011100
10100011
10100101
10100110
10101001
10101010
10101100
10110001
10110010
10110100
10111000
11000011
11000101
11000110
11001001
11001010
11001100
11010001
11010010
11010100
11011000
11100001
11100010
11100100
11101000
11110000

00011111
00101111
00110111
00111011
00111101
00111110
01001111
01010111
01011011
01011101
01011110
01100111
01101011
01101101
01101110
01110011
01110101
01110110
01111001
01111010
01111100
10001111
10010111
10011011
10011101
10011110
10100111
10101011
10101101
10101110
10110011
10110101
10110110
10111001
10111010
10111100
11000111
11001011
11001101
11001110
11010011
11010101
11010110
11011001
11011010
11011100
11100011
11100101
11100110
11101001
11101010
11101100
11110001
11110010
11110100
11111000

00111111
01011111
01101111
01110111
01111011
01111101
01111110
10011111
10101111
10110111
10111011
10111101
10111110
11001111
11010111
11011011
11011101
11011110
11100111
11101011
11101101
11101110
11110011
11110101
11110110
11111001
11111010
11111100

01111111
10111111
11011111
11101111
11110111
11111011
11111101
11111110

11111111

For eight bits:
all zero =
1 one =
2 ones =
3 ones =
4 ones =
5 ones =
6 ones =
7 ones =
8 ones =            1 combination
8 combinations
28 combinations
56 combinations
70 combinations
56 combinations
28 combinations
8 combinations
1 combination
Commented:
I'm sorry, but I can't make any sense of what you are saying.

Eight bits have 256 combinations, but if you know that eight out of eight bits are zero, than there's just one combination possible: 00000000.

You're mixing apples and oranges here. What do you really want?
Author Commented:
I have answered it above i.e. have displayed ALL 256 possible combinations Sir.
Commented:
So... what you are arriving at is that what you needed was not all possible combinations (that was answered in my 1st reply), but the number of possible ocurrences of each element (1/0, A/V, or whatever) in a group of 8, regardless of order.
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Math / Science

From novice to tech pro — start learning today.