Is there a formula to find a combination of numbers

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
2 replies · 5K views
cubanopro
Messages
2
Reaction score
0
Hi, what I meant in the title was:

Let's say that I have two variables in a game and I would like to know how many combination of numbers there is... For example if I have to calculate it for 3 times the possible combinations would be:
a,a,a
a,a,b
a,b,a
b,a,a
b,b,b
b,b,a
b,a,b
a,b,b

Is there a formula to calculate how many it would let's say for 13 times...or for 50 times.
Thanks in advance!
Rafael
 
Mathematics news on Phys.org
If you replace a,b by 0,1, you will see that you have just enumerated all combinations for 3 binary bits, which are 2^3 = 8. If you want to repeat it 13 or 50 times, you will have 2^13 = 8192 or 2^50 = 1125899906842624. If you have three or four values instead of two, then you will have 3^n or 4^n cases.

(If you had 10 values, repeated 5 times, you would have 10^5 cases; the cases themselves are like the digits in a 5-digit number, from 00000 to 99999. Your example with a,b is the same as the digits in a 3-digit number in base 2, from 000 to 111.)
 
thank you very much Dodo you've been a great help!
You cannot answer my question in a better way. :)

Have a great day!
Rafael