Showing posts with label combination. Show all posts
Showing posts with label combination. Show all posts

Wednesday, 9 May 2018

Necklaces and Bracelets

At my recent diurnal age of 25136 (I'm 25138 days old as I write this), I noted that:
25236 is also a member of OEIS A141783: number of bracelets (turn over necklaces) with n beads: 1 blue, 12 green, and r = n-13 red (here n=20 and so r=7). This can be restated as "the number of bracelets with 1 blue, 12 green and 7 red beads is 25236". 
I had trouble understanding why the number of bracelets was 25236 and not 25194. According to my initial calculations, the number of necklaces (arrangements of beads that can't be lifted out of the plane and reversed) should be 19!/(12!*7!) = 50388. Here the numerator is 19! because 20!/20 adjusts for the rotational symmetry of the twenty beads and the denominator takes into account the fact that the beads in each of the groups, 12 green and 7 red, are indistinguishable from one another. Because bracelets can be lifted out of the plane and turned over, the number of bracelets should be 50338/2 = 25194.

As with most things, it's better to start at the beginning. The sequence runs: 1, 7, 49, 231, 924, 3108, 9324, 25236, ... and begins with n=13 at which point there is only one possible configuration as there are no red beads. When n=14, there is one red bead, one blue bead and twelve green beads. I would reckon the number of possible necklace configurations to be: 13!/12!=13 but in fact there is one more as can be seen in Diagram 1 and 2:

Diagram 1: blue bead on left, red bead on right

Diagram 2: red bead on left, blue bead on right.

As the two diagrams show, the first configuration with a blue bead on the left and a red bead on the right can be rotated to produce a new configuration where the red bead is on the left and the blue bed is on the right. This means that there are 13+1=14 possible necklaces and thus 14/2=7 possible bracelets.

When there are 20 beads, the situation is of course more complicated but the principle is the same. There will be the 50388 necklaces as calculated above but there are also the extra necklaces created by rotating the blue and red beads by 180° for the symmetric configurations like the one shown in Diagram 3. In every symmetric configuration, there will be nine beads (six green and three red) on either side of the red-blue bead axis. There are \( \binom{9}{3} = 84 \) ways this can be done and so the total number of necklaces is 50388+84=50472, corresponding to 50472/2=25236 bracelets.
Diagram 3: a symmetrical position with green and red
identically placed on either side of the red-blue axis


Saturday, 7 April 2018

The New Powerball

I received an email from the Lott today announcing the following changes to Powerball:
New Powerball Updates 
BIG JACKPOTS
There is an increased chance of big jackpots occurring more often.
 
MORE WINNERS
There will be more overall winners in every draw with the chance of winning an overall prize increasing from 1 in 78 to 1 in 44.
 
NEW 9TH PRIZE DIVISION
The Powerball prize structure will include an extra 9th prize division.
 
NUMBER UPDATES
The New Powerball game will feature 7 winning numbers drawn from a barrel of 35 balls (numbered 1-35). This was previously 6 numbers drawn from a barrel of 40 balls (numbered 1-40).
 
We’ve randomly generated replacements for numbers greater than 35 and added a new 7th number to your Favourite and Subscription entries.
There will be no changes to the Powerball. It will still be drawn from a barrel of 20 balls (numbered 1-20).
This claim of an increased chance of big jackpots occurring more often is perplexing because it seems that the number of possible combinations has increased, meaning the probability of winning has decreased (significantly as we can see below):$$ \text{BEFORE }\binom{40}{6} \times 20 = 76,767,600 \text{ <---> AFTER } \binom{35}{7} \times 20 = 134,490,400$$ The chance of winning, that is getting the correct combination of seven numbers and the powerball, is now almost halved.

Maybe I'm missing something but I can't see what it is. There may well be more overall winners with the introduction of a 9th prize division but I wonder if the provision of even more piddling minor prizes will actually entice punters. Even without knowing the precise probability, most punters will recognise intuitively that, with the powerball choices remaining the same, the chance of getting seven numbers correct out of 35 is going to be considerably less than getting six numbers out of 40. All punters have their eye of the big prize not on the increasing proliferation of minor prizes.

Saturday, 17 March 2018

Losing at Lotto

Figure 1
Each week, I play four games in the Saturday Night Gold Lotto and, though I seldom win a prize, I always manage to choose at least one winning number. For each game in this particular lottery, you must choose six numbers out of a total of 45 (numbered from 1 to 45) and, during the draw, six main numbers are chosen as well as two supplementary numbers (so there are eight "winning" numbers). If you select all six main numbers, you share in the first division prize of $4,000,000. The amount is divided among the total numbers of winners which on average is between four and five. Combinations of main numbers and supplementary numbers win lesser prizes. Tonight, I was surprised to see that I'd managed to select none of the eight winning numbers. I've attached a screenshot of my results (see Figure 1). This got me wondering what was the probability of doing this? It had to be fairly low because I couldn't recall it ever happening to me before.

To tackle the problem, let's consider a single game in which there are 37 "losing" numbers along with the eight "winning" numbers. How many ways can these 37 numbers be chosen if I am selecting six numbers at a time, disregarding the order in which they are chosen. There are \( ^{37}C_6 \)= 2516 ways to do this out of a total of \(^{45}C_6\) = 8815 possibilities. So the probability of choosing six losing numbers in a single game is 2516/8815 which is almost 0.29 or 29%. Thus for every 100 games I play, around 29 will result in my missing all of the winning numbers. However, it is highly unlikely that I'll "succeed" in doing this four times in a row because each game is independent of the other and so the probabilities are multiplied. Thus the fraction 2516/8815 is raised to the fourth power and this gives a probability of about 0.0066 or 0.66%. In other words, if I play 10,000 sets of four games each, I'll only miss all of the winning numbers about 66 times. Tonight was one of those times.

Below is shown the WolframAlpha calculation:


For an earlier post on the probability of winning at Oz Lotto, follow this link.

UPDATE: on Saturday March 6th 2021 I also managed to select no numbers out of four games. Thus it is almost three years since this last happened. Figure 2 shows a screenshot of the results.

Figure 2

Sunday, 11 February 2018

The Mathematics of Chess Pairings

There was a recent article is ChessBase regarding a problem that had arisen last year involving the world's highest ranked woman player, Hou Hifan. The article began:
The Gibraltar Masters wrapped up Thursday, with Levon Aronian in first place. This year Round Ten passed without incident, in contrast to 2017 when, on February 2nd, the story of the day was a rare scandal involving women's World Champion Hou Yifan deliberately losing a game in protest of the high number of women she was paired against. She was further confounded when a similarly unlikely string of pairings happened in October at the Isle of Man Open. Johannes Meijer looks at the odds in detail. Hou did not return to Gibralter in 2018, but instead competed in the Tata Steel Chess Masters.
Imagine, you are at a tournament with 255 players of which 43 are female. You are to play ten rounds. How many female opponents would you expect to face? Three? Five? I am pretty sure you wouldn't say seven. Yet, this was exactly the number of female players Hou Yifan faced at the Gibraltar Open 2017 when, a year ago today, she threw her last game in protest of these seemingly odd pairings.
The article goes on to ask the question: How probable is such a pairing? Could it have happened by chance at all? Well, the approach to solving this problem involves the hypergeometric distribution, a discrete probability distribution commonly covered in high school probability and statistics courses. Wikipedia describes it thus:


Thus to find how likely, or unlikely, Hou's pairings were we only have to replace "green marbles" with women and "red marbles" with men. So k=7, K=43, N=255, n-10, n-k=3 and N-K=212. Substituting into the formula we get:$$P(X=7)=\frac{^KC_k \text{ . } ^{N-K}C_{n-k}}{^NC_n}=\frac{^{43}C_7 \text{ . } ^{212}C_{3}}{^{255}C_{10}}\approx 0.000188 $$Thus it seen that the likelihood is very small that this could happen and yet the pairings were allegedly arranged using a computer draw. The quoted article carries out similar calculations but follow a somewhat different approach.

To be strictly accurate, since possible pairings with Hou Hifan are under consideration, we should make K=42 and thus N=254. This gives a slightly lower probability of 0.000164 and so even more unlikely. It means that out of 10,000 random pairings of a woman with ten competitors, the result of being paired with another woman in seven out of the ten rounds would be expected to occur less than twice. On the other hand, the probability of not being paired with any women is nearly 16% and is given by:$$P(X=0)=\frac{^KC_k \text{ . } ^{N-K}C_{n-k}}{^NC_n}=\frac{^{42}C_0 \text{ . } ^{212}C_{10}}{^{254}C_{10}}\approx 0.158251 $$

Wednesday, 31 May 2017

Oz Lotto


Last night for $1.30, I bought a single game in Oz Lotto. The winning numbers were 1, 4, 13, 19, 26, 31, 35 and the numbers in bold were the matching numbers that I had in my game. I got three out of the seven numbers which didn't win me a prize but it was impressive nonetheless I thought. What were the odds of this happening?

The number of ways that seven numbers can be selected from 45 numbers, disregarding order, is given by \( ^{45}C_7  = 45,379,620 \). Thus there is only one chance in 45,379,620 that the combination 1, 4, 13, 19, 26, 31, 35 will appear. Given those seven numbers, in how many ways can three of them be chosen? Clearly, in \( ^7C_3 \) = 35 ways.

This means that the number of ways in which three winning numbers can occur out of seven numbers is  \( \text{35 x }  ^{38}C_4 \). This is because none of the remaining four numbers can contain a winning number, thus it is a choice of any four of the remaining 38 non-winning numbers. The probability of choosing three winning numbers in a single game is thus: \[ \text{35 x } \frac{^{38}C_4}{^{45}C_7} = \frac{172235}{3025308} \approx 0.05693 \]Thus the figure as a percentage is about 5.7%. I dithered around trying to work this out but I'm fairly certain that this is the correct approach. For the sake of completeness, I'll work out the probability of getting four, five and six numbers:

For four numbers, chances are: \[ \text{35 x } \frac{^{38}C_3}{^{45}C_7} = \frac{4921}{756327} \approx 0.0065 \]For five numbers, chances are: \[ \text{21 x } \frac{^{38}C_2}{^{45}C_7} = \frac{4921}{15126540} \approx 0.0003 \]For six numbers, chances are:\[ \text{7 x } \frac{^{38}C_1}{^{45}C_7} = \frac{133}{22689810} \text{  or a very small chance!} \]Working on this post, I noticed that Blogger's rendering of LaTeX code has changed. Before, use of the $ sign at the beginning and end of a mathematical expression meant that MathJax was used to create the inline expression:
MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers ... MathJax uses web-based fonts (in those browsers that support it) to produce high-quality typesetting that scales and prints at full resolution (unlike mathematics included as images) source
Now however, use of the dollar sign creates an inline image of the mathematical expression and it is only by use of the curved brackets and backslash that MathJax is invoked. The double dollar sign to create display expressions remains unchanged however, and there is no need yet to use backslash and open and closed square brackets. As before, in Android, nothing seems to work.