Showing posts with label backgammon. Show all posts
Showing posts with label backgammon. Show all posts

Thursday, November 18, 2010

Determine when to accept a double in backgammon

In this blog post I will examine the precise conditions when to accept a double in backgammon.

The question and it's answer whether to accept a double probably is a classical result in backgammon. Guided by mathematics it is primarily concerned with the expected value of a game.

To recap: If you win a game normally you win the amount indicated by the doubling cube. If you win a gammon i.e. without your opponent bearing off a single checker, you win twice the amount on the doubling cube. If the opponent hasn't borne off any checkers and still has checkers in your home board you win a backgammon and gain triple the amount indicated by the doubling cube.

Let's assume the change of winning the game normally is \(p_{n}\), that of winning a gammon is \(p_{g}\) and that of winning a backgammon is \(p_{b}\). In similar fashion define the chances of losing as \(q_{n},\,q_{g}\) and \(q_{b}\).
Furthermore, let\(v\) be the current value of the doubling cube.

If your opponent offers you a double and you refuse you lose \(-v\) points, guaranteed. But if you accept the double the expected value will be

\[
2vp_{n} + 4vp_{g} + 6vp_{b} - 2vq_{n} - 4vq_{g} - 6vq_{b} = 2v((p_{n} - q_{n}) + 2(p_{g} - q_{g}) + 3(p_{b} - q_{b}))
\]

So you should accept a double if the above expression is greater then \(-v\).

Lets further assume that the changes of losing are winning a gammon are backgammon are zero. Then the above equality simplifies (using the relation \(q_{n} = 1-p_{n}\)) to \(2p_{n}-1 \ge -\frac{1}{2}\) or \(p_{n} \ge \frac{1}{4}\). This is a very classic result of backgammon. For example, it is stated, without proof, in 501 essential backgammon problems, considered to be the bible of backgammon.

In order to gain an other insight we assume that the changes of winning or losing a backgammon or winning a gammon are zero, but losing a backgammon is a possibility. (For example your trapped on the bar while your opponent already beared off succesfully at least one checker.)
The above equations reduces to \(p_{n}-q_{n}-2q_{g} \ge -\frac{1}{2}\). Now the relation \(p_{n} + q_{n} + q_{g} = 1\) tells use that \(q_{n} = 1 - p_{n} - q_{g}\). This simplifies our equations to \(p_{n} \ge \frac{1}{4} + \frac{1}{2}q_{g}\). This tells use you have to have a greater change of winning if your are to accept a double when there is a change of losing a gammon.

The above equations and a keen insight in the chances at the backgammon board can help to guide your decision of taking a double or not.
In an other blog I will investigate the conditions of offering a double.

Tuesday, August 17, 2010

Blogger Stats

In this post I will outline a service Blogger is providing: Stats

I recently switched Blogger dashboard. Instead of the standard Blogger dashboard, I opted for the "Blogger in draft" dashboard. Among other things, this dashboard sports a new button: "Stats".
Behind the Stats button there is a lot of information about the traffic your blog is attracting.

There are four menu's : Overview, Posts, Traffic Source and Audience. Every menu shows information over on of the following periods: Now, Day, Week, Month and All Time. The Overview menu shows an overview of the other three menu's. The post menu shows which posts attracted how many page views.
The Traffic Source menu show referring urls, referring sites and the search keywords which were used to find your posts.
Finally the Audience menu shows a summery of the location from where the request for your blog came and which browser and operating system were used.

So what can this information tell you? Well, for one, do not underestimate the number of page views. Although I have two subscribers to my blog, both of which I know personally, I never thought that my blog would be read.
But contrary to my believe and looking at some of the comments, my posts does get read. Blogger Stats can help you realise that you have an audience.

Furthermore, It gives you a sense of direction. By seeing which post were read the most, you know what your audience likes. For example the top three post in number of page views for this blog are.

  1. Counting Unlock Patterns
  2. Counting Backgammon End Positions
  3. Tethering made easy with easytether

So I presume that writing about my latest experience of playing online backgammon in the train while my laptop was tethered to my android phone, which I had to unlock to set up the connection, would be a show stopper.

But most of all, Blogger Stats is like an addiction. It is hard to resist the urge of checking the stats every now and then, to see how many page views you got for this day.

Thursday, July 29, 2010

Counting Backgammon End Positions

In this blog I will count the number of end positions in backgammon.

Recently I picked up backgammon again. But I could not put my mathematical mind to rest. I got interested in the question of how many end positions backgammons has.
In order to count the number of positions I will introduce the following terminology. The number of stones you own in the end position will be denoted by \(m\). The number of points used available is \(n\). \(o\) is the number of stones owned by the opponent, which occupy \(p\) points of the available \(n\).
So in the following example, playing as black, the following equalities apply \(m=8,\,n=6,\,o=2,\,p=1\).

Let's look at a special case first. Lets assume we have a contact-less end position. So \(o=0\). I will proof that the number of backgammon end positions with \(m\) stones and \(n\) points is

\[
m + n - 1 \choose m
\]

To see this equality, study the following diagram, which corresponds with the figure above if you ignore the opponent stones:

Every dot corresponds with a stone. Every bar with the division between points. A moments reflection will bring the insight that every diagram of this kind corresponds to a backgammon end position and vice versa, every backgammon end position can be described by such a diagram. This proofs the stated equality.

With the result of this special case we can answer the main question: How many backgammon end positions exist with \(m\) stones distributed over \(n\) points of which \(p\) are occupied by \(o\) opponent stones? This number is exactly

\[
{n \choose p} {o - 1 \choose o - p} {m + n - p - 1 \choose m}
\]

The proof of the above equality comes from the following insight. The opponent stones are distributed over \(p\) points. there are \(n \choose p\) ways of picking the occupied points.
For a point to be occupied it must at least contain one opponent stone. So of the \(o\) opponents stones, we can freely distribute o - p opponent stones over \(p\) points. This is the special case we counted already, so this can be achieved in \({(o-p) + (p-1) \choose o - p} = {o - 1 \choose o - p}\) ways.
This brings us to the final factor. It represent the \(m\) stones which should be distributed over the remaining \(n-p\) points. Again this is given by our preliminary result of \({m + n - p - 1 \choose m}\) ways. This proofs the stated result.

In conclusion: the number of backgammon end point positions with \(m\) stones distributed over \(n\) points of which \(p\) are occupied by \(o\) opponent stones equals

\[
{n \choose p} {o - 1 \choose o - p} {m + n - p - 1 \choose m}
\]