• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bridge anyone? [not off topic]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bridge anyone? [not off topic]


  • Subject: Re: Bridge anyone? [not off topic]
  • From: kai <email@hidden>
  • Date: Tue, 9 Nov 2004 01:29:41 +0000


On Mon, 8 Nov 2004 21:30:30 +0000, Nigel Garvey wrote:

kai wrote on Mon, 8 Nov 2004 02:31:05 +0000:

You've probably already done something like this, Nigel - but, in view
of concerns over the validity of certain random dealing methods, I
decided to compare for myself the results of a few scripts. My original
reason for doing so had more to do with my difficulty in deciding if
Bernard's/Michael's original approach was entirely random or not. For
some reason, although my instincts told me it wasn't, I was reluctant
to write it off without further evidence.


To check it, I selected a handful of scripts (including yours of 4 Nov)
between which I could then make certain comparisons:

Thanks for your tests, Kai! I've been doing all sorts of thought
experiments and scribblings on pieces of paper, and you've come up with a
Feynmanian experiment that shows fairly clearly how well my version of
Bernard's idea does with regard to low Clubs. I say "fairly' clearly as I
think the test shouldn't be "how many Clubs in the hand containing the
2?", but "how many *consecutive* clubs including the 2?"

Actually I tried several ideas, Nigel - and the thought about low consecutive club runs occurred to me, too (even though my original handler was a bit rough):


to checkClubRun(n, e, s, w)
repeat with currH in {n, e, s, w}
if "2C" is in currH then
set r to 1
repeat with currCard in {"3C", "4C", "5C", "6C", "7C", "8C", "9C", "10C", "JC", "QC", "KC", "AC"}
if currCard is in currH then
set r to r + 1
end if
end repeat
return r
end if
end repeat
end checkClubRun


With a couple of modifications to your test script:

  -- Extra property:
  property checkList : {"3C, "4C", "5C", "6C", "7C", "8C", "9C", "10C",
"JC", "QC", "KC", "AC"}

  -- Modified handler:
  to getClubCount(n, e, s, w)
    repeat with currHand in {n, e, s, w}
      if "2C" is in currHand then
        repeat with c from 1 to 12
          if item c of my checkList is not in currHand then return c
        end repeat
        return 13
      end if
    end repeat
  end getClubCount

Much better! :-)

I opted for the 'count all clubs' because I felt it might also take account of situations where only 1 or 2 full hands had been put aside - and the clubs were being shared among the remaining hands. So the hand with the 2 of clubs might well contain more than its fair share of clubs - even without a consecutive run.

However, I can see the benefit of checking for consecutive low club runs, since this focuses specifically on the last few cards dealt to a single hand. :-)

... I get the following results, which are smaller than, but consistent
with, your own. Thanks again. :-)

--> {scriptName:"Michelle", mid:1.3055 , lo:1.274, hi:1.337, var:0.0315,
series:{1.29, 1.32, 1.295, 1.301, 1.337, 1.292, 1.31, 1.335, 1.274,
1.316}}


  --> {scriptName:"Kai 1", mid:1.2995 , lo:1.275, hi:1.324, var:0.0245,
series:{1.278, 1.302, 1.304, 1.275, 1.277, 1.324, 1.304, 1.292, 1.28,
1.304}}

  --> {scriptName:"Graff 1", mid:1.312 , lo:1.282, hi:1.342, var:0.03,
series:{1.286, 1.319, 1.32, 1.342, 1.282, 1.288, 1.29, 1.326, 1.316,
1.296}}

--> {scriptName:"Bernard", mid:3.0255 , lo:2.933, hi:3.118, var:0.0925,
series:{2.968, 3.015, 3.117, 2.933, 2.975, 2.942, 3.118, 2.992, 2.945,
2.997}}


--> {scriptName:"Nigel latest", mid:1.301 , lo:1.28, hi:1.322,
var:0.021, series:{1.31, 1.28, 1.298, 1.303, 1.308, 1.301, 1.322, 1.283,
1.299, 1.294}}

Right. The pattern does appear to be very similar, in spite of the generally lower counts. Again, the figures show how your balancing technique has pulled the results of the random hand method into the same ball park as that of the more 'traditional' random card approach. :-)


---
kai

_______________________________________________
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


  • Follow-Ups:
    • Re: Bridge anyone? [not off topic]
      • From: David Andrews <email@hidden>
  • Prev by Date: Re: Can a handler return more than one result?
  • Next by Date: Changing the "forward" tear line
  • Previous by thread: Re: Bridge anyone? [not off topic]
  • Next by thread: Re: Bridge anyone? [not off topic]
  • Index(es):
    • Date
    • Thread