Is there a formula to find a combination of numbers

Click For Summary
SUMMARY

The discussion centers on calculating the number of combinations of variables in a game scenario. Rafael seeks a formula for combinations when using two variables, exemplified by the binary representation of combinations for three bits. Dodo clarifies that for binary variables, the formula is 2^n, where n is the number of repetitions. For more than two values, the formula extends to k^n, where k represents the number of distinct values, leading to results such as 2^13 = 8192 and 2^50 = 1125899906842624.

PREREQUISITES
  • Understanding of combinatorial mathematics
  • Familiarity with binary representation
  • Knowledge of exponential functions
  • Basic programming concepts for implementation
NEXT STEPS
  • Research combinatorial mathematics and its applications
  • Learn about binary representation and its significance in computing
  • Explore exponential growth and its implications in algorithm design
  • Investigate programming techniques for generating combinations in Python
USEFUL FOR

Mathematicians, game developers, software engineers, and anyone interested in combinatorial algorithms and their applications in programming.

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
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 41 ·
2
Replies
41
Views
6K
  • · Replies 45 ·
2
Replies
45
Views
5K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 1 ·
Replies
1
Views
385
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 13 ·
Replies
13
Views
2K