Difference between revisions of "1997 AHSME Problems/Problem 30"

m (Solution)
Line 5: Line 5:
 
<math> \textbf{(A)}\ 16\qquad\textbf{(B)}\ 20\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 35 </math>  
 
<math> \textbf{(A)}\ 16\qquad\textbf{(B)}\ 20\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 35 </math>  
  
==Solution==
+
==Solution 1==
  
 
If <math>D(n)</math> is even, then the binary expansion of <math>n</math> will both begin and end with a <math>1</math>, because all positive binary numbers begin with a <math>1</math>, and if you switch digits twice, you will have a <math>1</math> at the end.  Thus, we are only concerned with the <math>49</math> odd numbers between <math>1</math> and <math>98</math> inclusive.
 
If <math>D(n)</math> is even, then the binary expansion of <math>n</math> will both begin and end with a <math>1</math>, because all positive binary numbers begin with a <math>1</math>, and if you switch digits twice, you will have a <math>1</math> at the end.  Thus, we are only concerned with the <math>49</math> odd numbers between <math>1</math> and <math>98</math> inclusive.
Line 28: Line 28:
  
 
Thus, we know that there are <math>6</math> odd numbers that have <math>D(n) = 0</math>, and <math>16</math> odd numbers that have <math>D(n) = 4</math>, and <math>1</math> number that has <math>D(n) = 6</math>.  The remaining odd numbers must have <math>D(n) = 2</math>.  This means there are <math>49 - 6 - 16 - 1 = 26</math> numbers that have <math>D(n) = 2</math>, which is option <math>\boxed{C}</math>
 
Thus, we know that there are <math>6</math> odd numbers that have <math>D(n) = 0</math>, and <math>16</math> odd numbers that have <math>D(n) = 4</math>, and <math>1</math> number that has <math>D(n) = 6</math>.  The remaining odd numbers must have <math>D(n) = 2</math>.  This means there are <math>49 - 6 - 16 - 1 = 26</math> numbers that have <math>D(n) = 2</math>, which is option <math>\boxed{C}</math>
 +
 +
==Solution 2==
  
 
== See also ==
 
== See also ==
 
{{AHSME box|year=1997|num-b=29|after=Last Question}}
 
{{AHSME box|year=1997|num-b=29|after=Last Question}}
 
{{MAA Notice}}
 
{{MAA Notice}}

Revision as of 18:51, 1 August 2016

Problem

For positive integers $n$, denote $D(n)$ by the number of pairs of different adjacent digits in the binary (base two) representation of $n$. For example, $D(3) = D(11_{2}) = 0$, $D(21) = D(10101_{2}) = 4$, and $D(97) = D(1100001_{2}) = 2$. For how many positive integers less than or equal $97$ to does $D(n) = 2$?

$\textbf{(A)}\ 16\qquad\textbf{(B)}\ 20\qquad\textbf{(C)}\ 26\qquad\textbf{(D)}\ 30\qquad\textbf{(E)}\ 35$

Solution 1

If $D(n)$ is even, then the binary expansion of $n$ will both begin and end with a $1$, because all positive binary numbers begin with a $1$, and if you switch digits twice, you will have a $1$ at the end. Thus, we are only concerned with the $49$ odd numbers between $1$ and $98$ inclusive.

All of these odd numbers will have an even $D(n)$. $D(n) = 0$ will be given by the numbers $1, 11, 111, 1111, 11111, 111111$, which is a total of $6$ numbers.

We skip $D(n) = 2$ for now, and move to $D(n) = 4$, which is easier to count. The smallest $D(n) = 4$ happens when $n = 10101$. To get another number such that $D(n) = 4$, we may extend any of the five blocks of zeros or ones by one digit. This will form $110101, 100101, 101101, 101001, 101011$, all of which are odd numbers that have $D(n) = 4$. To find seven digit numbers that have $D(n) = 4$, we can again extend any block by one, so long as it remains less than $1100001$ or under. There are five cases.

1) Extending $110101$ is impossible without going over $1100001$.

2) Extending $100101$ by putting a $1$ at the beginning will go over $1100001$, but the other four extensions work, giving $1000101, 1001101, 1001001, 1001011$.

3) Extending $101101$ by putting a $1$ at the beginning will go over $1100001$, but the other four extensions give $1001101, 1011101, 1011001, 1011011$. However, $1001101$ already appeared in #2, giving only three new numbers.

4) Extending $101001$ at the first group is impossible. The other four extensions are $1001001, 1011001, 1010001, 1010011$, but the first two are repeats. Thus, there are only two new numbers.

5) Extending $101011$ at the first group is impossible. The other four extensions give $1001011, 1011011, 1010011, 1010111$, but only the last number is new.

Thus, there is $1$ five digit number, $5$ six digit numbers, and $4 + 3 + 2 + 1 = 10$ seven digit numbers under $1100001$ for which $D(n) = 4$. That gives a total of $16$ numbers.

There smallest number for which $D(n) = 6$ is $1010101$, which is under $98$. Further extensions, as well as cases where $D(n) > 6$, are not possible.

Thus, we know that there are $6$ odd numbers that have $D(n) = 0$, and $16$ odd numbers that have $D(n) = 4$, and $1$ number that has $D(n) = 6$. The remaining odd numbers must have $D(n) = 2$. This means there are $49 - 6 - 16 - 1 = 26$ numbers that have $D(n) = 2$, which is option $\boxed{C}$

Solution 2

See also

1997 AHSME (ProblemsAnswer KeyResources)
Preceded by
Problem 29
Followed by
Last Question
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
All AHSME Problems and Solutions

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