Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a four digit code. Repetition of the same code is not allowed. How many possible combinations can be possible?
I tried it as follows,
As repetition of the same code is not allowed so it should be $10P4$ choices?

share|cite|improve this question
Can the starting digit be $0$? – Srivatsan Oct 24 '11 at 6:54
@SrivatsanNarayanan: This is the same condition that I was thinking of. I found this question from a forum. I think we should neglect this condition. – Fahad Uddin Oct 24 '11 at 6:58
The question is not that clear. Whenever you say "repetition of the same code", I presume you mean "repetition of the same digit". Do you know the answer to the question by any chance? – Srivatsan Oct 24 '11 at 6:59
@SrivatsanNarayanan: Here repetition refers to repeating the same whole code again like 5555 can not come again in the series but 5554 can. – Fahad Uddin Oct 24 '11 at 7:07
@Akito: Your last comment makes the question less clear, not more so. What is this "series"? It doesn't occur in the question. Is there more than one four-digit code? If so, how many? I've been reading several of your questions over the last couple of days, and there seems to be a general pattern of vague, unclear or sloppy formulations -- please put more care into formulating your questions; this is also in your own interest, as you will then get more useful answers. – joriki Oct 24 '11 at 8:43

If repetition of same is code is not allowed means "to repeating the same whole code again like 5555 can not come again in the series but 5554 can" as explained by the OP in his/her comment and again assuming that $0$ could be the first digit of these four digit codes,then the number of possible arrangements is $10^4$.

share|cite|improve this answer
How come, $10^4$. I have arrived to an answer which is $10*10*10*10!$.The last one is $10!$ because there can not be repetitions in it. – Fahad Uddin Oct 24 '11 at 8:32
Rule of product – Quixotic Oct 24 '11 at 8:44

$10 P 4$ means no repetitions of the same digit, but you can repeat digits. You simply need to omit the cases where all the digits are the same, and there are exactly 10 such cases: 0000, 1111, and so forth up to 9999. So you have $10^4-10$ choices.

share|cite|improve this answer
"repeating the same whole code again like 5555 can not come again in the series but 5554 can."I guess that means $5555$ can only come once in the counting. – Quixotic Oct 24 '11 at 7:40
I agree that it's quite difficult to understand the question... I think he means that a legal code is every sequence of 4 digits which is not simply a repetition of one digit, but I may be mistaken. – Gadi A Oct 24 '11 at 8:10

You have to apply formula for variations with repetition:

$\bar V_k^n=n^k\Rightarrow N=10^4$ , where N is number of choices.

share|cite|improve this answer

If you mean that no digit can be repeated in any four digit code so that for example 9987 is not allowed because 9 appears twice then:

$$P(n,k)=\frac{n!}{(n-k)!} =\frac{ 10!}{(10-4)!} = \frac{3628800}{720} = 5040$$

share|cite|improve this answer
This is an old question which has got few answers You are not contributing anything new. Besides, it would help if you learn and use $LaTeX$ – Shailesh Mar 17 at 2:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.