The Magic Number

dbn

Member
SoSH Member
Feb 10, 2007
7,785
La Mancha.
I just wrote a quick Monte Carlo, because it's easy to do if you have a random number generator already coped from Numerical Recipes.

Assuming both teams have a 50/50 chance of winning each remaining game, the Red Sox finish ahead of the Yankees 98.09%, NY finishes ahead 1.02%, and they tie 0.89% of the time.

Assuming both teams have a chance of winning each remaining game equal to their current win % (but 50/50 in the 6 remaining head-to-head games), the numbers are 99.69% / 0.17% / 0.14%.

Not nearly as elegant as @Red Sox Physicist but here's the C code:
#include<stdio.h>
#include<stdlib.h>

#define IA 16807
#define IM 2147483647
#define AM (1.0/IM)
#define IQ 127773
#define IR 2836
#define NTAB 32
#define NDIV (1+(IM-1)/NTAB)
#define EPS 1.2e-7
#define RNMX (1.0-EPS)

float ran1(long *idum)
{
int j;
long k;
static long iy=0;
static long iv[NTAB];
float temp;

if (*idum <= 0 || !iy) {
if (-(*idum) < 1) *idum=1;
else *idum = -(*idum);
for (j=NTAB+7;j>=0;j--) {
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
if (j < NTAB) iv[j] = *idum;
}
iy=iv[0];
}
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
j=iy/NDIV;
iy=iv[j];
iv[j] = *idum;
if ((temp=AM*iy) > RNMX) return RNMX;
else return temp;
}
#undef IA
#undef IM
#undef AM
#undef IQ
#undef IR
#undef NTAB
#undef NDIV
#undef EPS
#undef RNMX


int main(int argc, char *argv[])
{
int i, j, k, n, iter=10000;
int RSw, RSl, RSpw, MFYw, MFYl, MFYpw, RSvMFYgr, RSng, MFYng, mutual, method;
int good=0, evil=0, purgatory=0;
float RSwp, MFYwp, num, RSodds=0.5, MFYodds=0.5;
long *idum, lj, lk;
char line[999], c[40];

fprintf(stderr, "current # of Red Sox wins:");
fscanf(stdin, "%d", &RSw);
fprintf(stderr, "current # of Red Sox losses:");
fscanf(stdin, "%d", &RSl);
RSwp = (float)(RSw)/(float)(RSw+RSl);
RSng = 162 - (RSw + RSl);

fprintf(stderr, "current # of MFY wins:");
fscanf(stdin, "%d", &MFYw);
fprintf(stderr, "current # of MFY losses:");
fscanf(stdin, "%d", &MFYl);
MFYwp = (float)(MFYw)/(float)(MFYw+MFYl);
MFYng = 162 - (MFYw + MFYl);

fprintf(stderr, "current # of Red Sox vs MFY games remaining:");
fscanf(stdin, "%d", &mutual);


method=0;
while(method<1 || method > 2){
fprintf(stderr, "Enter (1) for 50/50 method, (2) for current win pct:");
fscanf(stdin, "%d", &method);
}
if(method==2){
RSodds=RSwp;
MFYodds=MFYwp;
}

fprintf(stderr, "Enter random seed:");
fscanf(stdin, "%ld", &lj);
lk=-lj;
idum=&lk;
num=ran1(idum);
idum=&lj;

for(n=0;n<iter;n++){
RSpw=0;
for(i=0;i<(RSng-mutual);i++){
num=ran1(idum);
if(num<RSodds) RSpw++;
}
MFYpw=0;
for(i=0;i<(MFYng-mutual);i++){
num=ran1(idum);
if(num<MFYodds) MFYpw++;
}

for(i=0;i<mutual;i++){
num=ran1(idum);
if(num<0.5) RSpw++;
else MFYpw++;
}

if((RSw+RSpw) > (MFYw+MFYpw)) good++;
else
if((RSw+RSpw) == (MFYw+MFYpw)) purgatory++;
else evil++;
}
fprintf(stdout, "Red Sox win the division %f percent of the time.\n", (float)(good)/(float)(iter));
fprintf(stdout, "MFY win the division %f percent of the time.\n", (float)(evil)/(float)(iter));
fprintf(stdout, "Tie for the division %f percent of the time.\n", (float)(purgatory)/(float)(iter));
}
 
Last edited:

DennyDoyle'sBoil

Found no thrill on Blueberry Hill
SoSH Member
Sep 9, 2008
42,271
AZ
I hope we don't get stuck on 29 for as long as my father's birthdays apparently allegedly did when he couldn't face getting older.
 

dcmissle

Deflatigator
Lifetime Member
SoSH Member
Aug 4, 2005
28,269
Every click we got in this thread this weekend, the Sox earned. Toronto, no chance in NY with that staff.
 

dcmissle

Deflatigator
Lifetime Member
SoSH Member
Aug 4, 2005
28,269
Sox are 9-3 since that series. It’s not as if they have gone 6-6 and lucked out that the MFY have also lost
That’s what makes this year’s team different. The old, beloved can’t-stand-prosperity kids would have found a way to split the recent series in Baltimore.
 

tims4wins

PN23's replacement
SoSH Member
Jul 15, 2005
37,054
Hingham, MA
Thanks @Savin Hillbilly That is some good stuff. I guess Lose's math was directionally correct.

For me, I feel good saying we just need 33 out of 84 outcomes to bounce our way. (Let me check to see if Eddie Gaedel ever spent time with the Sox wearing 33/84 for a number.)
Went 6 for our last 14, so now it is 27 with 70 outcomes left. % improved slightly from needing 39.3% of outcomes to go our way to needing 38.6% of outcomes to go our way.

If we go 6 for 14 the rest of the way, in essence the magic number would be 3 with a week to play.
 

Saints Rest

Well-Known Member
Lifetime Member
SoSH Member


This has been a shitty number for the B's
My first favorite Bruin, as about a 5-year old, -- and I have no idea why, -- was Reggie Leach. He was #27. Wasn't much more than a bottom player on those great teams, until he made it to the Flyers (after a couple stops in the NHL desert) where he became one of the best scorers in the league.
 

tims4wins

PN23's replacement
SoSH Member
Jul 15, 2005
37,054
Hingham, MA
Went 6 for our last 14, so now it is 27 with 70 outcomes left. % improved slightly from needing 39.3% of outcomes to go our way to needing 38.6% of outcomes to go our way.

If we go 6 for 14 the rest of the way, in essence the magic number would be 3 with a week to play.
26 for 69 needed now, 37.7%
 

NoXInNixon

Member
SoSH Member
Mar 24, 2008
5,296
I'm a little bit let down any day the MFY have off. Every game they play is a chance for a loss which gets us a little closer to clinching. Plus we have played more games than they, so how do they even get days off on days we play?
 

The Raccoon

Member
SoSH Member
Jul 24, 2018
935
Germany
In the imaginary "every game is a coin flip" world, the Red Sox finish ahead of the MFY with a 97.77% probability. They were allready over 98% a couple days ago, but this massive slump brought them back a bit. Even if the MFY sweep the remaining 6 games against the Sox, the Sox win the Division with 78.65 % prob..
If both teams win their remaining games with the probability of their current records (and coin flips in the head to head games), it's 99.28% Red Sox...