Monday, 24 June 2024

Stanley Cup, Sweeps, Reverse Sweeps and Home vs Visitors in Games 7 (History vs Simulations)


Stanley Cup, Sweeps, Reverse Sweeps and Home vs Visitors in Games 7 (History vs Simulations)

Here is a quick update on sweeps, reverse sweeps and Game 7 results, comparing simulation results and actual historical results. The simulation assumes that the probability of the home team winning in games 1.2,5, and 7 is 57%, while the probability of the home game winning in games 3,4 and 6 is 50%. These are historical averages over the past 30 or so years.

The R-based simulation program played 15000 series (maximum 105000 games, though in practice it only needed to play about 85% of those games, as most series concluded before game 7).

Series Going to 3-0 for the Higher Ranked Team

In 15000 simulated series, there were 2402 games that went to a 3-0 lead for the higher ranked team (in 2024 that would be Florida). That calculates out to 16.0% (2402/15000). That goes for all series, but given the simulation assumptions, 16% would also apply to the final series.

Looking at the 31 years from 1993-94 to 2023-24, there were 5 final series that went to 3-0 out of 31 final series. That calculates out to 16.1% (5/31), very close to what the simulation predicts.

Series Going to 3-0 for the Higher Ranked Team, then a 4-0 Sweep

In the 15000 simulated series, there were 1199 series where the 3-0 team won game 4 and thus had a sweep. That’s 8.0% of all series and 49.9% of series that had gone to 3-0.

In the 31 years from 1994-95 to 2023-24, there were 2 4-0 sweeps. That is 6.5% (2/31) of all series and 40% (2/5) of all series that had gone to 3-0.

So, the historical averages were somewhat lower than the simulation results. Of course with small numbers of actual games, the inherent variability of a small sample can produce results that are too high or too low. Had one more series had become a sweep, the percentages would be higher than the simulation predicts, rather than lower.

Series Going to 3-0 for the Higher Ranked Team, then to 3-4 Reverse Sweep

In the 15000 simulated series, there were 104 series where the 3-0 team lost the next 4 games, resulting in a reverse sweep. That’s 0.7% of all series and 4.3% of series that had initially gone to 3-0.

In the 31 years from 1994-95 to 2023-24, there were 0 reverse sweeps. That is 0.0% (0/31) of all series and 0% (0/5) of all series that had gone to 3-0.

Of course, with such small predicted frequencies (0.7% and 4.3%), one would need a lot of actual games to expect to get even get one reverse sweep, so the simulation and historical results are reasonably close. To get even one reverse sweep in the finals, we would require a lot more than 31 games. In fact, the one reverse sweep usually noted by the media (1942 Maple Leafs over Red Wings) fits that bill rather nicely, at once in 82 years (a bit over one percent).

Home vs Visitor in Game 7

As noted in the assumptions, the simulation predicts that the home team will win 57% of game 7 contests. The historical data from 1993-94 to 2022-23 shows that there were 8 series that went to Game 7, and the home team won 5 of those, with 3 going to the visitor. That gives the home team a 62.5% win rate.

Again, due to the small number of games in the historical sample, it is mathematically impossible to hit 57%, so 62.5% is quite reasonable concordance between prediction and actual history.

My Prediction for Game 7

As for what will happen in Game 7 in 2023-24 (Oilers-Panthers), I would say that the current momentum of the series indicates that it is about 50/50, instead of the usual 57/43 for the home team. So, a reverse sweep, which is uncommon, but one might say that it is due, as is a Canadian team winning the Stanley Cup (that is incredibly overdue). So, if you put stock in such ideas as an event being “due”, that’s your answer. Of course, in statistical theory this is generally referred to as the Gambler’s Fallacy. So there’s that.

Assumptions of the simulation model:

Number of Series per year: 15

Number of Seasons per Simulation 100

Number of Runs of Simulation 10

Total Number of Playoff Series 15000

Games Possible, all Series got to 7: 105000

Actual number of Games in sim: 87130

Pct of Possible actually played 83.0%

Probability, Team A winning at home: 57.2%

Probability, Team B winning at home: 50.2%

-----------------------------------------------------------------------------------------------------------------------

And here’s a different sort of Canada-U.S. experience:


On the Road with Bronco Billy


Sit back and go on a ten day trucking trip in a big rig, through western North America, from Alberta to Texas, and back again. Explore the countryside, learn some trucking lingo, and observe the shifting cultural norms across this great continent.



Amazon U.S.: http://www.amazon.com/gp/product/B00X2IRHSK

Amazon U.K.: http://www.amazon.co.uk/gp/product/B00X2IRHSK

Amazon Canada: http://www.amazon.ca/gp/product/B00X2IRHSK

Amazon Australia: https://www.amazon.com.au/dp/B00X2IRHSK

Amazon Germany: http://www.amazon.de/gp/product/B00X2IRHSK

Amazon France: https://www.amazon.fr/dp/B00X2IRHSK

Amazon Spain: https://www.amazon.es/dp/B00X2IRHSK

Amazon Italy: https://www.amazon.it/dp/B00X2IRHSK

Amazon Netherlands: https://www.amazon.nl/dp/B00X2IRHSK

Amazon Japan: https://www.amazon.co.jp/dp/B00X2IRHSK

Amazon Brazil: https://www.amazon.com.br/dp/B00X2IRHSK

Amazon Mexico: https://www.amazon.com.mx/dp/B00X2IRHSK

Amazon India: https://www.amazon.in/dp/B00X2IRHSK


=======================================================

What follows is an account of a ten day journey through western North America during a working trip, delivering lumber from Edmonton Alberta to Dallas Texas, and returning with oilfield equipment. The writer had the opportunity to accompany a friend who is a professional truck driver, which he eagerly accepted. He works as a statistician for the University of Alberta, and is therefore is generally confined to desk, chair, and computer. The chance to see the world from the cab of a truck, and be immersed in the truck driving culture was intriguing. In early May 1997 they hit the road.

Some time has passed since this journal was written and many things have changed since the late 1990’s. That renders the journey as not just a geographical one, but also a historical account, which I think only increases its interest.

We were fortunate to have an eventful trip - a mechanical breakdown, a near miss from a tornado, and a large-scale flood were among these events. But even without these turns of fate, the drama of the landscape, the close-up view of the trucking lifestyle, and the opportunity to observe the cultural habits of a wide swath of western North America would have been sufficient to fill up an interesting journal.

The travelogue is about 20,000 words, about 60 to 90 minutes of reading, at typical reading speeds.

==========================================

Sunday, 23 June 2024

AI LLM Silliness - Adjusting the pendulum on a digital clock

Whichever AI Large Language Model produced this text (found on a blog), it thinks that digital clocks have pendulums inside them.  To me (a human), that is very silly.

