Re: Bridge anyone? [not off topic]
Re: Bridge anyone? [not off topic]
- Subject: Re: Bridge anyone? [not off topic]
- From: Nigel Garvey <email@hidden>
- Date: Mon, 8 Nov 2004 21:30:32 +0000
David Andrews wrote on Mon, 8 Nov 2004 00:28:04 -0500:
>Nigel,
>
>I thought it was determined a while back that Randomly choosing hands
>to fill will result in the last hand to fill having a high probability
>of a run of low clubs.
Hi, David.
It was the implementation rather than the idea that was causing the runs
of low clubs. For at least the first 13 cards in the original script
and usually for more all the hands had a 1-in-4 chance of being dealt
the next card in an ordered deck. At some point after the spades, the
hands would drop out one-by-one as they reached their size limits,
leaving the last survivor with a 1-in-1 chance of getting the dregs of
the clubs.
When hands are dealt from a shuffled deck, each player begins with 13
chances out of 52 of getting any particular card. After the first card
has been dealt, the player who got it then has 12 chances out of 51 of
getting any particular card from the remainder, while the other three
players have 13 chances out of 51. After the second card's dealt, the
first two players then have 12 out chances each out of 50 at what's left
and the other two each have 13 out of 50. And so on. After every fourth
card, the odds return to the equivalent of 1 in 4 for each player, but
the deviation in between grows wider as fewer cards remain to be dealt.
Overall, the fixed players and the fixed odds are balanced by the
randomness of the shuffled pack.
In my rethink of Bernard's idea, the fixed order of the pack is balanced
by the randomness of the players and the consequent randomness of the
subsequent odds. There are 52 chances 13 for each hand and it's these
chances that are selected at random. All the hands have a 13-in-52 chance
of being dealt the Ace of Spades. The hand that gets it then has a
12-in-51 chance of getting the King, while the other three each have a
13-in-51 chance. (The original implementation gave every hand a 1-in-4
(12.75-in-51) chance here, so the hand with the Ace has a slightly
reduced chance under my system while the other three have slightly
increased chances.) For the Queen, there are either two hands with
12-in-50 chances and two with 13-in-50 chances, or one hand with an
11-in-50 chance and three with 13-in-50 chances. (Again, the original
implementation gave every hand a 12.5-in-50 chance with this card.)
My version thus has a more interesting distribution of odds (1-in-4 is
not repeated very often) and has negative feedback built into it: a hand
with more cards is less likely to get the next one. This buffers the odds
and makes them less likely to bunch up at one end of the pack. It also
has a coding advantage in that the script doesn't have to check each hand
to see how many cards it has. Obviously, though, it would be no good in a
real game where the players could see the cards being dealt. ;-)
>This may be a bit unusual, but the odds...
>after about a half dozen deals:
>{{"9$B,%(B", "8$B,%(B", "2$B,%(B", "Q$B,#(B", "10$B,#(B",
>"5$B,#(B", "2$B,#(B", "A$B,$(B", "Q$B,$(B", "2$B,$(B",
>"A$B,&(B",
>"K$B,&(B", "9$B,&(B"}, {"7$B,%(B", "3$B,%(B", "J$B,#(B",
>"9$B,#(B", "7$B,#(B", "6$B,#(B", "3$B,#(B", "K$B,$(B",
>"J$B,$(B",
>"9$B,$(B", "8$B,$(B", "10$B,&(B", "6$B,&(B"}, {"A$B,%(B",
>"K$B,%(B", "A$B,#(B", "K$B,#(B", "8$B,#(B", "7$B,$(B",
>"6$B,$(B",
>"3$B,$(B", "J$B,&(B", "5$B,&(B", "4$B,&(B", "3$B,&(B",
>"2$B,&(B"}, {"Q$B,%(B", "J$B,%(B", "10$B,%(B", "6$B,%(B",
>"5$B,%(B",
>"4$B,%(B", "4$B,#(B", "10$B,$(B", "5$B,$(B", "4$B,$(B",
>"Q$B,&(B", "8$B,&(B", "7$B,&(B"}}
As you can see, this hasn't come across very well in the digest. ;-) If
you're showing a run of low Clubs, I should point out that the aim is not
to prevent such runs altogether, but to remove the bias towards their
happening. The results from Kai's test script are very encouraging in
this respect.
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden