Difference between revisions of "2003 AIME I Problems/Problem 9"

 
(5 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
An [[integer]] between <math>1000</math> and <math>9999</math>, inclusive, is called ''balanced'' if the sum of its two leftmost [[digit]]s equals the sum of its two rightmost digits. How many balanced integers are there?
 
An [[integer]] between <math>1000</math> and <math>9999</math>, inclusive, is called ''balanced'' if the sum of its two leftmost [[digit]]s equals the sum of its two rightmost digits. How many balanced integers are there?
  
== Solution ==
+
== Solution 1==
 
If the common sum of the first two and last two digits is <math>n</math>, such that <math>1 \leq n \leq 9</math>, there are <math>n</math> choices for the first two digits and <math>n + 1</math> choices for the second two digits (since zero may not be the first digit).  This gives <math>\sum_{n = 1}^9 n(n + 1) = 330</math> balanced numbers.  If the common sum of the first two and last two digits is <math>n</math>, such that <math>10 \leq n \leq 18</math>, there are <math>19 - n</math> choices for both pairs.  This gives <math>\sum_{n = 10}^{18} (19 - n)^2 = \sum_{n = 1}^9 n^2 = 285</math> balanced numbers.  Thus, there are in total <math>330 + 285 = \boxed{615}</math> balanced numbers.
 
If the common sum of the first two and last two digits is <math>n</math>, such that <math>1 \leq n \leq 9</math>, there are <math>n</math> choices for the first two digits and <math>n + 1</math> choices for the second two digits (since zero may not be the first digit).  This gives <math>\sum_{n = 1}^9 n(n + 1) = 330</math> balanced numbers.  If the common sum of the first two and last two digits is <math>n</math>, such that <math>10 \leq n \leq 18</math>, there are <math>19 - n</math> choices for both pairs.  This gives <math>\sum_{n = 10}^{18} (19 - n)^2 = \sum_{n = 1}^9 n^2 = 285</math> balanced numbers.  Thus, there are in total <math>330 + 285 = \boxed{615}</math> balanced numbers.
  
 
Both summations may be calculated using the formula for the [[perfect square|sum of consecutive squares]], namely <math>\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}</math>.
 
Both summations may be calculated using the formula for the [[perfect square|sum of consecutive squares]], namely <math>\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}</math>.
 
  
 
== Solution 2 (Painful Casework) ==
 
== Solution 2 (Painful Casework) ==
Line 12: Line 11:
 
Call the number <math>\overline{abcd}</math>. Then <math>a+b=c+d</math>. Set <math>a+b=x</math>.
 
Call the number <math>\overline{abcd}</math>. Then <math>a+b=c+d</math>. Set <math>a+b=x</math>.
  
Clearly, <math>2\lex\le18</math>.
+
Clearly, <math>0\le x \le18</math>.
 +
 
 +
If <math>x=0</math>: <math>0000</math> is not acceptable.
  
 
If <math>x=1</math>: The only case is <math>1001</math> or <math>1010</math>. 2 choices.
 
If <math>x=1</math>: The only case is <math>1001</math> or <math>1010</math>. 2 choices.
  
If <math>x=2</math>: then since <math>a\neq0</math>, <math>a=1=b</math> or <math>a=2, b=0</math>. There are 3 choices for <math>(c,d)</math>: <math>(2,0), (0, 2), (1, 1). </math>2*3=6<math> here.
+
If <math>x=2</math>: then since <math>a\neq0</math>, <math>a=1=b</math> or <math>a=2, b=0</math>. There are 3 choices for <math>(c,d)</math>: <math>(2,0), (0, 2), (1, 1)</math>. <math>2*3=6</math> here.
  
If </math>x=3<math>: Clearly, </math>a\neqb<math> because if so, the sum will be even, not odd. Counting </math>(a,b)=(3,0)<math>, we have </math>4<math> choices. Subtracting that, we have </math>3<math> choices. Since it doesn't matter whether </math>c=0<math> or </math>d=0<math>, we have 4 choices for </math>(c,d)<math>. So </math>3*4=12<math> here.
+
If <math>x=3</math>: Clearly, <math>a\neq b</math> because if so, the sum will be even, not odd. Counting <math>(a,b)=(3,0)</math>, we have <math>4</math> choices. Subtracting that, we have <math>3</math> choices. Since it doesn't matter whether <math>c=0</math> or <math>d=0</math>, we have 4 choices for <math>(c,d)</math>. So <math>3*4=12</math> here.
  
