Solved

All possible combinations of numbers in a set

Posted on 2012-03-24
11
726 Views
Last Modified: 2012-03-24
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

Thank you in advance :)

Kind regards

Alto999
0
Comment
Question by:ALTO999
11 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 37760342
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?
0
 
LVL 62

Expert Comment

by:☠ MASQ ☠
ID: 37760391
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?
0
 

Author Comment

by:ALTO999
ID: 37760397
Please read the question.

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.
0
 
LVL 20

Expert Comment

by:masnrock
ID: 37760447
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
0
 
LVL 21

Expert Comment

by:Larry Struckmeyer MVP
ID: 37760450
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.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 7

Accepted Solution

by:
designatedinitializer earned 500 total points
ID: 37760608
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.
0
 

Author Comment

by:ALTO999
ID: 37760658
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??
0
 

Author Comment

by:ALTO999
ID: 37761360
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
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37761374
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?
0
 

Author Comment

by:ALTO999
ID: 37761380
I have answered it above i.e. have displayed ALL 256 possible combinations Sir.
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37761443
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Nadia
Suppose you use Uber application as a rider and you request a ride to go from one place to another. Your driver just arrived at the parking lot of your place. The only thing you know about the ride is the license plate number. How do you find your U…
Article by: Nadia
Linear search (searching each index in an array one by one) works almost everywhere but it is not optimal in many cases. Let's assume, we have a book which has 42949672960 pages. We also have a table of contents. Now we want to read the content on p…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now