June 29, 2009 01:29 PM

Logic Puzzle – Dice Substitute

Rating: (0)
SQL Server Magazine
InstantDoc ID #102380

My wife and I like to play backgammon. Recently we sat in a pub in the UK and wanted to play, but didn’t have the equipment. We figured that it shouldn’t be impossible to improvise a decent backgammon game with materials that are readily available to an average person sitting in a pub. The materials we ended up using were: paper, a pen, the pub menu, and coins. We drew the backgammon board on a sheet of paper, using the pub menu as a substitute for a ruler. As playing pieces we used small pieces of paper with an x symbol for one player and an o symbol for the other. Figure 1 shows the actual backgammon board we used.

We decided to use coins as substitute for the dice, but ran into a logical puzzle—what system based on coins to use that will provide an adequate alternative to dice? We wanted a system that:

  1. Has six different possible states that would represent for us the numbers 1 through 6.
  2. In each round, produces a random state with the same probability for each state to be chosen.

Can you think of a system that meets the puzzle’s requirements? It doesn’t have to incorporate exactly three coins as is seen in Figure 1, but it does have to meet both requirements presented above. BTW, if you can think of a system that would substitute dice without coins, rather with other readily available items to an average person in a pub, I’d be most interested to hear your idea.

Cheers,
BG

Add a Comment

I'm reading SQL Server Mag on the train telecommuting to/from work and last Friday I came across your puzzle. So here's my solution (I don't think I saw it above although I didn't read everything 100%).

Throw 5 coins. Result = [number of heads] + 1.
Or, if you don't have 5 coins, throw 1 coin 5 times.

BTW: it's fun to try to find a solution for this kind of puzzle on the train, helps to pass the time faster!

Regards,
Valentino.

Valentino11/15/2009 2:58:03 PM


You should be able to find some cork from a wine bottle in a pub. Carve it up and put the numbers on it.

Ronald10/30/2009 9:38:01 AM


UK pub? Order a ploughman's lunch and write 1-6 on a cube of cheddar.
Jamie (Isle of Man)

Jamie7/31/2009 3:29:36 AM


You are in a British pub, so they will have a set of 6-6 dominoes behind the bar. Pull out the blanks, discard the double. Throw the titles in a hat and draw with replacement to simulate dice. Even better, get two sets of dominoes and pull out 36 tiles to simulate the dice throws.

You are in a British pub, so they will have sugar cubes for tea or beef cubes for soup. Find a way to spot them and then eat them when the game is over.

[Reply:

Those pubs that have games like dominoes to entertain the audience usually also have backgammon, or at list some game with dice. :)

Itzik]

Joe7/2/2009 3:29:18 PM


1)
write the numbers 1-6 on small squares of paper, fold and place in a cup.
repeat for a second dice.
close your eyes and select.

2)
download a dice application for your mobile phone. (or download backgammon for it)

3) still working on it...

[Reply:

Regarding 1, same idea as my wife suggested. :) I preferred a solution based on coins.

Regarding 2, nice idea, assuming you carry a cell phone with you. I may be unusual in this sense, but I don't carry a cell phone with me while traveling (which is most of the time). How do you think I managed to write three books about SQL Server 2008 in my spare time? ;)

Cheers,
Itzik]


BEN7/1/2009 6:37:33 AM


My last attempt did not work well... :)

Here is another try with different format to present the logic:

1). flip coin 1
2). head > go to 4).
3). tail > go to 7).
4). flip coin 2
5). head > go to 10).
6). tail > go to 13).
7). flip coin 2
8). head > go to 16
9). tail > go to 19
10). flip coin 3
11). head > go to 4) (loop back)
12). tail > dice result 1
13). flip coin 3
14). head > dice result 2
15). tail > dice result 3
16). flip coin 3
17). head > dice result 4
18). tail > dice result 5
19). flip coin 3
20). head > dice result 6
21). tail > go to 7) (loop back)

-- Plamen

[Reply: Hi Plamen,

Loopback means retry. The way I see it, it's similar to using the binary system where you ignore certain states, only harder to follow. ;)

Itzik]

Plamen6/30/2009 9:07:20 PM


One method is flipping the coins in sequence and on heads/tails take a different path. The third coin needs to have a loop back to the second coin flip to both eliminate the additional outcomes and to provide fair chances for all numbers. And yes, you can use bottle cups or anything else with two fair states in the bar... :)

Here is an attempt to map the coin flipping path:


