O
O
OneDeus2020-10-29 20:36:41
Discrete Math
OneDeus, 2020-10-29 20:36:41

How many numbers in the hexadecimal number system that do not have the same digits?

How many numbers in the hexadecimal number system that do not have the same digits?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wataru, 2020-10-30
@OneDeus

Answer:
sum(i=0..15) 15!*15/i!
Obviously, the length cannot be more than 16 characters.
Next, let's look at the length of the number. Let it be L. There should be L different digits. But there is a problem - the first digit cannot be 0. Let's calculate separately the options where there is no 0 at all, and where there is 0. In the first case, there are 15!/(15-L)!/L! options to choose L numbers from 1-15. And you need to multiply by L!, because they can be mixed as you like. In the second option, we take 0 and L-1 digits from 1-15 - that's 15!/(15-(L-1))!/(L-1)! options. It is necessary to multiply by (L-1) possible positions 0 and (L-1)! possible permutations of all other digits. Since it is possible to get without 0 only if the length is less than 16, we will single out the case with L=16 separately.
Total - the answer is:
sum(L=1..15) {15!/(15-L)! + 15!/(16-L)!*(L-1)} + 15!*15
Having shortened it a bit, we can simplify what I gave at the beginning:
sum(i=0..15) 15!*15/i!
In general, for the N-th number system, instead of 15, write N-1.
You can check that the formula works for N=2: 1!*1(1/0!+1/1!) = 1*2 = 2 ("10" and "1").
And N=3: 2!*2*(1/0!+1/1!+1/2!) = 4*(1+1+1/2) = 10 ("1", "2", " 10", "20", "12", "21", "120", "210", "102", "201")

O
OCTAGRAM, 2020-10-29
@OCTAGRAM

Use the Inclusion-Exclusion Formula

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question