TCS
Company
Category
A person starts writing all the 4 digits number , how many times he has written the digit 2 ?
Read Solution (Total 5)
-
- ---2 => 9*10*10 = 900 numbers contains 2 at unit place
--2- => 9*10*10 = 900
-2-- => 9*10*10 = 900
2--- => 10*10*10 = 1000
total = 900 + 900 + 900 + 1000 = 3700 - 10 years agoHelpfull: Yes(28) No(5)
- 2---=>10*10*10=1000 numbers contains 2 in thousands place
-2-- =>here 2 and 0 wont come in thousands place
=>8*10*10=800
--2- => now 2 wont come in thousands place and hundreds place and 0 wont come in thousands place
=>8*9*10=720
---2 => 0 wont come in thousands place and 2 will not come in any of the remaining places
8*9*9=648
total=1000+800+720+648=3168 - 10 years agoHelpfull: Yes(6) No(2)
- all 4 digit no =9*10*10*10=9000
4 digit no not contains 2=8*9*9*9=5832
4 digit no contains 2=9000-5832=3168 - 10 years agoHelpfull: Yes(1) No(0)
- sorry bt its how many times digit 2 so
-------------------
2 one time
2 at unit place=1*9*9*9=729
2 at any other place=8*9*9*1*3!/2!=1944
total 2 encountered=2673 times
----------------
2 two times
2 at unit place=1*9*9*1*3!/2!=243
2 at any other place=8*9*1*1*3!/2!=216
total 2 encountered=458*2=918 times
----------------
2 three times
2 at unit place=1*1*1*9*3!/2!=27
2 at any other place=8*1*1*1=8
total 2 encountered=35*3=105 times
----------------------
2 four times=1
total 2 encountered=4*1=4 times
-----------------
now total 2 encountered=2673+918+105+4=3700 - 10 years agoHelpfull: Yes(1) No(0)
- If all no. starting from 1 to (10^n)-1 (i.e. up to n digits)
have to be written then we need to write n*10^(n-1) times
a non zero digit.
so for only 4 digits, required no. is (4*10^3)-(3*10^2)=3700.
- 10 years agoHelpfull: Yes(0) No(1)
TCS Other Question