The number of n digit numbers which consists of the digits 1 &2 only if each digit is to be used atleast once is equal to 510 then n is equal to:

352 Views Asked by At

I tried to solve this questions many times but couldn't even get close to the answer, please help. The answer to this question is 9.

1

There are 1 best solutions below

0
On BEST ANSWER

Just solve for $n$ in $2^n-2=510$.

Explanation: You have $n$ places to fill with either $1$ or $2$, so you have $2^n$ possible numbers having either $1$ or $2$ at its different places. But they also include the numbers in which there is no $2$ or $1$. And there are only two such numbers in $2^n$, so you need to subtract $2$ from $2^n$ to get the total no. of numbers having at least $1$ or $2$ once in them formed with only $1$ and $2$.