If </math>x=4<math>: Continue as above. </math>4<math> choices for </math>(a,b)<math>. </math>5<math> choices for </math>(c,d)<math>. </math>4*5=20<math> here.
+
If <math>x=4</math>: Continue as above. <math>4</math> choices for <math>(a,b)</math>. <math>5</math> choices for <math>(c,d)</math>. <math>4*5=20</math> here.
  
If </math>x=5<math>: You get the point. </math>5*6=30<math>.
+
If <math>x=5</math>: You get the point. <math>5*6=30</math>.
  
If </math>x=6<math>: </math>6*7=42<math>.
+
If <math>x=6</math>: <math>6*7=42</math>.
  
If </math>x=7<math>: </math>7*8=56<math>.
+
If <math>x=7</math>: <math>7*8=56</math>.
  
If </math>x=8<math>: </math>8*9=72<math>.
+
If <math>x=8</math>: <math>8*9=72</math>.
  
If </math>x=9<math>: </math>9*10=90<math>.
+
If <math>x=9</math>: <math>9*10=90</math>.
  
Now we need to be careful because if </math>x=10<math>, </math>(c,d)=(0,10)<math> is not valid. However, we don't have to worry about </math>a\neq0<math>.
+
Now we need to be careful because if <math>x=10</math>, <math>(c,d)=(0,10)</math> is not valid. However, we don't have to worry about <math>a\neq0</math>.
  
If </math>x=10<math>: </math>(a,b)=(1,9), (2, 8), ..., (9, 1)<math>. Same thing for </math>(c,d)<math>. </math>9*9=81<math>.
+
If <math>x=10</math>: <math>(a,b)=(1,9), (2, 8), ..., (9, 1)</math>. Same thing for <math>(c,d)</math>. <math>9*9=81</math>.
  
If </math>x=11<math>: We start at </math>(a,b)= (2,9)<math>. So </math>8*8<math>.
+
If <math>x=11</math>: We start at <math>(a,b)= (2,9)</math>. So <math>8*8</math>.
  
Continue this pattern until </math>x=18: 1*1=1<math>. Add everything up: we have </math>\boxed{615}$.
+
Continue this pattern until <math>x=18: 1*1=1</math>. Add everything up: we have <math>\boxed{615}</math>.
  
 
~hastapasta
 
~hastapasta
 +
 +
== Solution 3 ==
 +
 +
We ignore the requirement that the first digit is non-zero, and do casework on the sum of the sum of the pairs of digits.
 +
 +
If two digits <math>a</math> and <math>b</math> sum to <math>0</math>, we have <math>1</math> possibility: <math>(a,b) = (0,0)</math>
 +
 +
If <math>a+b = 1</math>, we have <math>2</math> possibilities: <math>(a,b) = (0,1)</math> and <math>(a,b) = (1,0)</math>
 +
 +
<math>a+b = 2</math>: <math>(0,2)</math>, <math>(2,0)</math>, and <math>(1,1)</math> are the only <math>3</math> possibilities.
 +
 +
We notice a pattern: for all <math>k \leq 9</math>, there are <math>k+1</math> ordered pairs of digits <math>(a,b)</math> such that <math>a+b = k</math>. Then, testing for <math>10 \leq k \leq 18</math>, we notice that there are <math>(18 - k) + 1</math> ordered pairs with a sum of <math>k</math>.
 +
 +
So the number of ways to pick <math>4</math> digits satisfying the constraint is
 +
<cmath>(1)(1) + (2)(2) \dots (10)(10) + (9)(9) + \dots + (1)(1) = \frac{(10)(11)(21)}{6} + \frac{(9)(10)(19)}{6} = 670</cmath>
 +
 +
We have to subtract out the cases where the first digit is <math>0</math>, which is <math>1+2+\dots+10  = 55</math>
 +
 +
So our answer is <math>670-55 = \boxed{615}</math>
 +
 +
This solution takes some inspiration from dice. In a way, we are counting the number of ways to roll a given number with a pair of <math>10</math>-sided dice.
 +
 +
