bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] (OT) Position ID documentation


From: Massimiliano Maini
Subject: Re: [Bug-gnubg] (OT) Position ID documentation
Date: Mon, 7 Jun 2010 12:58:14 +0200

Doh, I think you're right .. .went for a complicate way to solve a simple issue,
just do the -1  :)

Yet with your fix:

==========================
# Non-contact positions.
NC_pos = 0
for M in range(1,23+1):
        # Black has 1 checker on point M, 15-1 checkers on points
        # 0..M (0 meaning off).
        # White can be on points (M+1)..25 (25 meaning off), but not
        # all 15 are off, hence the -1. Nobody is on the bar.
        NC_pos += D(M+1,15-1) * (D(25-M+1, 15) - 1)
==========================

I still get:

 NC pos:        3085625541477601, 3.09e+15

Which is more than your 1.4E+15.

On 6 June 2010 07:57, bgnj <address@hidden> wrote:
>
>
> Massimiliano Maini-3 wrote:
>>
>> I did the computation this way:
>>
>> # Non-contact positions.
>> NC_pos = 0
>> for lop in range(1,23+1):
>>       # Black has 1 checker on point lop, 15-1 checkers on points
>>       # 0..lop (0 meaning off).
>>       # White can be on points lop+1..25 (25 meaning off), but at
>>       # least one is on points lop+1..24. Nobody is on the bar.
>>       NC_pos += Dnm(lop+1,15-1)*(Cnm(24-(lop+1)+1,1)*Dnm(25-(lop+1)+1,15-1))
>>
>> I get this:
>>
>> Non-contact positions: 9350831674578000 (9E+15).
>>
>
> Massimiliano, I think your formula is incorrect.  For white, you have:
>
> White = (Cnm(24-(lop+1)+1,1)*Dnm(25-(lop+1)+1,15-1))
>
> With the explanation:
>
> # White can be on points lop+1..25 (25 meaning off), but at
> # least one is on points lop+1..24. Nobody is on the bar.
>
> I think from your explanation, it should be:
>
> White = Dnm(25-lop+1, 15) - 1
>
> where the -1 accounts for the one case that all checkers are off.  For
> example, if lop = 22, and therefore white has 3 spaces to distribute 15
> checkers, your formula gives:
>
> White = Cnm(2, 1) * Dnm(3, 14) = 2 * 120 = 240
>
> But that number exceeds the total number of ways to distribute 15 checkers
> on 3 spaces, which is:
>
> Dnm(3, 15) = 136
>
> Your formula gives the number of ways to distribute 15 checkers with 1
> checker being distinguishable from all other checkers (and this special
> checker is not in the tray).  This number is larger than the case where all
> checkers are indistinguishable from each other.  I hope that made sense.
>
> - BGNJ
> --
> View this message in context: 
> http://old.nabble.com/Re%3A-%28OT%29-Position-ID-documentation-tp28666843p28793143.html
> Sent from the Gnu - Backgammon mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Bug-gnubg mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-gnubg
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]