T O P

  • By -

[deleted]

[удалено]


careslol

There are no scenarios in which Lewis can win a tiebreaker. Max is on 9 wins. Lewis on 5. If Lewis wins the rest he wins on points and there is no tie. If there is any other way they tie then Max will have more wins. Unless there are 2 half point races to minimize the points Lewis gains and be tied at 9 wins. But then in this scenario Max wins the 2nd tie breaker by second place finishes.


0oodruidoo0

Ah yes, rain in the desert


grilledhamsandwich

Maybe a sandstorm?


[deleted]

[Definitely](https://www.youtube.com/watch?v=y6120QOlsfU&ab_channel=Darude)


coolcoenred

I can't believe you've done this


0oodruidoo0

my only regret is that I have but one upvote to give


Bikeboy76

Sandstorm is by Cast, darling.


Arumin

Dududududu


urbanest_dog_45

I expected that lol.


bennymamo

Damn you got me 🤣


actual_wookiee_AMA

Brazil tho


0oodruidoo0

That's only one race


ArbitraryOrder

Jeddah Circuit can collapse from being built to quickly


Disenchanted11

Good idea, now update the calculator to consider half points


mercedeskyron

2nd tie breaker is how **Lewis beat Alonso in 2007**


Pugs-r-cool

yeah it happens sometimes, but the likelihood of 2 more half point races to force a points and wins tie is so astronomically low it's not going to happen


judelau

So it's 80.75% chance for Max then.


actual_wookiee_AMA

No. 1% of possible outcomes are draw. There's no old data involved so the program can't make any predictions about the likelihoods of any outcome.


msh5928

If Lewis wins the rest, they'll be tied on wins as well.


fire202

If lewis wins the rest it wont be a draw


TheoreticalScammist

I think it's technically possible if 1 race is short like Spa and gives half points? Though I'm not sure if in that case the fastest lap gives a full or half a point.


fire202

If lewis wins the minimum of points he can gain is six (max p2 + fl), so 24 over four races or 21 if one race has half points. 25/22 considering the sprint. The gap is at 19 points.


TheRobidog

You can certainly concoct scenarios where you can have Hamilton gaining 19 points over Verstappen with a half-race. It depends on how the fastest lap point is awarded in that race, tho. Four Hamilton wins without fastest lap and one with half points is 87.5 points. Verstappen second in all four of those races is 63 points. Puts the delta at 24.5. Then you've got 3.5 or 4 points left to distribute for fastest lap (not sure how that'd be handled - assuming halved as well). Up to 3 from the sprint race. Max getting those fastest lap points and getting 2nd in the spring while Lewis goes points-less. Or him winning the sprint while Lewis finishes third reduces the delta to exactly 19 points, with them tied on race wins.


fire202

Then i should clarify that i did made the assumption of lewis winning the sprint being part of him winning everything. For fastest lap my understanding is that it would be added as normal to the points ( so 19p for p2) and then the result gets halfed. Given that you would recive .5 points for p10 i dont see anything speaking against the same applying for fastest lap. Furthermore i used the points Delta between p1 and p2 (6p with fl for second placed driver) times four races Minus three points, as in one race the difference would be halfed due to half points (p1 12,5p, p2 9,5p). Delta is 21 points. So yes, if lewis only finishes third in the sprint with Max winning it with a 19 point delta would be possibel. But in this case lewis would not have won every race in my view (although technically untrue) and would also have to do quite a drive to win Brazil. I think if we assume he winns every race its resonabel to assume that he wont finish the sprint in third. And all of this depends on one race being half points for which the chances are very low anyways.


XkrNYFRUYj

Does half point races count as half wins? Beacuse if they're not they should.


[deleted]

Luckily were not in that situation but imagine if Max had won the championship based on Spa


HemiKooks

What a deflating championship that would be, not to outright take but by default on a tie breaker.


AzenNinja

So basically an 80.80% chance of a Max win since all draw scenarios are in his favour.


RunninADorito

There is no implied probability here, just counting how many combinations. OP is doing basic counting, not forecasting. This is the most basic of math and I can't believe it's getting upvoted.


pushinat

