Advanced Math/4 number combinations
Expert: Steve Holleran - 5/8/2007
QuestionQUESTION: What are all the possible 4 number combinations of numbers between 0-9?
ANSWER: Hello Emily,
Actually, this is a non-answer answer. The way the question is stated, you want to list all the possible combinations. Well, there are 210 of them, and I'm not about to do that here.
If you really need to do this, I can offer that you try some method like this:
0--1--2--3
0--1--2--4
0--1--2--5, etc., and then just start changing the beginning number--be aware, its going to be very difficult to recognize when you are duplicating a previous list!
I really can't believe that you are being asked to list that many items. It just seems unrealistic to me.
Steve Holleran
---------- FOLLOW-UP ----------
QUESTION: Hi Steve -- I think there are actually more like 10,000 combinations -- Do you know of an equation or a macro that will come up with these?
ANSWER: Hey Emily,
Okay, we've got to be REAL careful about language here.
The number I gave you, 210, is correct when you are asking about the number of 4-number "combinations" of the 10 digits. When the term "combinations" is used in math, you are talking about groups in which order is not important.
For example, if we take the letters A, B, and C, the following are all the SAME combination:
ABC, BCA, CAB, ACB, CBA, BAC.
Similarly with numbers:
0, 1, 2, 3 is the same combination as :
0, 2, 1, 3; 0, 3, 1, 2; 1, 3, 2 , 0.
When you count combinations, order does not matter.
(Just an aside, but this is why the term "combination lock" is really a misnomer--if you enter the numbers in the wrong order, the lock will not open--its really a "permutation" lock.)
I think what you may be looking for is the PERMUTATIONS
of the 10 digits 4 at a time. This is an entirely different idea, because is a permutation, order DOES matter.
Therefore, if we go back to the ABC example, while all the ones I listed above are the same combination, they are six different permutations. Permutations are counted entirely differently, and while not quite 10,000, in the case you are discussing here, there are 5040 different permutations of the ten digits.
I am not aware of any equation or macro available which will give you all 5040 of them, but you might be able to find one on the net, maybe on a college math site?
Wish I could help you more, and I hope that this answer to your follow-up clears up the matter.
Steve
---------- FOLLOW-UP ----------
QUESTION: OK -- I now see how you came up with the 5040 possible permutations -- but -- as I reason through this without calculations, I am thinking that there would be 10,000 possible permutations -- wouldn't they be 0000, 0001, 0002,0003......9996, 9997, 9998, 9999 -- Isn't that right? Or am I missing something?
Thanks!
Emily
AnswerHi Emily,
Yes, you are correct. I was not aware that you wanted to be allowed to repeat digits within a "number". Since you are allowing repeats, and there are 10 possible digits to use, you have
10 * 10 * 10 * 10 = 10,000 possible with repeated digits allowed.
Steve