Hi Romano and Sunanda,
Your work is brilliant ! It helps me to get to the problem, and finally my
17 years'old son explained it to me. If you consider that each time I loose
I did not win, the answer can be shorten a bit.
rebol[]
win: 100 print ["Win% = " loop win [ win: win - first random [0 0 1]]]
It is a beat cheatting considering that your version iterate 500 times so I
give also my 1000 iterations version.
rebol[]
win: 1000 print ["Win% = " (loop win [ win: win - first random [0 0 1]]) /
10]
These are respectively 43 and 51 bytes long.
Patrick
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 16, 2001 4:19 PM
Subject: [REBOL] Re: A Rebol Challenge. The Monty Hall Puzzle
> Hi Romano,
>
> > Beautiful! You can remove the n + 1:
> >
> > Win: 0 n: 500 print ["Win%" 100 / n * loop n [win: win + last sort next
> > random
> > [0 0 1]]]
> >
> Thanks. I thought I'd minimised it completely, but it's amazing what
teamwork
> can do.
>
> If we just want to print the winning percentage, and we shorten the
variable
> names we get:
>
>
> W: 0 n: 500 100 / n * loop n [w: w + last sort next random [0 0 1]]
>
> which is just
>
> length? {W: 0 n: 500 100 / n * loop n [w: w + last sort next random [0 0
1]]}
>
> 67 bytes. Which--spookily enough--equals our win percentage for swapping.
>
> Sunanda.
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.