--Plamen
(flip coin 1)
/ head tail
| |
--------> (flip coin 2) (flip coin 2) <-----
| / \\ / \\ |
| head tail head tail |
| / \\ / \\ |
| (flip coin 3) (flip coin 3) (flip coin 3) (flip coin 3) |
| / \\ / \\ / \\ / \\ |
--head tail head tail head tail head tail--
| | | | | |
1 2 3 4 5 6



Plamen6/30/2009 6:52:28 PM


Oops, forgot to post the distribution of possibilities

Combinations 1 2 3 4 5 6 5 4 3 2 1
-- -- -- -- -- -- -- -- -- -- --
Outcome 2 3 4 5 6 7 8 9 10 11 12

Peter6/30/2009 4:04:22 PM


Without coins?

I have idea for throwing 2 dice at the same time. Here comes the catch; the distribution of probabilities.

See this code

;WITH Dice (Eye)
AS (
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6
)

SELECT d1.Eye AS Dice1,
d2.Eye AS Dice2,
d1.Eye + d2.Eye AS theSum
FROM Dice AS d1
CROSS JOIN Dice AS d2
ORDER BY d1.Eye,
d2.Eye

As you can see there are 36 possible outcomes. So, start taking the time with either an analog clock, stop watch on a digital clock or your cellphone.

Whenever it's your turn, see how many seconds that have passed and do modulo 36, and add 1 to the solution. Now you have a number between 1 and 36 which can be lookuped in the table presented above!

[Reply: Hi again Pesomannen,

Just to clarify, the original puzzle is with coins. I just said that I’m also interested in ideas that are not based on coins as well. And I already got several very interesting ones.

Regarding your idea, if I understand it correctly, you suggest using a time-based system (specifically, the seconds part) to calculate a value in the range 1 to 36. Then choose one of the 36 possible states of the 2 dice based on the calculated value.
The tricky part here is how to get the same probability for each of the 36 values. For example, if you rely on the seconds portion of the time (from the beginning of the current minute), this value is not divisible by 36, therefore you don’t get the same probability for all states. You could rely on the seconds value from the beginning of the hour, but then the calculations became awkward, especially in a pub after a few drinks. ;)

I guess it would be simpler to mimic a single dice by taking the seconds portion from the beginning of the minute (call it s), and calculating s modulo 6 plus 1.

Itzik
]

Peter6/30/2009 4:00:12 PM


Hi,

This is a reflection for the case that a old chinese man is not in the pub or the most strange case that a old chinese man is in the put but him don't remember the triagrams divination.

First observe this:
If you flip N1 coins at first time, n2 at second time, N3... you obtain 2^(N1+N2+N3+...NN) configurations and is not possible to divide this configurations by three. So is not possible use heads or tails or any binary strategy for obtain result without ignore some cases.

So the problem is wath is a common and simply strategy [without 1/0!] to choice 1 element in a set of three?

The pencil that is now in my hand [the first I finded] have six faces, in example and it is directly a dice. If you don't have a hexagonal pencil you can divede a piece in three radial section for each side. So you have 6 section. Flip the piece and evaluate the top section that is closer a line in the table.
If you hav a clock with seconds, mantain it bottom in the table. When is your turn, look the seconds ad obtain a number between 1 and 6 with a strategy, in example (S/10 mod 6) + 1.
Another is draw a circle in table and divide it in six fragments, rotate a pencil in the center and look the result.
And if you are nakeed in a desert with your partner and youd don't have nothing, make love and don't play to backgamon.

marc.

[Reply: Hey Marcello, good to see you around. I see that whenever I want to find you all I need to do is post a puzzle. ;)

Your observation that any binary system based on flipping of coins cannot work, because the number of states such a system would produce is not divisible by three, is correct. So the real challenge is to think of a non-binary system based on coins. Perhaps one that does not use the simplistic approach where each coin represents a bit with two states…

BTW, I really like your idea of drawing a circle and dividing it to six 60-degree fragments, where the roll of the dice is mimicked by rotating a pencil in the center and choosing the fragment that the pencil’s head points to. It is simple to implement, gives the same probability to each of the six states, and doesn’t have states that need to be ignored. In case the pencil’s head points on a line between two fragments, you can make a rule that the one to the right of the pencil’s head “wins.” Also, it is less disturbing to the other folks sitting in the pub than throwing coins on the table. :)

BTW, my father once taught me a very cool technique to draw a perfect circle with no tools besides a pen or pencil and a piece of paper. Remind me to show it to you next time we meet.

Thanks for your ideas,
Itzik]

Marcello6/30/2009 4:14:07 AM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS