Advertisement
Guest User

Cookie of Perseverance

a guest
Apr 26th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. Q1. So you had to find the maximum number which cannot be the combination of 10, 15 and 27. The combinations can be written as X = 10*a + 15*b + 27*c, where a,b,c are non-negative integers.
  2.  
  3. Now the tricky part. If you look at numbers '10' and '15', you'll notice that these numbers can make any number divisible by 5 and only them. With the exception of '5'.
  4. So now you need to take a look at the rest. The rest can have the following remainders: 1,2,3,4.
  5.  
  6. Now look at number '27':
  7.  
  8. 27 mod 5 = 2.
  9. 27*2 mod 5 = 54 mod 5 = 4
  10. 27*3 mod 5 = 81 mod 5 = 1
  11. 27*4 mod 5 = 108 mod 5 = 3
  12.  
  13. So if you take any number, not divisible by 5, you could simply subtract either 27, or 54, or 81, or 108 to get a number divisible by 5, which can be represented by '10' and '15'. Surely you should end up with positive numbers.
  14.  
  15. Now it looks like the maximum number should not exceed 108 (the maximum you can subtract, the rest are inferior). But you may still end up with the only number which is divisible by 5, but cannot be the combination of '10' and '15', which is '5'. So the maximum number is this: 5 + 108 = 113.
  16.  
  17.  
  18. Q2. Drawing stuff might help a bit.
  19.  
  20. But first you need to understand that according to the task, if 2 players move from the other ends of a track, it'd take them exactly half the time it is required for any of them to run individually. So if Alpha takes 30 minutes to cross, 2 players coming from other sides will meet in exactly 15 minutes.
  21.  
  22. Ok. Let's assume Alpha takes 'x' minutes to cross, Beta – 'y' minutes.
  23.  
  24. I've made drawings to illustrate what is going on.
  25.  
  26. 1 drawing. Starting positions.
  27. 2 drawing. Duke and Sarah drove for y/2 minutes. So it's (x-y/2) left for Paul.
  28. 3 drawing. Colin covered half the distance left for Paul, so it is (x-y/2)/2. He started together with Julie. So only (y-(x-y/2)/2) is left for her.
  29. 4 drawing. Tom runs for time left for Julie to finish, that is (y-(x-y/2)/2). Colin, when Julie finished runs exactly for y minutes. Also since they meet in 15 minutes the distance in minutes between Tom and Colin is twice as large, so it is 30.
  30.  
  31. So we end up with:
  32.  
  33. (y-(x-y/2)/2)+y+30 = x.
  34. y-x/2+y/4+y+30 = x
  35. 9y/4 + 30 = 6x/4
  36. 3y/4 + 10 = 2x/4
  37. 3y + 40 = 2x
  38.  
  39. x = 20 + 3y/2
  40.  
  41. So y is an even number (since x must be integer). We might take y=2 as the first even number and have x = 23. So this could be an answer. But! There are certain conditions:
  42.  
  43. x-y/2 > 0, (y-(x-y/2)/2 >0 (because there aren't negative minutes)
  44.  
  45. Since x>y, then x>y/2, or x-y/2>0.
  46.  
  47. (y-(x-y/2)/2 >0: y-x/2+y/4>0, x = 20 + 3y/2 → y-10-3y/4+y/4 > 0 → y/2>10 → y>20. The first even number after 20 is 22. So y = 22, x = 20+33 = 53.
  48.  
  49. Q3. For Alex recursion formula is X(n) = 2*X(n-1)-3
  50. For Michael it is Y(n) = 3*Y(n-1) - 1
  51.  
  52. Let A be the number of hours Alex spent on Super Fleet Buoy, B – number of hours Michael spent on Super Fleet Buoy.
  53.  
  54. So hours for the rest of the games for Alex:
  55.  
  56. Elks Must Die, 2A-3
  57. Fishing Floor, 2(2A-3)-3 = 4A-9
  58. Feet Waitress, 2(4A-9) – 3 = 8A-21
  59. Too Intimate Roach, 2(8A-21) -3 = 16A – 45
  60.  
  61. For Michael:
  62. Elks Must Die, 3B-1
  63. Fishing Floor, 3(3B-1) - 1 = 9B-4
  64. Feet Waitress, 3(9B-4) – 1 = 27B-13
  65. Too Intimate Roach, 3(27B-13) -1 = 81B – 40
  66.  
  67. So Stephanie played:
  68. Feet Waitress for (8A-21)+(27B-13)+1=420,
  69. Too Intimate Roach for (16A-45)+(81B-40)+1=1011
  70.  
  71. 8A+27B = 453
  72. 16A + 81B = 1095, or
  73.  
  74. 16A+54B = 906
  75. 16A + 81B = 1095, subtract the upper equation from the lower
  76.  
  77. 27B=189, or B=7.
  78. 8A+27*7=453, 8A= 264, A=33.
  79.  
  80. So Stephanie played Elks Must Die for 2A-3+3B-1+1=2*33+3*7-3 = 84
  81.  
  82. Q4. You need to make equations to find the probability of winning at least two games. Winning at least 2 games is the opposite probability of winning zero or exactly 1 game.
  83.  
  84. Probability of winning 0 games for first 15 giveaways: (49/50) ^15
  85. Probability of winning 0 games for second 6 giveaways: (19/20) ^6
  86. Probability of winning 0 games for the last: ((193-x)/193), where x – number of copies given away.
  87.  
  88. The aggregate probability of losing every giveaway is the product:
  89. ((49/50)^15)*((19/20)^6)*((193-x)/193).
  90.  
  91.  
  92. There are 22 ways to win exactly 1 game. If we use Bernoulli trial we can make it simpler.
  93.  
  94. So to win 1 game in the first 15 giveaways has the following chance:
  95. 15*(1/50)*(49/50)^14 (1 game won, 14 lost).
  96.  
  97. In the second 6 giveaways:
  98. 6*(1/20)*(19/20)^5
  99. For the last:
  100. x/193
  101.  
  102. Aggregate probability of winning only 1 game for first is the product of winning 1 of 15, probability of losing all 6 and the last. And so on.
  103.  
  104. So we end up with the following inequality:
  105.  
  106. ((49/50)^15)*((19/20)^6)*((193-x)/193) + (15*(1/50)*(49/50)^14)*((19/20)^6)*((193-x)/193) + ((49/50)^15)*(6*(1/20)*(19/20)^5)*((193-x)/193) + ((49/50)^15)*((19/20)^6)*(x/193)<0,75,
  107.  
  108. or a little simpler:
  109.  
  110. ((49/50)^14)*((19/20)^5)*(49/50*19/20 + 15*1/50*19/20*(193-x)/193 + 6*49/50*1/20*(193-x)/193) < 0,75
  111.  
  112. Ok ,lots of numbers. In the end you'll end up with x>74,63. Thus the number of copies is 75.
  113.  
  114.  
  115. Q5. The best way to pick out achievements is to use exponentiation with the base 2. This way you'll never have the same amount to pay for any combinations of fake achievements.
  116. So you should pick up the following number of achievements: 1,2,4,8,16,32,64. Mind you, you have to pick 1 as th first, otherwise you won't distinguish if the first game was faulty or there aren't any faulty games.
  117.  
  118. So Micky cheated in Elks Must Die and WTF: Wiser Than Fool. So according to the scheme Peter was charged 64+8 = 72 $ for clearing up achievements.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement