Integer of different digits
How many integers are there between 0 and 5467398 which consists of different digits (eg: 123, not 122)?
অম্লান সাহা
- Phlembac Adib Hasan
- Posts:1016
- Joined:Tue Nov 22, 2011 7:49 pm
- Location:127.0.0.1
- Contact:
Re: Integer of different digits
কম্পিউটারের সামনে বসে পুরোটা করতে ইচ্ছা করছে না। তাই অ্যাপ্রোচটা বলে দিচ্ছি।
এক ডিজিটের এরকম সংখ্যা আছে $9$ টি। দু ডিজিটের এরকম সংখ্যা বের করা যায় এভাবে:
এখানে আমাদের অঙ্ক বসানোর জায়গা আছে দুইটি। বাম দিক থেকে প্রথম স্থানে বসানো যাবে $0$ বাদে বাকি $9$ টি এবং এর প্রতিটির জন্য দ্বিতীয় স্থানে বসানো যাবে $9$ টি। (যে অঙ্কটি একবার প্রথম স্থানে বসানো হয়েছে সেটি দ্বিতীয় স্থানে বসানো যাবে না, আর এখানে $0$ বসানোতে কোন বাধা নেই।) তাহলে মোট সংখ্যা হচ্ছে $9\times 9=81$. এভাবে তিন, চার, ... ছয় অঙ্কের জন্য এরকম সংখ্যা বের করতে হবে। সাত অঙ্কের ক্ষেত্রে একটু টেকনিক্যালি হাতে গুনেই বের করা সম্ভব।
এক ডিজিটের এরকম সংখ্যা আছে $9$ টি। দু ডিজিটের এরকম সংখ্যা বের করা যায় এভাবে:
এখানে আমাদের অঙ্ক বসানোর জায়গা আছে দুইটি। বাম দিক থেকে প্রথম স্থানে বসানো যাবে $0$ বাদে বাকি $9$ টি এবং এর প্রতিটির জন্য দ্বিতীয় স্থানে বসানো যাবে $9$ টি। (যে অঙ্কটি একবার প্রথম স্থানে বসানো হয়েছে সেটি দ্বিতীয় স্থানে বসানো যাবে না, আর এখানে $0$ বসানোতে কোন বাধা নেই।) তাহলে মোট সংখ্যা হচ্ছে $9\times 9=81$. এভাবে তিন, চার, ... ছয় অঙ্কের জন্য এরকম সংখ্যা বের করতে হবে। সাত অঙ্কের ক্ষেত্রে একটু টেকনিক্যালি হাতে গুনেই বের করা সম্ভব।
Welcome to BdMO Online Forum. Check out Forum Guides & Rules
Re: Integer of different digits
For 7 digits, we can use DP(dynamic programming) on first digit.
For less than 7 digits(1-6 digits), the answer is $\sum_{i=1}^{6} \;^{10}P_{i} - ^9P_{i-1}$.
For less than 7 digits(1-6 digits), the answer is $\sum_{i=1}^{6} \;^{10}P_{i} - ^9P_{i-1}$.
Please read Forum Guide and Rules before you post.
Use $L^AT_EX$, It makes our work a lot easier!
Nur Muhammad Shafiullah | Mahi
Use $L^AT_EX$, It makes our work a lot easier!
Nur Muhammad Shafiullah | Mahi
Re: Integer of different digits
যখন মানুষের কাছে একখান হাতুড়ি থাকে তখন সবকিছুই মনে হয় পেরেক!! :p
One one thing is neutral in the universe, that is $0$.
- nafistiham
- Posts:829
- Joined:Mon Oct 17, 2011 3:56 pm
- Location:24.758613,90.400161
- Contact:
Re: Integer of different digits
সত্যি কথা ।Masum wrote:যখন মানুষের কাছে একখান হাতুড়ি থাকে তখন সবকিছুই মনে হয় পেরেক!! :p
একটা প্রোগ্রামে প্রোগ্রামারের যত শতাংশই সৃজনশীলতা থাকুক না কেন, একটা বড় অংশে গণকযন্ত্রের Brute Force থাকে
\[\sum_{k=0}^{n-1}e^{\frac{2 \pi i k}{n}}=0\]
Using $L^AT_EX$ and following the rules of the forum are very easy but really important, too.Please co-operate.
Using $L^AT_EX$ and following the rules of the forum are very easy but really important, too.Please co-operate.
- Fahim Shahriar
- Posts:138
- Joined:Sun Dec 18, 2011 12:53 pm
Re: Integer of different digits
For 1 digit numbers (including 0), there $10$ such numbers.
For 2 digit » $\frac {9*9!}{8!}$
For 3 digit » $\frac {9*9!}{7!}$
Go on..
For 6 digit » $\frac {9*9!}{4!}$
Now for 7 digit numbers(till 4999999), it's $\frac {4*9!}{3!}$.
From 5000000 to 5399999,(5 is fixed as 7th digit.) and there are $1*4*8*7*6*5*4= \frac {4*8!}{3!}$ numbers.
From 5400000 to 5459999,(5 & 4 are fixed.That means we can't use 5 & 4 in any other digit) and there are $1*1*4*7*6*5*4= \frac {4*7!}{3!}$
Next post..
For 2 digit » $\frac {9*9!}{8!}$
For 3 digit » $\frac {9*9!}{7!}$
Go on..
For 6 digit » $\frac {9*9!}{4!}$
Now for 7 digit numbers(till 4999999), it's $\frac {4*9!}{3!}$.
From 5000000 to 5399999,(5 is fixed as 7th digit.) and there are $1*4*8*7*6*5*4= \frac {4*8!}{3!}$ numbers.
From 5400000 to 5459999,(5 & 4 are fixed.That means we can't use 5 & 4 in any other digit) and there are $1*1*4*7*6*5*4= \frac {4*7!}{3!}$
Next post..
Name: Fahim Shahriar Shakkhor
Notre Dame College
Notre Dame College
- Fahim Shahriar
- Posts:138
- Joined:Sun Dec 18, 2011 12:53 pm
Re: Integer of different digits
From 5460000 to 5466999,there are $4*6*5*4$ numbers.
From 5467000 to 5467299, there are $3*5*4$ numbers.
From 5467300 to 5467399, there are
$5*4$ numbers.
Now if anyone wants to know the answer, take calculator on your hand and add them all.
From 5467000 to 5467299, there are $3*5*4$ numbers.
From 5467300 to 5467399, there are
$5*4$ numbers.
Now if anyone wants to know the answer, take calculator on your hand and add them all.
Name: Fahim Shahriar Shakkhor
Notre Dame College
Notre Dame College