Menu Close

Is-there-a-formular-to-tell-how-many-times-a-digit-occur-in-an-interval-e-g-How-many-times-digits-2-occur-between-1-100-




Question Number 116091 by I want to learn more last updated on 30/Sep/20
Is there a formular to tell how many times a digit occur in an interval.    e.g.  How many times digits  2  occur between  1 − 100
$$\mathrm{Is}\:\mathrm{there}\:\mathrm{a}\:\mathrm{formular}\:\mathrm{to}\:\mathrm{tell}\:\mathrm{how}\:\mathrm{many}\:\mathrm{times}\:\mathrm{a}\:\mathrm{digit}\:\mathrm{occur}\:\mathrm{in}\:\mathrm{an}\:\mathrm{interval}. \\ $$$$ \\ $$$$\mathrm{e}.\mathrm{g}.\:\:\mathrm{How}\:\mathrm{many}\:\mathrm{times}\:\mathrm{digits}\:\:\mathrm{2}\:\:\mathrm{occur}\:\mathrm{between}\:\:\mathrm{1}\:−\:\mathrm{100} \\ $$
Answered by 1549442205PVT last updated on 01/Oct/20
In each tens the digits 2 appears one  time,only tens from 20 to 30 digits 2  appears two times.Therefore,from 1  to 100 digts 2 appears 11 times  The other digits are the  same
$$\mathrm{In}\:\mathrm{each}\:\mathrm{tens}\:\mathrm{the}\:\mathrm{digits}\:\mathrm{2}\:\mathrm{appears}\:\mathrm{one} \\ $$$$\mathrm{time},\mathrm{only}\:\mathrm{tens}\:\mathrm{from}\:\mathrm{20}\:\mathrm{to}\:\mathrm{30}\:\mathrm{digits}\:\mathrm{2} \\ $$$$\mathrm{appears}\:\mathrm{two}\:\mathrm{times}.\mathrm{Therefore},\mathrm{from}\:\mathrm{1} \\ $$$$\mathrm{to}\:\mathrm{100}\:\mathrm{digts}\:\mathrm{2}\:\mathrm{appears}\:\mathrm{11}\:\mathrm{times} \\ $$$$\mathrm{The}\:\mathrm{other}\:\mathrm{digits}\:\mathrm{are}\:\mathrm{the}\:\:\mathrm{same}\: \\ $$
Commented by I want to learn more last updated on 01/Oct/20
Thanks sir
$$\mathrm{Thanks}\:\mathrm{sir} \\ $$
Commented by 1549442205PVT last updated on 01/Oct/20
You are welcome
$$\mathrm{You}\:\mathrm{are}\:\mathrm{welcome} \\ $$
Commented by mr W last updated on 02/Oct/20
2 ⇒one time 2  12,22,32,...,92 ⇒10 times 2  20,21,23,...,29 ⇒9 times 2  ⇒totally 1+10+9=20 times 2
$$\mathrm{2}\:\Rightarrow{one}\:{time}\:\mathrm{2} \\ $$$$\mathrm{12},\mathrm{22},\mathrm{32},…,\mathrm{92}\:\Rightarrow\mathrm{10}\:{times}\:\mathrm{2} \\ $$$$\mathrm{20},\mathrm{21},\mathrm{23},…,\mathrm{29}\:\Rightarrow\mathrm{9}\:{times}\:\mathrm{2} \\ $$$$\Rightarrow{totally}\:\mathrm{1}+\mathrm{10}+\mathrm{9}=\mathrm{20}\:{times}\:\mathrm{2} \\ $$
Answered by mr W last updated on 01/Oct/20
n digit numbers:  10^(n−1) +(n−1)×9×10^(n−2)   =(9n+1)10^(n−2)     from 1 to 100:  1+19×1=20 times
$${n}\:{digit}\:{numbers}: \\ $$$$\mathrm{10}^{{n}−\mathrm{1}} +\left({n}−\mathrm{1}\right)×\mathrm{9}×\mathrm{10}^{{n}−\mathrm{2}} \\ $$$$=\left(\mathrm{9}{n}+\mathrm{1}\right)\mathrm{10}^{{n}−\mathrm{2}} \\ $$$$ \\ $$$${from}\:\mathrm{1}\:{to}\:\mathrm{100}: \\ $$$$\mathrm{1}+\mathrm{19}×\mathrm{1}=\mathrm{20}\:{times} \\ $$
Commented by I want to learn more last updated on 06/Oct/20
I just see this now sir,  so it will work for  1 to 50  too  or  another  nth derivative
$$\mathrm{I}\:\mathrm{just}\:\mathrm{see}\:\mathrm{this}\:\mathrm{now}\:\mathrm{sir},\:\:\mathrm{so}\:\mathrm{it}\:\mathrm{will}\:\mathrm{work}\:\mathrm{for}\:\:\mathrm{1}\:\mathrm{to}\:\mathrm{50}\:\:\mathrm{too}\:\:\mathrm{or} \\ $$$$\mathrm{another}\:\:\mathrm{nth}\:\mathrm{derivative} \\ $$
Commented by I want to learn more last updated on 06/Oct/20
And sorry for bordering you sir,  How to generalise it as you solve, so that i can think too on my own.  Thanks sir.
$$\mathrm{And}\:\mathrm{sorry}\:\mathrm{for}\:\mathrm{bordering}\:\mathrm{you}\:\mathrm{sir}, \\ $$$$\mathrm{How}\:\mathrm{to}\:\mathrm{generalise}\:\mathrm{it}\:\mathrm{as}\:\mathrm{you}\:\mathrm{solve},\:\mathrm{so}\:\mathrm{that}\:\mathrm{i}\:\mathrm{can}\:\mathrm{think}\:\mathrm{too}\:\mathrm{on}\:\mathrm{my}\:\mathrm{own}. \\ $$$$\mathrm{Thanks}\:\mathrm{sir}. \\ $$
Commented by I want to learn more last updated on 06/Oct/20
Thanks sir,  i appreciate.
$$\mathrm{Thanks}\:\mathrm{sir},\:\:\mathrm{i}\:\mathrm{appreciate}. \\ $$
Commented by mr W last updated on 06/Oct/20
let′s look at numbers with m digits  xxxx...x  the digit 2 (or any other non−zero  digit) can be at first position  2xxx..x  there are 10×10×..×10=10^(m−1)   such numbers, i.e. digit 2 comes  10^(m−1)  times at this position.  when the digit 2 is at other positions,  x2xx..x  (m−1 possible positions)  there are 9×10×10×...10=9×10^(m−2)   such numbers, i.e. digit 2 comes  (m−1)×9×10^(m−2)  times.    all together:  10^(m−1) +(m−1)×9×10^(m−2)   =10^(m−2) [10+(m−1)×9]  =(9m+1)×10^(m−2)
$${let}'{s}\:{look}\:{at}\:{numbers}\:{with}\:{m}\:{digits} \\ $$$${xxxx}…{x} \\ $$$${the}\:{digit}\:\mathrm{2}\:\left({or}\:{any}\:{other}\:{non}−{zero}\right. \\ $$$$\left.{digit}\right)\:{can}\:{be}\:{at}\:{first}\:{position} \\ $$$$\mathrm{2}{xxx}..{x} \\ $$$${there}\:{are}\:\mathrm{10}×\mathrm{10}×..×\mathrm{10}=\mathrm{10}^{{m}−\mathrm{1}} \\ $$$${such}\:{numbers},\:{i}.{e}.\:{digit}\:\mathrm{2}\:{comes} \\ $$$$\mathrm{10}^{{m}−\mathrm{1}} \:{times}\:{at}\:{this}\:{position}. \\ $$$${when}\:{the}\:{digit}\:\mathrm{2}\:{is}\:{at}\:{other}\:{positions}, \\ $$$${x}\mathrm{2}{xx}..{x}\:\:\left({m}−\mathrm{1}\:{possible}\:{positions}\right) \\ $$$${there}\:{are}\:\mathrm{9}×\mathrm{10}×\mathrm{10}×…\mathrm{10}=\mathrm{9}×\mathrm{10}^{{m}−\mathrm{2}} \\ $$$${such}\:{numbers},\:{i}.{e}.\:{digit}\:\mathrm{2}\:{comes} \\ $$$$\left({m}−\mathrm{1}\right)×\mathrm{9}×\mathrm{10}^{{m}−\mathrm{2}} \:{times}. \\ $$$$ \\ $$$${all}\:{together}: \\ $$$$\mathrm{10}^{{m}−\mathrm{1}} +\left({m}−\mathrm{1}\right)×\mathrm{9}×\mathrm{10}^{{m}−\mathrm{2}} \\ $$$$=\mathrm{10}^{{m}−\mathrm{2}} \left[\mathrm{10}+\left({m}−\mathrm{1}\right)×\mathrm{9}\right] \\ $$$$=\left(\mathrm{9}{m}+\mathrm{1}\right)×\mathrm{10}^{{m}−\mathrm{2}} \\ $$
Commented by I want to learn more last updated on 06/Oct/20
I appreciate sir
$$\mathrm{I}\:\mathrm{appreciate}\:\mathrm{sir} \\ $$

Leave a Reply

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