Le Monde puzzle [#952]
A quite simple Le Monde mathematical puzzle again with Alice and Bob:
In a multiple choice questionnaire with 50 questions, Alice gets a score s such that Bob can guess how many correct (+5 points), incorrect (-1 point) and missing (0 point) Alice got when adding that Alice could not have gotten s-2 or s+2. What is Alice’s score?
A first point is that the overall score is s=5c-i with c+i≤50. Without further information, the possible results are all integers 0≤c≤50 such that c≥s/5 and 0≤i=s-5c≤50. Possible scores range from -50 to 250, but a quick R check shows that ten values are impossible
vales=rep(0,le=50+1+250) for (c in 0:50){ for (i in 0:(50-c))vales[5*c-i+50+1]=1}
which produces
> (1:length(vales))[vales==0]-50-1 [1] 231 236 237 241 242 243 246 247 248 249
Thus looking at the differences, there is only one case for which s-2 and s+2 are impossible values, namely s=239. This means c=48, i=1 since c=49 leads to an impossible i.
March 21, 2016 at 3:52 pm
xi’an, your output does show that 245 is an answer, since you’ve got 243 and 247 in your list. You just didn’t “filter” your output completely :-) . 250 is one of those infamous boundary values. (There’s lots of ways to score zero but only one way to score 250)
March 21, 2016 at 11:15 am
possible_points <- function(n)
{
data.frame(Off = 50-n, Correct = 0:n, Incorrect = n:0, Points = (0:n)*(5) + (n:0)*(-1))
}
all_combinations <- dplyr::rbind_all(lapply(1:50, possible_points))
points <- all_combinations$Points
dplyr::filter(all_combinations, !(Points + 2) %in% points, !(Points – 2) %in% points)
# This gives 239, 244, 245, 250
March 21, 2016 at 1:07 pm
This is miles beyond my R abilities…!
March 21, 2016 at 1:33 pm
install dplyr and try it out :)
March 19, 2016 at 2:28 pm
Hi,
how about 245?
March 20, 2016 at 12:49 am
yep I missed that one! I actually reconstructed the puzzle from memory so must have must some extra constraint!