All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
All-distinct-integer set (Posted on 2024-04-11) Difficulty: 3 of 5
How many non-negative integers are there with non-repeating digits?

To avoid ambiguity:
Smallest number: 0
Biggest: 9876543210

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 1 of 2
There are 10 single-digit numbers.

For larger numbers of digits, there's only 9 choices for the first one, as zero's excluded there. There are still 9 choices for the second digits, as zero has now appeared, but the one chosen for first is no longer available. Each subsequent digit has one fewer choices:


10
9*9=81
9*9*8=648
9*9*8*7=4536
9*9*8*7*6=27216
9*9*8*7*6*5=136080
9*9*8*7*6*5*4=544320
9*9*8*7*6*5*4*3=1632960
9*9*8*7*6*5*4*3*2=3265920
9*9*8*7*6*5*4*3*2*1=3265920
tot =
     8877691
     
including the initial 10 1-digit numbers.

The last two terms are the same, as one determines the digit that's not present and the other determines the digit that's last.

To print the above table:

tot=10;
s='9*9';
for i=8:-1:0
  disp([s '=' num2str(eval(s))])
  tot=tot+eval(s);
  s=[s '*' num2str(i)];
end
tot


  Posted by Charlie on 2024-04-11 08:45:46
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (18)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information