返回题库

AIME 2004 II · 第 10 题

AIME 2004 II — Problem 10

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

Let SS be the set of integers between 11 and 2402^{40} whose binary expansions have exactly two 11's. If a number is chosen at random from S,S, the probability that it is divisible by 99 is p/q,p/q, where pp and qq are relatively prime positive integers. Find p+q.p+q.

解析

Solution 1 (Rigorous)

Any number from 1 to 2402^{40} can be represented in binary with 40 digits (because 2402^{40} has 41) with leading zeroes if necessary. Therefore the number of sets where there are exactly two 1’s in this binary representation is just (402)\binom {40}{2} because we’re choosing 2 1s to go in 40 digit slots. This is equal to 780; we have found qq, our denominator.

With these particular numbers, when converting back to decimal note that the 38 zeroes all cancel out. Let the first 1 when reading the number in binary from left to right be in position yy, I.e. when converting to decimal, it will have value 2y2^{y}. Similarly, let the second 1 have position xx (note x);thenthedecimalvalueofthat1willbex); then the decimal value of that 1 will be2^{x}.Forexample,withthebinarystring0001001000. For example, with the binary string 0001001000yis6andis 6 andx$ is 3 (note that it is zero indexed).

It should also be noted that our constraints on xx and yy are 0x<y<400 \leq x < y < 40 and x,yZx, y \in \mathbb{Z}.

The numbers that satisfy the constraints are therefore equal to 2x+2y=2x(1+2yx)2^{x}+2^{y} = 2^{x} \cdot (1+2^{y-x}). The conditions say that this is divisible by 9. 2x2^{x} is clearly never divisible by 9, so we can just focus on 1+2yx1+2^{y-x}.

1+2yx0(mod9)    2yx1(mod9)    2yx8(mod9)1+2^{y-x} \equiv 0 \pmod 9 \implies 2^{y-x} \equiv -1 \pmod 9 \implies 2^{y-x} \equiv 8 \pmod 9 yx=3y-x = 3 clearly satisfies the congruence, but are there any more? Well, we see that any time we raise -1 (in the second congruence above) to an odd power we get -1 again, so if we raise 232^{3}, which we know already works, to an odd power, we will also satisfy the congruence. Thus, 23,29,215,2^{3}, 2^{9}, 2^{15}, etc. work; or,

yx3(mod6)y-x \equiv 3 \pmod 6 To count the numbers that satisfy the condition, we need to find the amount of numbers that satisfy 2x(1+2yx)2402^{x} \cdot (1+2^{y-x}) \leq 2^{40}, and yx3(mod6)=6n+3y-x \equiv 3 \pmod 6 = 6n +3 for some whole number nn.

Since we know 1+2yx=1+26n+31+2^{y-x} = 1+2^{6n+3} is positive, we can divide both sides of the inequality by it;

2x(1+2yx)240    2x2401+2yx    2x2401+26n+32^{x} \cdot (1+2^{y-x}) \leq 2^{40} \implies 2^{x} \leq \frac{2^{40}}{1+2^{y-x}} \implies 2^{x} \leq \frac{2^{40}}{1+2^{6n+3}}     2x<24026n+3    2x<240(6n+3)    2x<2376n    x<376n\implies 2^{x} < \frac{2^{40}}{2^{6n+3}} \implies 2^{x} < 2^{40-(6n+3)}\implies 2^{x} < 2^{37-6n} \implies x < 37 - 6n Finally, the number of possible values of xx is 376n37-6n because xx can also be 0 and must be an integer.Therefore, as we increase nn from zero upwards, we get the total number of possibilities for xx is 37+31+25++1=7+36+30+24++6+0=7+6(6+5+4+1)37+31+25+\ldots+1 = 7 + 36 + 30 + 24 + \ldots + 6 + 0 = 7 + 6 \cdot (6 + 5 + 4\ldots + 1)

=7+637=7+187=197=133= 7 + 6 \cdot 3 \cdot 7 = 7 + 18 \cdot 7 = 19 \cdot 7 = 133.

Since 133 and 780 are relatively prime, the answer is 133780\frac{133}{780} and our final answer is 133+780=913133+780 = \boxed{913}

~KingRavi

Solution 2

A positive integer nn has exactly two 1s in its binary representation exactly when n=2j+2kn = 2^j + 2^k for jkj \neq k nonnegative integers. Thus, the set SS is equal to the set {nZn=2j+2kand0j<k39}\{n \in \mathbb{Z} \mid n = 2^j + 2^k \,\mathrm{ and }\, 0 \leq j < k \leq 39\}. (The second condition ensures simultaneously that jkj \neq k and that each such number less than 2402^{40} is counted exactly once.) This means there are (402)=780{40 \choose 2} = 780 total such numbers.

Now, consider the powers of 22 mod 99: 26n1,26n+12,26n+24,26n+381,2^{6n} \equiv 1, 2^{6n + 1} \equiv 2, 2^{6n + 2} \equiv 4, 2^{6n + 3} \equiv 8 \equiv -1, 26n+472,2^{6n + 4} \equiv 7 \equiv -2, 26n+554(mod9)2^{6n + 5} \equiv 5 \equiv -4 \pmod 9.

It's clear what the pairs j,kj, k can look like. If one is of the form 6n6n (7 choices), the other must be of the form 6n+36n + 3 (7 choices). If one is of the form 6n+16n + 1 (7 choices) the other must be of the form 6n+46n + 4 (6 choices). And if one is of the form 6n+26n + 2 (7 choices), the other must be of the form 6n+56n + 5 (6 choices). This means that there are 77+76+76=49+42+42=1337\cdot 7 + 7\cdot 6 + 7\cdot 6 = 49 + 42 +42 = 133 total "good" numbers.

The probability is 133780\frac{133}{780}, and the answer is 133+780=913133 + 780 = \boxed{913}.

-minor edit by Mathkiddie

Solution 3 (similar to 2)

As mentioned above, there are 780 possible combinations. Since we are essentially adding two powers of two together, thinking about the properties of this sum organizes our solution. All powers of two are even except for 202^0, so we begin with labeling an entire group "where one of the 1s is in the rightmost spot". In an equation, 2n+12^n+1 is congruent to 0 mod 9. Instantly we think of 23=82^3=8, and trial and error soon gives us 29=5122^9=512. Notice a pattern? Trying 2^15 = 32768 also works. You could go on, but basically all powers of two 3 mod 6 are 1 mod 9. (This is proven with the fact that 262^6 is 1 mod 9) There are seven 3 mod 6 powers of 2 from 1-39, so for our first category there are seven "good" combinations.

Next, we look at powers of two exclusive from 1-39. Expressed in an equation, 2n+2m2^n+2^m is congruent to 0 mod 9. Since nine is a relatively small number, we can treat powers of two as remainders of nine, to find "good" combinations quickly. Making a list of powers of two from 1-6 shows that the remainders when divided by nine are 2, 4, 8, 7, 5, and 1. This repeats itself every 6 powers. With simple counting we see there are seven powers of two that give remainders of 2, 4, and 8 each. Also there are six powers of two two that give remainders of 7, 5, and 1 each. Notice that each trio of powers correspond with another in the opposite trio. WLOG, if you choose two, (which there are seven to select) there are six different sevens to pair. This gives 767*6. Repeat for the other two pairs.

In the end there are 7+42+42+427+42+42+42 "good" combinations, for an answer of 133+780=913133 + 780 = \boxed{913}.

-jackshi2006

Solution 4

Notice that in any binary expression, when we take it modulo 99 and look at it in groups of 3 starting from the right, we get bases with modulo's 4,2,14,2,1 in the first group and 4,2,1-4,-2,-1 in the second group. For our number to be divisible by 99, we have to get one of the positive multipliers and its opposite to cancel out. There are a total of 77 complete positive groups and 66 complete negative groups and then 2392^{39} is left which is 1-1. If we select a 11, we have 77 ways to negate it and 77 ways to select it giving 4949. If we select a 22, we have 66 ways to negate it and 77 ways to select it giving 4242. The same follows for selecting a 44. In total, we need to choose 22 out of the total 4040 digits to "activate" and turn into a 11. In total we get

49+42+42(402)=133780\frac{49+42+42}{{40\choose{2}}} = \frac{133}{780} Adding, we get 133+780=913133 + 780 = \boxed{913}.

-Vedoral