Difference between revisions of "1997 PMWC Problems/Problem T3"

m
(Solution)
Line 3: Line 3:
  
 
__TOC__
 
__TOC__
==Solution==
+
==Solution 1==
=== Solution 1 ===
 
 
Let's call the three digit, two digit, and one digit numbers, when combined, the 0 thousands.
 
Let's call the three digit, two digit, and one digit numbers, when combined, the 0 thousands.
  
Line 17: Line 16:
 
<math>20+280=300 \Longrightarrow 300*2-5=595</math> is the answer.
 
<math>20+280=300 \Longrightarrow 300*2-5=595</math> is the answer.
  
=== Solution 2 ===
+
== Solution 2 ==
 
Consider the numbers from 1 to 1000. Since <tt>9</tt> appears <math>\frac{1}{10}</math> of the time for each digit (if we include 0), there are <math>\frac{1000}{10} = 100</math> '<tt>9</tt>'s in each place, for a total of <math>300</math> '<tt>9</tt>'s. Repeating again up to 2000, there are <math>600</math> '<tt>9</tt>'s; we exclude <math>1998, 1999</math>, so we have <math>600 - 5 = 595</math> '<tt>9</tt>'s.
 
Consider the numbers from 1 to 1000. Since <tt>9</tt> appears <math>\frac{1}{10}</math> of the time for each digit (if we include 0), there are <math>\frac{1000}{10} = 100</math> '<tt>9</tt>'s in each place, for a total of <math>300</math> '<tt>9</tt>'s. Repeating again up to 2000, there are <math>600</math> '<tt>9</tt>'s; we exclude <math>1998, 1999</math>, so we have <math>600 - 5 = 595</math> '<tt>9</tt>'s.
  

Revision as of 14:38, 20 April 2014

Problem

To type all the integers from 1 to 1997 using a typewriter on a piece of paper, how many times is the key '9' needed to be pressed?

Solution 1

Let's call the three digit, two digit, and one digit numbers, when combined, the 0 thousands.

The 0 thousand has the same number of nines as the one thousand, so we can compute the number of nines in the 0 thousands and multiply it by 2 and subtract 5, since we are leaving out 1998 and 1999.

  • one digit: one nine, obviously.
  • two digit: a nine times nine, plus 10 other nines, is 19 nines.
  • three digit: 20 per hundred, plus another hundred for the 900s, is 280.

$20+280=300 \Longrightarrow 300*2-5=595$ is the answer.

Solution 2

Consider the numbers from 1 to 1000. Since 9 appears $\frac{1}{10}$ of the time for each digit (if we include 0), there are $\frac{1000}{10} = 100$ '9's in each place, for a total of $300$ '9's. Repeating again up to 2000, there are $600$ '9's; we exclude $1998, 1999$, so we have $600 - 5 = 595$ '9's.

See Also

1997 PMWC (Problems)
Preceded by
Problem T2
Followed by
Problem T4
I: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
T: 1 2 3 4 5 6 7 8 9 10