Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
30 blind people in experiment
Message
 
 
À
25/01/2006 11:43:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Games
Catégorie:
Casses-têtes
Divers
Thread ID:
01089884
Message ID:
01090121
Vues:
32
>>>>>Update: just comment out the lines 3 to 5 in the code above, so a=.f. (all elements), and run the code. You get nine flipped books - so, the difference between the number of open books in the beginning and the end must be that number plus/minus nine.
>>>>
>>>>The explanation is not complete and the answer is one of the possible correct ones.
>>>
>>>It's either some extra condition somewhere that wasn't really mentioned, or some sort of semantic trick, or I really didn't think about this long enough. I'll wait for the verdict.
>>
>>Should I reveal my own solution (I haven't heard from the person who asked it) or we'll wait for others?
>>
>>You need to explain how did you get 9 and list all possible solutions.
>
>Actually, it's 10. I've put for j=1 to 100 step i, where I should have put for j=i to 100 step i, so not every person would flip the first book. And the books which will change state are those whose ordinal numbers are exact squares - 1, 4, 9, 16... 100.
>
>And here's the explanation: any book will be flipped an even number of times if its ordinal number is anything but a square. For prime numbers (and any other numbers as well), the divisors are 1 and the number itself, so those cancel out. For any non-prime number, there are pairs of different factors - for instance, #12 will be flipped by 2nd and 6th, and by 3rd and 4th person. Squares don't have such pairs of different factors - 25 has only 1, 5 and 25.
>
>So the number of open books will differ in the end by no more than ten - the original number plus number of closed books in these special positions, minus number of open books in those positions.

Now it's correct. But I made mistake myself forgetting 100.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform