Difference between revisions of "1997 AHSME Problems/Problem 30"
Talkinaway (talk | contribs) |
Talkinaway (talk | contribs) |
||
Line 4: | Line 4: | ||
<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== | ||
+ | |||
+ | 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. | ||
+ | |||
+ | All of these odd numbers will have an odd <math>D(n)</math>. <math>D(n) = 0</math> will be given by the numbers <math>1, 11, 111, 1111, 11111, 111111</math>, which is a total of <math>6</math> numbers. | ||
+ | |||
+ | We skip <math>D(n) = 2</math> for now, and move to <math>D(n) = 4</math>, which is easier to count. The smallest <math>D(n) = 4</math> happens when <math>n = 10101</math>. To get another number such that <math>D(n) = 4</math>, we may extend any of the five blocks of zeros or ones by one digit. This will form <math>110101, 100101, 101101, 101001, 101011</math>, all of which are odd numbers that have <math>D(n) = 4</math>. To find seven digit numbers that have <math>D(n) = 4</math>, we can again extend any block by one, so long as it remains less than <math>1100001</math> or under. There are five cases. | ||
+ | |||
+ | 1) Extending <math>110101</math> is impossible without going over <math>1100001</math>. | ||
+ | |||
+ | 2) Extending <math>100101</math> by putting a <math>1</math> at the beginning will go over <math>1100001</math>, but the other four extensions work, giving <math>1000101, 1001101, 1001001, 1001011</math>. | ||
+ | |||
+ | 3) Extending <math>101101</math> by putting a <math>1</math> at the beginning will go over <math>1100001</math>, but the other four extensions give <math>1001101, 1011101, 1011001, 1011011</math>. However, <math>1001101</math> already appeared in #2, giving only three new numbers. | ||
+ | |||
+ | 4) Extending <math>101001</math> at the first group is impossible. The other four extensions are <math>1001001, 1011001, 1010001, 1010011</math>, but the first two are repeats. Thus, there are only two new numbers. | ||
+ | |||
+ | 5) Extending <math>101011</math> at the first group is impossible. The other four extensions give <math>1001011, 1011011, 1010011, 1010111</math>, but only the last number is new. | ||
+ | |||
+ | Thus, there is <math>1</math> five digit number, <math>5</math> six digit numbers, and <math>4 + 3 + 2 + 1 = 10</math> seven digit numbers under <math>1100001</math> for which <math>D(n) = 4</math>. That gives a total of <math>16</math> numbers. | ||
+ | |||
+ | There smallest number for which <math>D(n) = 6</math> is <math>1010101</math>, which is under <math>98</math>. Further extensions, as well as cases where <math>D(n) > 6</math>, are not possible. | ||
+ | |||
+ | 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> | ||
== See also == | == See also == | ||
{{AHSME box|year=1997|num-b=29|after=Last Question}} | {{AHSME box|year=1997|num-b=29|after=Last Question}} |
Revision as of 23:11, 23 August 2011
Problem
For positive integers , denote by the number of pairs of different adjacent digits in the binary (base two) representation of . For example, , , and . For how many positive integers less than or equal to does ?
Solution
If is even, then the binary expansion of will both begin and end with a , because all positive binary numbers begin with a , and if you switch digits twice, you will have a at the end. Thus, we are only concerned with the odd numbers between and inclusive.
All of these odd numbers will have an odd . will be given by the numbers , which is a total of numbers.
We skip for now, and move to , which is easier to count. The smallest happens when . To get another number such that , we may extend any of the five blocks of zeros or ones by one digit. This will form , all of which are odd numbers that have . To find seven digit numbers that have , we can again extend any block by one, so long as it remains less than or under. There are five cases.
1) Extending is impossible without going over .
2) Extending by putting a at the beginning will go over , but the other four extensions work, giving .
3) Extending by putting a at the beginning will go over , but the other four extensions give . However, already appeared in #2, giving only three new numbers.
4) Extending at the first group is impossible. The other four extensions are , but the first two are repeats. Thus, there are only two new numbers.
5) Extending at the first group is impossible. The other four extensions give , but only the last number is new.
Thus, there is five digit number, six digit numbers, and seven digit numbers under for which . That gives a total of numbers.
There smallest number for which is , which is under . Further extensions, as well as cases where , are not possible.
Thus, we know that there are odd numbers that have , and odd numbers that have , and number that has . The remaining odd numbers must have . This means there are numbers that have , which is option
See also
1997 AHSME (Problems • Answer Key • Resources) | ||
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 |