2
$\begingroup$

Find the number of n digit-numbers formed using the first 5 natural numbers, that contain the digits '2' and '4', essentially.

I tried attempting this with the inclusion- exclusion principle but got stuck with the first 5 natural numbers condition. I made 2 sets, one with natural numbers where 2 is there and another with numbers with 5 is there and tried to find their intersection, but got stuck while subtracting from the total set, ie, the set of natural n digit numbers that are made from the digits 1 to 5 (wo any restrictions) hence i have a doubt in how to find the total number of elements in the set of n digit numbers that are made from the first 5 natural numbers.

Can someone please help me with this?

$\endgroup$
5
  • $\begingroup$ Can you show your work to explain how/why you got stuck? $\endgroup$
    – Calvin Lin
    Dec 1 '20 at 5:41
  • $\begingroup$ yeah i tried to use the principle such that i made 2 sets, one with natural numbers where 2 is there and another with numbers with 5 is there and tried to find their intersection, but when i was subtracting the thing i got stuck with what to subtract from since i cant figure out how to form the numbers (without any restrictions, ie i cant figure out how to find the set which contains all the natural numbers that are n digit and made from the first 5 digits.) $\endgroup$ Dec 1 '20 at 5:44
  • 1
    $\begingroup$ Can you add those details into the post? In particular, how you're using PIE. The words that you've written doesn't quite make sense to me as yet. $\endgroup$
    – Calvin Lin
    Dec 1 '20 at 5:46
  • $\begingroup$ Right, i will, sorry $\endgroup$ Dec 1 '20 at 5:47
  • $\begingroup$ so basically i have a doubt in how to find the total set of n digit numbers made with the digits 1 to 5 $\endgroup$ Dec 1 '20 at 5:51
2
$\begingroup$

The total number of $n$-digit numbers formed from $12345$ is $5^n$. The count of those numbers not containing a $2$ or $4$ is $4^n$ each, and the count of those not containing either is $3^n$. Thus the required answer is $5^n-2\cdot4^n+3^n$.

$\endgroup$
1
  • $\begingroup$ ah i see, so each digit has basically 5 options, so the total digits is 5^n , and then u do the same for the others, and when u add and subtract accordingly, u get the required answer. Thanks a lot! $\endgroup$ Dec 1 '20 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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