# The number of codewords which do not contain any digit more than once and which cannot contain both 0 and 1

So far I have worked out the total number of combinations with no repeats which I believe to be

10 x 9 x 8 x 7 = 5040


I'm not quite sure where to proceed after this, I think I have to work out the total number of combinations with a 1 and 0 in it and then subtract this from 5040 for my answer. However, i'm not sure how to work this out. Any help would be appreciated. Thanks!

Assuming the codeword can start with $0$

As you have done, total number of combinations with no repeats $=10 \times 9 \times 8 \times7 =5040$

To find the number of codewords with both $0$ and $1,$ include both of them and select other $2$ digits in $\dbinom{8}{2}$ ways. these $4$ digits can be arranged in $4!$ ways. So, $\dbinom{8}{2} \times 4!=672$ ways.

Thus you get $5040-672=4368$ codewords

• Thanks for the help, the answer i've been given is the one you had before the edit '4368'. – Mark Feb 2 '17 at 17:48
• What you have after the edit was actually a method I tried, but wasn't matching the answer. – Mark Feb 2 '17 at 17:50
• 4368 the right answer, i tested with a program. I got confused after writing that answer. reverted back. – Kiran Feb 2 '17 at 17:50
• Thanks, I understand it all except where '8' is coming from, any chance you could explain that? – Mark Feb 2 '17 at 17:54
• Oh right thanks, you've been a lot of help! – Mark Feb 2 '17 at 18:12