~jd9
  
 
== See also ==
 
== See also ==

Latest revision as of 10:55, 10 September 2023

Problem

An integer between $1000$ and $9999$, inclusive, is called balanced if the sum of its two leftmost digits equals the sum of its two rightmost digits. How many balanced integers are there?

Solution 1

If the common sum of the first two and last two digits is $n$, such that $1 \leq n \leq 9$, there are $n$ choices for the first two digits and $n + 1$ choices for the second two digits (since zero may not be the first digit). This gives $\sum_{n = 1}^9 n(n + 1) = 330$ balanced numbers. If the common sum of the first two and last two digits is $n$, such that $10 \leq n \leq 18$, there are $19 - n$ choices for both pairs. This gives $\sum_{n = 10}^{18} (19 - n)^2 = \sum_{n = 1}^9 n^2 = 285$ balanced numbers. Thus, there are in total $330 + 285 = \boxed{615}$ balanced numbers.

Both summations may be calculated using the formula for the sum of consecutive squares, namely $\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}$.

Solution 2 (Painful Casework)

Call the number $\overline{abcd}$. Then $a+b=c+d$. Set $a+b=x$.

Clearly, $0\le x \le18$.

If $x=0$: $0000$ is not acceptable.

If $x=1$: The only case is $1001$ or $1010$. 2 choices.

If $x=2$: then since $a\neq0$, $a=1=b$ or $a=2, b=0$. There are 3 choices for $(c,d)$: $(2,0), (0, 2), (1, 1)$. $2*3=6$ here.

If $x=3$: Clearly, $a\neq b$ because if so, the sum will be even, not odd. Counting $(a,b)=(3,0)$, we have $4$ choices. Subtracting that, we have $3$ choices. Since it doesn't matter whether $c=0$ or $d=0$, we have 4 choices for $(c,d)$. So $3*4=12$ here.

If $x=4$: Continue as above. $4$ choices for $(a,b)$. $5$ choices for $(c,d)$. $4*5=20$ here.

If $x=5$: You get the point. $5*6=30$.

If $x=6$: $6*7=42$.

If $x=7$: $7*8=56$.

If $x=8$: $8*9=72$.

If $x=9$: $9*10=90$.

Now we need to be careful because if $x=10$, $(c,d)=(0,10)$ is not valid. However, we don't have to worry about $a\neq0$.

If $x=10$: $(a,b)=(1,9), (2, 8), ..., (9, 1)$. Same thing for $(c,d)$. $9*9=81$.

If $x=11$: We start at $(a,b)= (2,9)$. So $8*8$.

Continue this pattern until $x=18: 1*1=1$. Add everything up: we have $\boxed{615}$.

~hastapasta

Solution 3

We ignore the requirement that the first digit is non-zero, and do casework on the sum of the sum of the pairs of digits.

If two digits $a$ and $b$ sum to $0$, we have $1$ possibility: $(a,b) = (0,0)$

If $a+b = 1$, we have $2$ possibilities: $(a,b) = (0,1)$ and $(a,b) = (1,0)$

$a+b = 2$: $(0,2)$, $(2,0)$, and $(1,1)$ are the only $3$ possibilities.

We notice a pattern: for all $k \leq 9$, there are $k+1$ ordered pairs of digits $(a,b)$ such that $a+b = k$. Then, testing for $10 \leq k \leq 18$, we notice that there are $(18 - k) + 1$ ordered pairs with a sum of $k$.

So the number of ways to pick $4$ digits satisfying the constraint is \[(1)(1) + (2)(2) \dots (10)(10) + (9)(9) + \dots + (1)(1) = \frac{(10)(11)(21)}{6} + \frac{(9)(10)(19)}{6} = 670\]

We have to subtract out the cases where the first digit is $0$, which is $1+2+\dots+10  = 55$

So our answer is $670-55 = \boxed{615}$

This solution takes some inspiration from dice. In a way, we are counting the number of ways to roll a given number with a pair of $10$-sided dice.

~jd9

See also

2003 AIME I (ProblemsAnswer KeyResources)
Preceded by
Problem 8
Followed by
Problem 10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
All AIME Problems and Solutions

The problems on this page are copyrighted by the Mathematical Association of America's American Mathematics Competitions. AMC logo.png