(To be fair, LLMs don't actually think).

https://www.circuitsgallery.com/digital-clock-running-fast/

===============================================

How to Fix Digital Clock Running Fast

Adjust an External Pendulum

To hold the pendulum, take a non-dominant hand and use it. At the lowest tip of the pendulum, reach a little screw. Once you have access to the Pendulum, which is a little screw that is essential for regulating the speed of your clock.

Adjust an Internal Pendulum

On the top of the digital clock, try locating a tiny hole. You are likely to encounter words like ‘slow’ and ‘fast’ surrounding the hole to lead you in adjusting the speed of the clock.

The narrower end of a double-ended key should be inserted into the hole. It is only possible to turn the key firmly to the left; otherwise, turn it in the direction indicated on the clock’s top. It’s likely that turning the Key in this manner will make the clock tick slower.

Keep in mind that making a full rotation will slow your clock by 2 minutes for every 24-hour period. Several times each day, compare the modified clock to an accurate timepiece. You need to continuously adjust your digital clock until it displays the right time.

Monday, 17 June 2024

Oilers and Panthers, What are the Odds of a Reverse Sweep (2024 Stanley Cup Finals)

(Update after Game 5): Oilers and Panthers, What are the Odds of a Reverse Sweep (2024 Stanley Cup Finals)?

Update after Game 5: 

Note: Based on a Monte Carlo simulation.  Another run of the simulation would give very similar, though somewhat different results.  Read the whole thing for details.

Probability of Team B (Oilers) Scenarios, Given Starting at 2-3 wins Pct

Win Game 6 at Home, having won Games 4, 5: 297/540 55%

Win Game7 Visitor, having won Games 4, 5, 6: 111/540 21%

 
------------------------------------------------------------------------------------------------------------------------

The Oilers-Panthers Stanley Cup Final series is now at 3 games to 1 for Florida. Since Edmonton had such a convincing win in Game 4 (8-1, thereby avoiding elimination) there are tentative speculations about whether the Oilers may do a reverse sweep. That is when a team that is 0-3 sweeps the next 4 games, and ends up winning the series (i.e. sweeps the last four games).


Looking at history, the last time this occurred was 1942, when Toronto beat Detroit in such a manner. That’s about 80 years ago, so reverse sweeps in the final are quite rare.

That’s a combination of a lot of factors. First, there is the fact that Team A has to go up 3-0 before it is mathematically possible for Team B to win a reverse sweep. That itself isn’t all that common. Then, Team B must win 4 straight games, a tough thing to do in the playoffs, especially the finals.

Below are results of a simulation model that I developed in R, showing some probabilities concerning a reverse sweep.

The model uses 15 playoff series per season and 100 seasons per run. It was further run 10 times. Note that Monte Carlo models are approximations, and tend to be more accurate (have less variability) the more runs you do.

Also, note that the probabilities of Team A and Team B winning at home are taken from actual results since 1993. The probabilities or Team A and Team B losing while on the road are, of course, the converse of those.

First the assumptions and overall results of the model:

Number of Series per year: 15

Number of Seasons per Simulation 100

Number of Runs of Simulation 10

Total Number of Playoff Series 15000

Games Possible, all Series got to 7: 105000

Actual number of Games in sim: 87130

Pct of Possible actually played 83.0%

Probability, Team A winning at home: 57.2%

Probability, Team B winning at home: 50.2%



The simulation then looked at the probability of Team A (the home team for Games 1, 2, 5, 7) getting to the 3-0 stage, which is obviously necessary for a reverse sweep to have the possibility of occurring.

Probability of Team A Getting to 3-0 wins Pct

Win Game1 at Home 8605 57.4%

Win Game2 at Home, having won game 1 4941 32.9%

Win Game3 Visiting, having won 1 and 2 2482 16.5%


So, overall the probability of a 3-0 lead for Team A is 16.5%, or about about 1 in 6. So, most years there will be between 2 and 3 series out of 15, where the team that was higher in the regular season standings (Team A) takes a 3-0 lead. For the finals themselves, this should only happen about twice per 11 years.

But now we are interested in how often Team B (the lower ranked team during the regular season) wins the series, given that they are behind 3-0 after 3 games. Remember that their are 2482 possibilities, where Team A has a 3-0 lead. That becomes the denominator for the win percentages calculated below.

Probability of Team B Scenarios, Given Starting at 0-3 wins Pct

Win Game 4 at Home 1265 51.0%

Win Game 5 Visitor, having won game 4 540 21.8%

Win Game 6 at Home, having won4, 5 297 12.0%

Win Game7 Visitor, having won4, 5, 6 111 4.5%


Of course the Oilers are at 3-1 now, having won Game 4 quite convincingly. However, the model has no knowledge of that, so it just applies long-term historical data again.



Probability of Team B Scenarios, Given Starting at 1-3 wins Pct

Win Game 5 Visitor, having won game 4 540 42.7%

Win Game 6 at Home, having won4, 5 297 23.5%

Win Game7 Visitor, having won4, 5, 6 111 8.8%



So, based on this model, the Oilers have about a one in ten chance of completing a reverse sweep. That’s unlikely, but not tremendously unlikely. It is similar to tossing 3 heads in a row, or drawing an Ace of any suit from a deck of cards. In regular life, we see events like this quite frequently.

However, we know more things than the model does:

  • Winning 8-1 arguably means the Oilers have better odds than the model predicts.

  • Having knocked the Panthers top goalie out of that game arguably means the Oilers odds are better than the model predicts.

  • Having their top lines regaining their scoring touch arguably means the Oilers odds are better than the model predicts.

  • The fact that the Oilers are no strangers to long winning streaks (e.g. a streak of 16 straight wins this year) arguably means the Oilers odds are better than the model predicts.

On the other hand:

  • The Panthers goalie may have had his one bad game and will return to form, stymieing the Oilers’ big guns as he did for 2 and 2/3 games.

  • The Panthers are no strangers to bounce-backs and may just shake off their bad game, especially with the crowd (and therefore, possibly the officials) behind them.

  • Conversely, the Oilers will not have their wildly enthusiastic fans (and therefore, possibly the officials) behind them.

-----------------------------------------------------------------------------------------------------------------------

And here’s a different sort of Canada-U.S. experience:


On the Road with Bronco Billy

Sit back and go on a ten day trucking trip in a big rig, through western North America, from Alberta to Texas, and back again. Explore the countryside, learn some trucking lingo, and observe the shifting cultural norms across this great continent.

Amazon U.S.: http://www.amazon.com/gp/product/B00X2IRHSK

Amazon U.K.: http://www.amazon.co.uk/gp/product/B00X2IRHSK

Amazon Canada: http://www.amazon.ca/gp/product/B00X2IRHSK

Amazon Australia: https://www.amazon.com.au/dp/B00X2IRHSK

Amazon Germany: http://www.amazon.de/gp/product/B00X2IRHSK

Amazon France: https://www.amazon.fr/dp/B00X2IRHSK

Amazon Spain: https://www.amazon.es/dp/B00X2IRHSK

Amazon Italy: https://www.amazon.it/dp/B00X2IRHSK

Amazon Netherlands: https://www.amazon.nl/dp/B00X2IRHSK

Amazon Japan: https://www.amazon.co.jp/dp/B00X2IRHSK

Amazon Brazil: https://www.amazon.com.br/dp/B00X2IRHSK

Amazon Mexico: https://www.amazon.com.mx/dp/B00X2IRHSK

Amazon India: https://www.amazon.in/dp/B00X2IRHSK

=======================================================

What follows is an account of a ten day journey through western North America during a working trip, delivering lumber from Edmonton Alberta to Dallas Texas, and returning with oilfield equipment. The writer had the opportunity to accompany a friend who is a professional truck driver, which he eagerly accepted. He works as a statistician for the University of Alberta, and is therefore is generally confined to desk, chair, and computer. The chance to see the world from the cab of a truck, and be immersed in the truck driving culture was intriguing. In early May 1997 they hit the road.

Some time has passed since this journal was written and many things have changed since the late 1990’s. That renders the journey as not just a geographical one, but also a historical account, which I think only increases its interest.

We were fortunate to have an eventful trip - a mechanical breakdown, a near miss from a tornado, and a large-scale flood were among these events. But even without these turns of fate, the drama of the landscape, the close-up view of the trucking lifestyle, and the opportunity to observe the cultural habits of a wide swath of western North America would have been sufficient to fill up an interesting journal.

The travelogue is about 20,000 words, about 60 to 90 minutes of reading, at typical reading speeds.

==========================================

Friday, 7 June 2024

Who had the Easier Ride (Penalties) to the 2024 Stanley Cup Finals, Oilers or Panthers?

Who had the Easier Ride (Penalties) to the 2024 Stanley Cup Finals, Oilers or Panthers?

Below is a comparison of the penalties given to the Oilers and the Panthers in their respective playoff series, previous to the Stanley Cup finals.  I should note that if I use the term 'bias' or 'advantage' I only mean that in the statistical sense of the term.  It does not mean that the referees were calling games unfairly (though many partisans might think they did).

Comparison of Penalties Given to Stanley Cup Finalists and their Opponents in First Three Rounds

Edmonton Oilers

The Oilers had just about the same number of penalties called on them as against them, overall (68 penalties to them vs 70 to their opposition). That is a ratio of 0.97 to 1.00, in Edmonton's favor.  So, overall a very slight edge for Edmonton over their opponents, over the first three rounds of the playoffs.

That slight overall edge was due to a large Edmonton edge during the L.A. series, where they had 0.75 penalties called for every one called on the Kings.  Those ratios reversed in the Vancouver series (1.03 penalties for Edmonton for every one called on the Canucks) and the Dallas series (1.33 penalties called on the Oilers for every one called on the Stars).

When playing in Edmonton's rink, the Oilers had 0.88 penalties for every penalty given to the opposition (some home-ice bias).  When playing in the opposition rinks, they had 1.05 penalties called against them for every 1 called on the opposition team (also a home-ice bias for the opposition teams, though not quite as strong as was the case in the Edmonton rink).

Edmonton had a strong home ice advantage in the L.A. series, but actually had both home-ice and visitor disadvantages in the Vancouver and Dallas series.  That said, things were nearly even in the Vancouver series, but not so much in the Dallas series (though the overall number of penalties was low in that series). 

In conclusion, the Oilers didn't get an easy ride from the officials overall, though it could be said that they had it easy in the L.A. series, very even in the Vancouver series, and were somewhat hard-done by in the Dallas series.

Rink Location Team Rnd 1 Opp Rnd 2 Opp Rnd 3
Total
Edm Edm 7 (LA) 14 (VAN) 7 (DAL) 28
Edm Opp 13 (LA) 13 (VAN) 6 (DAL) 32
Opp Edm 14 (LA) 17 (VAN) 9 (DAL) 40
Opp Opp 15 (LA) 17 (VAN) 6 (DAL) 38









EdmTeam – Home&Away
21 (LA) 31 (VAN) 16 (DAL) 68
OppTeam – Home&Away
28 (LA) 30 (VAN) 12 (DAL) 70
Ratio (Edm:Opponent)
0.75 (LA) 1.03 (VAN) 1.33 (DAL) 0.97









Edm Rink (Edm:Opp)
0.54 (LA) 1.08 (VAN) 1.17 (DAL) 0.88
Opp Rink (Edm: Opp)
0.93 (LA) 1.00 (VAN) 1.50 (DAL) 1.05


Florida Panthers

The Panthers had significantly fewer penalties called on them as against them, overall (65 penalties to them vs 77 to their opposition). That is a ratio of 0.84 to 1.00, in Florida's favor.  So, overall a significant but not huge edge.

That slight advantage was reversed in the series against Tampa Bay, where the Florida was penalized 1.33 times for every time that Tampa took a penalty.  Those ratios turned to the Panthers' advantage for  the Boston series (0.67 penalties for Florida for every one called on the Bruins) and the New York Rangers series (0.74 penalties called on the Panthers for every one called on the Rangers.

When playing in their home rink, the Panthers had 0.73 penalties for every penalty given to the opposition (a home-ice bias).  When playing in the opposition rinks, they had 1 penalty called against them for every 1 called on the opposition team (i.e. no advantage either way).

Florida had a home ice penalty advantages in all three pre-final series.  The advantage was fairly small in the Tampa series (0.92 penalties for every 1 penalty to Tampa, moderately large in the Boston series (0.75 to 1 for Florida) and large in the New York Rangers series (0.50 penalties for every 1 NYR penalty). 

In conclusion, when it came to penalties, the Panthers were almost completely opposite to the Oilers.  They were at a penalty disadvantage early against Tampa Bay, but had the advantage in the later Boston and NYR series.  

Rink Location Team Rnd 1 Opp Rnd 2 Opp Rnd 3 Opp
FLA FLA 12 TAM 15 BOS 6 NYR 33
FLA Opp 13 TAM 20 BOS 12 NYR 45
Opp FLA 12 TAM 9 BOS 11 NYR 32
Opp Opp 5 TAM 16 BOS 11 NYR 32









FLA Team – Home&Away
24 TAM 24 BOS 17 NYR 65
OppTeam – Home&Away
18 TAM 36 BOS 23 NYR 77
Ratio (FLA:Opponent)
1.33
0.67 BOS 0.74 NYR 0.84









FLA Rink (FLA:Opp)
0.92 TAM 0.75 BOS 0.50 NYR 0.73
Opp Rink (FLA: Opp)
2.40 TAM 0.56 BOS 1.00 NYR 1.00

Conclusion

It seems reasonable to conclude that Florida had a somewhat more favorable penalty situation than Edmonton, in the two teams' respective playoff series, prior to the finals.  This was particularly true on home-ice.  It will be interesting to see whether this pattern persists in the finals.  If it does, that would obviously be advantageous for Florida.  If the pattern is more neutral or favorable to Edmonton, the Oilers chances will be improved.

Throughout the season, both teams had excellent power plays and good penalty kill results.  During the first three rounds, Edmonton had the edge in these categories.  Should the home-ice penalty advantage hold for Miami, the Oilers will definitely need their excellent special teams play to continue.

 

-----------------------------------------------------------------------------------------------------------------------

And here’s an account of a different sort of Canada-U.S. experience, though equally as interesting as hockey:

On the Road with Bronco Billy

Sit back and go on a ten day trucking trip in a big rig, through western North America, from Alberta to Texas, and back again. Explore the countryside, learn some trucking lingo, and observe the shifting cultural norms across this great continent.

Amazon U.S.: http://www.amazon.com/gp/product/B00X2IRHSK

Amazon U.K.: http://www.amazon.co.uk/gp/product/B00X2IRHSK

Amazon Canada: http://www.amazon.ca/gp/product/B00X2IRHSK

Amazon Australia: https://www.amazon.com.au/dp/B00X2IRHSK

Amazon Germany: http://www.amazon.de/gp/product/B00X2IRHSK

Amazon France: https://www.amazon.fr/dp/B00X2IRHSK

Amazon Spain: https://www.amazon.es/dp/B00X2IRHSK

Amazon Italy: https://www.amazon.it/dp/B00X2IRHSK

Amazon Netherlands: https://www.amazon.nl/dp/B00X2IRHSK

Amazon Japan: https://www.amazon.co.jp/dp/B00X2IRHSK

Amazon Brazil: https://www.amazon.com.br/dp/B00X2IRHSK

Amazon Mexico: https://www.amazon.com.mx/dp/B00X2IRHSK

Amazon India: https://www.amazon.in/dp/B00X2IRHSK

=======================================================

What follows is an account of a ten day journey through western North America during a working trip, delivering lumber from Edmonton Alberta to Dallas Texas, and returning with oilfield equipment. The writer had the opportunity to accompany a friend who is a professional truck driver, which he eagerly accepted. He works as a statistician for the University of Alberta, and is therefore is generally confined to desk, chair, and computer. The chance to see the world from the cab of a truck, and be immersed in the truck driving culture was intriguing. In early May 1997 they hit the road.

Some time has passed since this journal was written and many things have changed since the late 1990’s. That renders the journey as not just a geographical one, but also a historical account, which I think only increases its interest.

We were fortunate to have an eventful trip - a mechanical breakdown, a near miss from a tornado, and a large-scale flood were among these events. But even without these turns of fate, the drama of the landscape, the close-up view of the trucking lifestyle, and the opportunity to observe the cultural habits of a wide swath of western North America would have been sufficient to fill up an interesting journal.

The travelogue is about 20,000 words, about 60 to 90 minutes of reading, at typical reading speeds.

==========================================