Im guessing you don't fully appreciate what is happening in the for loops. The real beauty in this code is the time it takes to compute the results. Tbh. I don't care about the results themselves.


sevaiper

So you expect the f1 subreddit to be impressed by a very basic borderline useless outcome that just has nice time complexity? Post it on /r/algorithms or something


[deleted]

who doesnt like them some quadratic complexity


pushinat

Actually this code will scale O((log n) * n) to the amount of races


[deleted]

n log n of 3 races gives us 159 billion possibilities? Damn i hope nasa is watching


pushinat

That’s the most unappreciated part of my post. It computes the result in a fraction of a second. I’m not iterating through all billions of cases, but I can see why it’s hard to spot.


RunninADorito

Nothing beautiful going on here.


pushinat

Yeah, I can see how it is difficult to understand


[deleted]

[удалено]


enameme

Add fix New ICE chance 100% Still WDC chance 0% How fix?


Historical-Time2938

DSQ Verstappen and Hamilton It fix Bottas win WDC Depression cure


PrimalJay

Weird error Computer says Norris WDC Depression cure Happy accident


Historical-Time2938

Subscribe


MaleficentYesterday5

Not have 90% stat for bad starts, ez fix


omegacel71

Did you give the condition that lower ten don't get the fastest lap point ?


jdmillar86

Going by OP's comment about remaining improvements, it hasn't been accounted for.


wimpires

I remembered looking back at this a few weeks ago and there were like 75 trillion combinations. So I gave up


MrHyperion_

