Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
30 blind people in experiment
Message
De
24/01/2006 21:22:40
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:
01089990
Vues:
27
>There are 100 books on the table. Some opened, some closed. The first person comes into the room and closes open books and open closed. The second does the same, but with all even books. The third does it for each 3rd number, etc. 100 people came to the room. The quesiton is: how many open books would be on the table after all 100 people have been in the room?
Dimension a[100]
Rand(-1)
For i=1 To 100
	a[i]=Rand()>0.5
Endfor
CountUps("initially")

For i=1 To 100
	For j=1 To 100 Step i
		a[j]=Not a[j]
	Endfor
	If i%5=0
		CountUps("After "+Transform(i))
	Endif
Endfor


Procedure CountUps(c)
Local N, i
N=0
For i=1 To 100
	N = N + Iif(a[i],1,0)
Endfor
? c, N
It usually gives a number anywhere between 40 and 60, and the initial number of open (i.e. a[i]=.t.) ones is in the same range. So it's either some missing piece of initial conditions, or this is very random.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform