How many ways a number can be formed removing some character

79 Views Asked by At

I have got the number "392514576" and asked that how many ways can I make this number dividable by 5 without any fraction. * No rearrange , No repetition Just by removing some characters.

[It will be appreciated if Little explanation and shortcut way is given to calculate this types of problems]

2

There are 2 best solutions below

11
On

HINT

number is divisible by 5 if its last digit is 5 or 0. Your number has no zeros, but two fives. How can you remove some digits so 5 is last?

UPDATE 1

you certainly have to drop the last "76". As long as the final 5 is in place, you can remove or keep any digit. How many combinations is that? Also, possibly, you can drop the trailing 5, and then the "14" before them -- will that add any new combinations?

0
On

First of all you must remove the last $76$. To make the resulting number dividable by $5$ you must do it anyway. It will be the base for the further considerations.

Now we have the number $3925145$. As we can see, there are no repetitions before the last $5$, so any removal of digits before this number will give us different result. Threre also no $0$s, co we don't have to make another restrictions. You can remove (or not) any of the 6 digits before the last $5$, so now we have $2^6=64$ ways of making our number dividable by 5 .

The answer to the question "How many different numbers can we form...?" will be then "$2^6=64$". However, the question is "In how many ways we can do it?", so we have to calculate another ways (e.g. $3925$ can be obtained in two ways, bat was counted only once).

Remove the last $145$, which gives us $3925$. Now it will be our new base. There are no repetitions before 5 and there are no $0$s. We can then remove or not any digit before 5, so now we have $2^3=8$ new ways to make the resulting number dividable by $5$.

See, that there are no more $5$s nor $0$s, so now we can summarize our considerations:

The resulting number must have $0$ or $5$ on the last position.

In number $392514576$ there are 2 fives and no zeros. There are $64$ ways to get the number finished with the second $5$ and $8$ ways to get the number finished with the first $5$.

In total there are $72$ different ways to obtain a number dividable by $5$.