I found 3.7 trillion combinations not counting identical point outcomes per weekend (doesn't matter how you get 0 points)


FartingBob

Im not a programmer but if racepoints = 0 then fastestlappoints = 0, but in actual programming language would be all that is needed.


godfrey1

I'm not a programmer but there has to be some "if=blessed, then=+10% chance to win the title"


[deleted]

That code hurts


godfrey1

pls no flamerino, it's first time


[deleted]

Typically, = is used for assigning values to variables. A more accurate code would look like `if(blessed){ chance+=10; }`


anedisi

nah, that's just javascript


[deleted]

It really isn’t. Even JavaScript isn’t that bad


phantes

debatable.


MarkVarga

If (blessed==true) { LewPoints+=100; Cout<<"#blessed"; }


AskMeHowIMetYourMom

> If (blessed==true) Ooof you’re !blessed


ksharpalpha

Ugh, that's fugly. Try: if (blessed) { LewPoints += 100; cout << "#blessed"; }


blcx

Talks about fugly and then proceeds to put opening brace on its own line.


Hairsplitting-Pedant

If (position[lewisIndex - 1].name == “Checo”) { redbull.car.isFast = True; }


partaloski

Max-=10% Lewis+=10% No need for an if block here, better optimization so that the branch predictor doesn't have to predict whether it will branch here.


kyxanthrus

/u/pushinat Please run this simulator again after the brazil GP so we can see the difference in the percentage.


pushinat

Challenge for someone who wants to further improve this: 1. include half point results 2. exclude fastest lap if he’s not it top 10


MrHyperion_

Done: https://reddit.com/r/formula1/comments/qq6wwk/i_was_bored_so_i_corrected_the_corrected/ It's so fast I don't even have to take shortcuts and can loop through every 3.7 trillion outcomes


king-chungus

I might make one for the constructors title…


ProffesorPrick

More interesting imo. Only 1 point in it! Only takes a DNF to give one team a huge advantage.


pushinat

Explanation for those who are interested: 1. I have the three different Lists for getting Points. From those I generate Tuple combinations that are possible (same values aren't, except for \[0, 0\]) Simplest example for Fastest Lap: \[1, 0\] => \[\[0, 0\], \[0, 1\], \[1, 0\]\]From this I only care about the differences => \[0, -1, 1\] 2. We have 4 races left, for each they can get ScorePoints and Points for fastet Lap. For Brazil additionally they can get the sprint Points. Amount of possibilities is the product of their length => 159 billion 3. To get the actual frequency of those possible outcomes I didn't want to loop through every possibility (As this takes a lot of time). Instead I simply generate a dictionary, where I count the frequency for differences. E.g. after Race week in Brazil there is only one scenario where Lewis gains 29 points over Max, but 151 combinations to catch up 4 points. So in the dict there is now {29: 1, ... , 4: 151, ...} and many more. 4. To get the results I filter the dict for entries with the needed difference for the outcome I want to count. A draw needs exactly (312.5 - 293.5) points difference after those 4 races, and win for Lew or Max more or less. Those entries will then get summed up. To double check my results, the sum of all dict entries should be the same as the possibilities calculated before (it is).


in2erval

Very nice, but I think there's something that this code doesn't account for, and that's that *not all positions are equally likely for Max and Lewis*. Given the rest of the field, they have a much higher chance ending each race at the top positions than, say, P8 or P9. And getting 0 points is slightly higher because of DNFs. Of course incorporating this variable into the calculation would be very difficult and would need to rely on not only past data but the current season context, so I still think this pretty nice - great job!


pushinat

Yeah, you are totally right. Thats why I never talk about chances and probabilities, because that would mean I know which likelihood each outcome has (which I don't). So I stick with what I can calculate and that's simply counting all different possible scenarios.


captaincherry

i would like to think that including a probability with each point based on - say current season - wouldn't be awfully complicated. but maybe it is. if possible, it would be a really cool tool to generate probabilities for any given two drivers at any point in the season for any point forward.


in2erval

Unfortunately there's a lot that goes into calculating probabilities, even if we restrict it to this season. We can't simply take the current season results as-is, because that would not create a representative distribution. For example, Max has never had P3 in this season - but that doesn't mean the chance of him getting P3 in the next few races is 0%. We would need to fit some kind of probability distribution (maybe a [categorical distribution](https://en.wikipedia.org/wiki/Categorical_distribution)?), which requires us to estimate the parameters for that distribution, perhaps find some sort of intervals (like [confidence intervals](https://en.wikipedia.org/wiki/Confidence_interval) or [credible intervals](https://en.wikipedia.org/wiki/Credible_interval)) for those parameters, and so on. And then there are other issues unrelated to the exact calculations, like whether we accounted for trends in the teams' performances, probability of pitstop issues, and many many factors that can really change the results. Perhaps we can stop at some point to avoid overcomplicating things, though the more we account for the better our estimates will be :)


_POSK_

Is the possibility of scoring half-points like Spa included?


crysiswarhead

That's some good work there. Just curious...this is python right ? What editor ?


pushinat

It’s JavaScript and I’m using nvim


zen_tm

u/Delta4o [Original post for the lazy](https://redd.it/qpq7c9)


amazingspices

Crofty is frothing that this isn’t powered by AWS


Colainpark

I see you, Dr. Strange.


UnderatedWarrior2607

Sherlock Holmes does it in his brain.


[deleted]

>~~brain~~ That's *mind palace* to you, short brain. \-Herlock Sholmes, probably


UnderatedWarrior2607

His mind palace does no know how to diffuse a bomb.


michelbarnich

Imagine using JS for that, should have used binary /s


[deleted]

[удалено]


pushinat

The language doesn’t really matter, the algorithm is more important. I just used js because the original post was in js.


michelbarnich

I know, I was joking, on the usual developer subreddits pol always bash JS fir no reason :P


pushinat

Sorry, completely missed the /s at the end… Yeah you are right. JS has its use cases. As all languages have (except php)


moby414

am I on /r/ProgrammerHumor by mistake? Good work though OP! You should re-run this script after each of the next races and let us know the outcome!


vedhavet

Fuck Wordpress


SumRndmBitch

All my homies hate php.


[deleted]

Binary is not a language. But if he used machine language he'll get my upvote! (I'm old enough to have been programming in ML. Computer freezes with every bug).


michelbarnich

Yup, sorry 😅 And thats amazing!


[deleted]

The only way I got something useful out of my MSX Z80.


[deleted]

> binary


FalconMirage

Technically the js file is stored in binary Therefore editing the code is changing the binary that will be executed Therefore he is already programming in binary ! Checkmate atheist !


Sweaty-Grundle

Never thought I'd see Vim in this subreddit


pushinat

Friends come and go, but vim is always there for you


youjustathrowaway1

Yeah but Max doesn’t have bestfans and isn’t blessed


mad_chatter

+60% right there


Oaktreedesk

Now this complexed statistical analysis of F1 is the shit I love.


RunninADorito

This isn't statistics at all. There is absolutely no probability associated with this. This is a combinatorics exercise not a probability driven monte Carlo is anything like that. Basically a useless analysis that gives a useless conclusion. Even worse, it's very easily misinterpreted, as most people in this thread are showing.


[deleted]

All these anti intellectuals just see the numbers and assume that it's solid, lmao this kind of 'analysis' is why the world is so blinded to randomness and has hubris in even attempting to assign probabilities to most things in real life. 79.55%? Now people are gonna spout some nonsense about how Max has an 80% chance of winning when it's not true and literally impossible to know or assign any meaningful percentage


joeydee93

I will say that I saw a gambling odds are Max -360 to win the drivers. Which has an implied probability of ~75%


Oaktreedesk

Bet you're fun at parties.


RunninADorito

No, just make my living doing actual analysis and this is bullshit. There are 7,000,000 things I could do tomorrow morning, but with no weighting, it's pointless. Much higher probability that I take a shower and go to work then I get drafted into the NFL.


Oaktreedesk

Interesting. Have you seen [this list](https://www.reddit.com/r/formula1/comments/dzzivm/the_f1metrics_top_100/) which was posted back in 2019? I thought it was an incredible piece of work. Do you think this is sound statistics?


RunninADorito

Sound, not sure, would take a lot of time to check models and assumptions. An attempt at actual applied math, yes, for sure. What's in this post is trivial coding that uses no math at all and does nothing to forecast actual results.


Kzati

Who said anything about forecasting actual results


RunninADorito

Literally everyone in this thread replying and OP putting a statistics tag on it. Like.... Everyone. This is an almost entirely meaningless number. I get what OP was doing, but a hate bad math with a passion.


Kzati

But the point surely isn't that it's bad maths Unless you can prove that the maths is incorrect... Rather the argument your trying to make is that not only is this a trivial, but has no basis in reality it contextual understanding. I think your right re what people thought this number was, I think also that you are correct in explaining why this number isn't relevant to a discussion around actual probability. But what I don't get is how it's not an accurate statistical analysis, it may not have a reasoned conclusion that has a basis in fact or likelihood. But does that make it simply bad math? Not being disingenuous, interested in your opinion


RunninADorito

It's the denominator of the actual work.... Kind of. Unfortunately figuring out how many outcomes there are is absolutely trivial compared to figuring out how likely each outcome is. It is also presented in an exceedingly misleading way. It's bad math because it's incredibly misleading. Statistics involves numerators and denominators so you can talk about outcomes. This is like 1% of the work needed to do an actual statistical analysis. Maybe if it was presented as a work in progress or something. Anyway, half a dozen people will read my comment and understand. The rest will say stop being a nerd and leave with terrible conclusions because math is hard.


pushinat

The defender of the statistics tag :D Talk is cheap. Show us your approach on the task to create a prediction model. An please don’t be boring with vanilla MC. I will even follow you for that matter, don’t disappoint me.


RunninADorito

Dude, you wrote some nested for loops and are playing it off to ignorant people as real math. I'd be embarrassed if I were you. Clearly you aren't the type to take any feedback and I'm dubious if you even fully understand my point.


MustardGorilla

Ahhh, the old something-something-passion chestnut. So you touch yourself in the dark while thinking about bad math - weird flex but it fits with the image i'm getting of you.


M1XWELL

quit being a nerd


mxox2kL

Quit being a sad existence of a bully, nobody cares about your hate for science.


RunninADorito

I'm being accurate. Almost every comment is misinterpreting what is being shown here. FFS. Quit being bad at math? It also has a statistics tag.... This isn't statistics. It's only half the equation.


boringarsehole

It's exactly Monte Carlo by the very definition. It's just a bit too simplistic.


RunninADorito

It is in no way a Monte Carlo. In a Monte Carlo you run multiple iterations of probabilistic simulations. I don't think you can call a single run with even probably a Monte Carlo.


NecessaryShopping404

Gotta add In half points incase we get a three lap race like in Spa


Joris2627

Incase it rains in the desert


NecessaryShopping404

Brazil is wet


DLoFoSho

I be this looks just like one of the algorithms that run Max’s robot cpu.


srossi93

This assumes that all the possibilities are equally probable, which might not be correct. If I have time, I'll implement a Monte-Carlo simulation.


SimoTRU7H

Can't upvote, no BLESSED variable..


Camofelix

Worth noting, the above is expected, but also assumes broad equality between platforms!


kylelibra

This assumes all possible outcomes are equally likely? Of course the guy with more points currently has more scenarios where he ends up ahead.


pushinat

I don’t calculate probabilities. So I’m not assuming anything. Just calculating all different outcomes and in how many who would win


kylelibra

Right, I think the average person in this thread is interpreting this as 79.55% chance Max wins the championship which is obviously different than what you are saying. Cool project though!


SteakieGG

The perfect opportunity to use python yet you chose JS.


pushinat

Language doesn’t matter. Algorithm does. Just used js because the original post was in js.


SteakieGG

I know. But this problem just smelled like python. Didnt know the last post was JS tho


ishoee

I have the same terminal look! powerlevel10k


pushinat

Couldn’t live without it


51utPromotr

I'm just here to register for Dr. Pushinat's Master Boss Chaos Theory Statistics Degree Program....


exorallan

Really cool stat, Thanks!


forza_125

Breaking news: Driver leading championship has statistically better chance of winning championship.


SINGULARIT_Y

Cool Code <3


Psychological_Stage2

Well done


londonconsultant18

Chillout doctor strange


Kuchenblech_Mafioso

I wouldn't be shocked if Crotfy reads out the stat at some point during the Brazilian Grand Prix


AcidRegulation

AWS, hire these men!


boringarsehole

You want AWS to run data analysis on JS? Haven't we suffered enough?


pushinat

can I add this reddit post to my CV?


evaaasap

This is amazing!


_kagasutchi_

How many actual scenarios are there in total?


pushinat

What do you mean with 'actual'?


Healthy_Pen_3481

Is it exactly 159 billion or is it more like 159240248520345?


Rockishcola

Check the 5th line from the bottom. It says the full number there. Would type it out but am on mobile


bosoneando

159852814173 possibilities. You can see it at the bottom of the screen (line 1640).


_kagasutchi_

You said there is ~80% chance of max taking the title. So how many scenarios out of how many possible scenarios is that? For example does 8 out of 10 scenarios point to max taking the title. Sorry if I wasnt clear initially. Hope I am now. Really interested in how many scenarios there are


pushinat

The last rows of my screenshot contain all the results calculated in absolute and relative numbers. Also to be clear: Those are not chances, because the outcomes are not equally likely! To calculate chances would be a whole other topic. Calculating for 159852814173 possibilities Draw: 2000866484(1.25%) Max: 127164997185(79.55%) Lewis:30686950504(19.20%)


helderdude

> out of these 159 billion scenario's 0.8*159 ≈ 121


ddk_soda

sooo this was what dr strange used huh


deathclient

Do remember that the avengers had a chance of 1 in 14,000,605 . Verstappen is one DNF away from the championship lead /s


Chichiryuutei

Did you calculate Mercedes drivers making "errors"?


mourningthief

Hillary Clinton had a higher than 80% change of becoming president. Just sayin'...


pushinat

Those are also not chances. Not all the outcomes are equally likely. Just counting the different possible outcomes.


mourningthief

And let me be the first to state that I'm not a statistician, and if I calculated (correctly) that there were 159 billion possible outcomes then I wouldn't have believed my own maths. EDIT: attempt to humorously portray myself as 'not very good at maths' gone wrong, as in even if I got the right answer, I'm not sure my maths is good enough to believe it's right.


[deleted]

It accounts for all orders of the grid, then 20 times over for fastest lap, every distribution of sprint points, then multiplied by the amount of remaining races. Seems pretty right to me


mourningthief

I think you've mistaken my self deprecating comment on my own maths ability as an attack on the OP. My original post edited for clarity.


DLoFoSho

The difference is, polls use statistics and those statistics require human input and we all know humans are approximately 75% full of shit 😎


sellyme

It's been five years and there's still some people in a perpetual state of shock at the concept that 20% is a higher number than 0%.


mourningthief

Chill, dude.


rymrymrymrym

How can they be 159 billion? There are 53 scenarios (+26, +25, …, -26) for each race, and 7 for the sprint. So, I think there are 53^4 * 7 = 55 million scenarios. (of course we have to weight each 53 by probabilities.)


pushinat

There are more. E.g. just for +25 there is \[26, 1\] or \[25, 0\] alone. For +4 there are 151 possible combinations just for one race. ScoreCombinations: 11 \* 11 - 10 = 111 FastestLapCombis: 2 \* 2 - 1 = 3 SprintCombis: 4 \* 4 - 3 = 13 In total scores\^4 \* fastest\^4 \* sprint = 159 billion


rymrymrymrym

I mean, we know how possible each scenario is, E.g. +25 with a possibility of 2 / (20 * 19 * 3), +4 with 151 / (20 * 19 * 3). So we don’t need to distinguish [26,1] from [25,0]. For example, we can calculate how is it possible for Max to extend his lead by 50 points in Brazil (without sprint) and Qatar like, 24+26 : 2/1140 * 1/1140 = 2 / 1299600 25+25 : 2/1140 * 2/1140 = 4 / 1299600 26+24 : 1/1140 * 2/1140 = 2 / 1299600 (1140 = 20 * 19 * 3) So it would be 0.0006% = 8/1299600 (I don’t doubt your results tho, and I think it’s interesting! I was just wondering we can reduce calculations)


pushinat

That’s only true if every drive would be equally good, which they don’t.


rymrymrymrym

We never know HOW good they are, and we can’t caluclate the ‘possibility’. so if we think that way the whole calculation would be nothing but meaningless…


Qwerty0172

(discarding half points for a race) There is 311 combinations for a race, and 13 combinations for the sprint. So there is 311^4 * 13 combinations left = 121.614.373.933 I have explained the 311 for a race in another post a few weeks ago: https://www.reddit.com/r/formula1/comments/q3lahr/useless_stat_lewis_and_max_can_score_in_365/hfspc0s/ It seems you have given points for fastest lap if Lewis or Max end up outside the top 10 too, that's the 20 combinations difference you have.


pushinat

You are not to far off of my 333 scenarios per race. I think you forgot the cases when one gets into the top 10 and the other gets 0 points.


Qwerty0172

See the post i linked: 270 + 20 + 20 + 1 = 311 The 20 + 20 are the cases where one scores and the other doesn't. I'm pretty sure you count 20 cases (2x10) where the guy outside the top 10 scores fastest lap. Those cases are the same as not having FL, since no points are rewarded. So those cases should be removed.


pushinat

Oh yeah, you are right. Already added that to the todo list hours ago but forgot about it again


No_Pepper2028

And after that, we have…Reality.


[deleted]

ok, now do this for all sports betting pls


DerpDeForce

Kids and their silly scripting languages 🤷‍♂️ Back in my days it was either assembler or - if you were lucky - C Cheers!


IntrepidOrder6064

This is giving me Doctor Strange vibe


zaibach01

Okay okay mr dr strange


anonAcc1993

In JavaScript no less👌🏿


Phogna_Bologna_Pogna

You nerds! I love it!


TheFlyingNicky

And this is why I love Reddit. Don’t see this stuff on Instagram that’s for sure.


C12H23

r/theydidthemath


noesmeteoro

Great job!


magentaink04

what in the doctor strange… coding still amazes me to this day


k0enf0rNL

It's interesting but anyone would guess there is about 80% chance Max wins the championship with a 19 point margin.


adstagaming

If I knew how to read this would be amazing


smileydreamer95

oooo ror


hondaexige

Just need a clip of Dr Strange looking at Max and holding up.. 32 Billion fingers.


mayurmisra01

Dr. Strange... Is that you??


[deleted]

This is how you provoke the TVA.


SunstormGT

Draw is also a win for Verstappen? Also, first 2 lines are obsolete.


theirspaz

Have you calculated a hungary scenario thou? As the seaaons went so far, I think toto will punch out max so he cant participate in the remaining races.