Menu Close

From-1-to-12345-how-many-numbers-contain-the-digit-0-Find-the-number-of-zeros-in-all-these-numbers-Example-10020-has-three-zeros-




Question Number 105791 by mr W last updated on 01/Aug/20
From 1 to 12345, how many numbers  contain the digit 0? Find the number  of zeros in all these numbers.  Example: 10020 has three zeros.
$${From}\:\mathrm{1}\:{to}\:\mathrm{12345},\:{how}\:{many}\:{numbers} \\ $$$${contain}\:{the}\:{digit}\:\mathrm{0}?\:{Find}\:{the}\:{number} \\ $$$${of}\:{zeros}\:{in}\:{all}\:{these}\:{numbers}. \\ $$$${Example}:\:\mathrm{10020}\:{has}\:{three}\:{zeros}. \\ $$
Commented by PRITHWISH SEN 2 last updated on 01/Aug/20
189+2700+1630 = 4519  The answer is 4519  please check
$$\mathrm{189}+\mathrm{2700}+\mathrm{1630}\:=\:\mathrm{4519} \\ $$$$\mathrm{The}\:\mathrm{answer}\:\mathrm{is}\:\mathrm{4519}\:\:\boldsymbol{\mathrm{please}}\:\boldsymbol{\mathrm{check}} \\ $$
Answered by mr W last updated on 02/Aug/20
N=number of numbers containing  at least one zero  S=number of zeros in the numbers    X,Y,Z=placeholder non−zero digits    one digit numbers:  X ⇒N=0, S=0    two digit numbers:  X0 ⇒N=9, S=9    three digit numbers:  X0Y, XY0 ⇒N=2×9^2 =162, S=162  X00 ⇒N=9, S=2×9=18  ⇒total N=162+9=171  ⇒total S=162+18=180    four digit numbers:  X0YZ,XY0Z,XYZ0 ⇒N=3×9^3 =2187, S=2187  X00Y,XY00,X0Y0 ⇒N=3×9^2 =243, S=486  X000 ⇒N=9, S=27  ⇒total N=2187+243+9=2439  ⇒total S=2187+486+27=2700    five digit numbers:  10000 ⇒N=1, S=4  1X000,10X00,100X0,1000X  ⇒N=2+9+9+9=29, S=87  1XY00,10XY0,100XY,1X0Y0,1X00Y,10X0Y  ⇒N=(9+3)+3×9^2 +2×2×9=291  ⇒S=2×291=582  10XYZ,1X0YZ,1XY0Z,1XYZ0  ⇒N=9^3 +2×9^2 +(9^2 +3×9)+(9^2 +2×9+4)=1102  ⇒S=1102  ⇒total N=1+29+291+1102=1423  ⇒total S=4+87+582+1102=1775    totally:  N=9+171+2439+1423=4042  S=9+180+2700+1775=4664
$${N}={number}\:{of}\:{numbers}\:{containing} \\ $$$${at}\:{least}\:{one}\:{zero} \\ $$$${S}={number}\:{of}\:{zeros}\:{in}\:{the}\:{numbers} \\ $$$$ \\ $$$${X},{Y},{Z}={placeholder}\:{non}−{zero}\:{digits} \\ $$$$ \\ $$$$\boldsymbol{{one}}\:\boldsymbol{{digit}}\:\boldsymbol{{numbers}}: \\ $$$${X}\:\Rightarrow{N}=\mathrm{0},\:{S}=\mathrm{0} \\ $$$$ \\ $$$$\boldsymbol{{two}}\:\boldsymbol{{digit}}\:\boldsymbol{{numbers}}: \\ $$$${X}\mathrm{0}\:\Rightarrow{N}=\mathrm{9},\:{S}=\mathrm{9} \\ $$$$ \\ $$$$\boldsymbol{{three}}\:\boldsymbol{{digit}}\:\boldsymbol{{numbers}}: \\ $$$${X}\mathrm{0}{Y},\:{XY}\mathrm{0}\:\Rightarrow{N}=\mathrm{2}×\mathrm{9}^{\mathrm{2}} =\mathrm{162},\:{S}=\mathrm{162} \\ $$$${X}\mathrm{00}\:\Rightarrow{N}=\mathrm{9},\:{S}=\mathrm{2}×\mathrm{9}=\mathrm{18} \\ $$$$\Rightarrow{total}\:{N}=\mathrm{162}+\mathrm{9}=\mathrm{171} \\ $$$$\Rightarrow{total}\:{S}=\mathrm{162}+\mathrm{18}=\mathrm{180} \\ $$$$ \\ $$$$\boldsymbol{{four}}\:\boldsymbol{{digit}}\:\boldsymbol{{numbers}}: \\ $$$${X}\mathrm{0}{YZ},{XY}\mathrm{0}{Z},{XYZ}\mathrm{0}\:\Rightarrow{N}=\mathrm{3}×\mathrm{9}^{\mathrm{3}} =\mathrm{2187},\:{S}=\mathrm{2187} \\ $$$${X}\mathrm{00}{Y},{XY}\mathrm{00},{X}\mathrm{0}{Y}\mathrm{0}\:\Rightarrow{N}=\mathrm{3}×\mathrm{9}^{\mathrm{2}} =\mathrm{243},\:{S}=\mathrm{486} \\ $$$${X}\mathrm{000}\:\Rightarrow{N}=\mathrm{9},\:{S}=\mathrm{27} \\ $$$$\Rightarrow{total}\:{N}=\mathrm{2187}+\mathrm{243}+\mathrm{9}=\mathrm{2439} \\ $$$$\Rightarrow{total}\:{S}=\mathrm{2187}+\mathrm{486}+\mathrm{27}=\mathrm{2700} \\ $$$$ \\ $$$$\boldsymbol{{five}}\:\boldsymbol{{digit}}\:\boldsymbol{{numbers}}: \\ $$$$\mathrm{10000}\:\Rightarrow{N}=\mathrm{1},\:{S}=\mathrm{4} \\ $$$$\mathrm{1}{X}\mathrm{000},\mathrm{10}{X}\mathrm{00},\mathrm{100}{X}\mathrm{0},\mathrm{1000}{X} \\ $$$$\Rightarrow{N}=\mathrm{2}+\mathrm{9}+\mathrm{9}+\mathrm{9}=\mathrm{29},\:{S}=\mathrm{87} \\ $$$$\mathrm{1}{XY}\mathrm{00},\mathrm{10}{XY}\mathrm{0},\mathrm{100}{XY},\mathrm{1}{X}\mathrm{0}{Y}\mathrm{0},\mathrm{1}{X}\mathrm{00}{Y},\mathrm{10}{X}\mathrm{0}{Y} \\ $$$$\Rightarrow{N}=\left(\mathrm{9}+\mathrm{3}\right)+\mathrm{3}×\mathrm{9}^{\mathrm{2}} +\mathrm{2}×\mathrm{2}×\mathrm{9}=\mathrm{291} \\ $$$$\Rightarrow{S}=\mathrm{2}×\mathrm{291}=\mathrm{582} \\ $$$$\mathrm{10}{XYZ},\mathrm{1}{X}\mathrm{0}{YZ},\mathrm{1}{XY}\mathrm{0}{Z},\mathrm{1}{XYZ}\mathrm{0} \\ $$$$\Rightarrow{N}=\mathrm{9}^{\mathrm{3}} +\mathrm{2}×\mathrm{9}^{\mathrm{2}} +\left(\mathrm{9}^{\mathrm{2}} +\mathrm{3}×\mathrm{9}\right)+\left(\mathrm{9}^{\mathrm{2}} +\mathrm{2}×\mathrm{9}+\mathrm{4}\right)=\mathrm{1102} \\ $$$$\Rightarrow{S}=\mathrm{1102} \\ $$$$\Rightarrow{total}\:{N}=\mathrm{1}+\mathrm{29}+\mathrm{291}+\mathrm{1102}=\mathrm{1423} \\ $$$$\Rightarrow{total}\:{S}=\mathrm{4}+\mathrm{87}+\mathrm{582}+\mathrm{1102}=\mathrm{1775} \\ $$$$ \\ $$$$\boldsymbol{{totally}}: \\ $$$${N}=\mathrm{9}+\mathrm{171}+\mathrm{2439}+\mathrm{1423}=\mathrm{4042} \\ $$$${S}=\mathrm{9}+\mathrm{180}+\mathrm{2700}+\mathrm{1775}=\mathrm{4664} \\ $$
Commented by PRITHWISH SEN 2 last updated on 01/Aug/20
considering 2 zero of 5 digits  the no. of zero will be = 285×2=570 instead of  285×3= 855  ∴ the total zero = 4519   please check sir .
$$\mathrm{considering}\:\mathrm{2}\:\mathrm{zero}\:\mathrm{of}\:\mathrm{5}\:\mathrm{digits} \\ $$$$\mathrm{the}\:\mathrm{no}.\:\mathrm{of}\:\mathrm{zero}\:\mathrm{will}\:\mathrm{be}\:=\:\mathrm{285}×\mathrm{2}=\mathrm{570}\:\boldsymbol{\mathrm{instead}}\:\boldsymbol{\mathrm{of}} \\ $$$$\mathrm{285}×\mathrm{3}=\:\mathrm{855}\:\:\therefore\:\boldsymbol{\mathrm{the}}\:\boldsymbol{\mathrm{total}}\:\boldsymbol{\mathrm{zero}}\:=\:\mathrm{4519} \\ $$$$\:\boldsymbol{\mathrm{please}}\:\boldsymbol{\mathrm{check}}\:\boldsymbol{\mathrm{sir}}\:. \\ $$$$ \\ $$
Commented by mr W last updated on 01/Aug/20
it was wrong for five digit numbers.  now the answer is correct.
$${it}\:{was}\:{wrong}\:{for}\:{five}\:{digit}\:{numbers}. \\ $$$${now}\:{the}\:{answer}\:{is}\:{correct}. \\ $$

Leave a Reply

Your email address will not be published. Required fields are marked *