the simulation in question:
for (int i = 0; i < 80000; i++) { if (rand() % 2 == 0) { printf("Kamala wins\n"); } else { printf("Trump wins\n"); } }
This is much cleaner than mine that I did in python.
thanks. Nate Silver paid me $50k to write this
could you please input that into chatgpt so it will give me a summary of the code output? I’m a busy data driven guy so I don’t have time for the details. however, I do have time for this post
Hey! I understood that! That Python class must’ve taught me something after all.
huh, the sync for Lemmy code block renderer doesn’t show the \ even within the code block 👁️👁️
Seems lots of unnecessary mods tbh,
S=0
for i in 1:80000
S+=rand()
end
ceil(S)
Modding by 2 is just a bitwise operation tho
Gotta dump results in some accumulate tho, and if then logic might be eh (although with branch prediction it might be auto 2 threads actually or similar utilization at least)
A reasonable compiler could optimize this into a bitwise AND, load the pointer to the appropriate string constant into a register branchlessly using a lookup table or cmov instruction, and then execute a single call to printf.
I mean if I want to know the precise number, like 40012 or whatever. Obviously single call is fast, but printf of 40000 strings single strings is meh. I mean in my variant I don’t run comparison, even bitwise, just 80000 rand and sum, single ceil and print
I’m guessing it literally is a few lines in R, plugging in the polling data after running it through a “model” (i.e. tinkering with the variables based on how polls have historically translated into votes)
won in 42,069
how the fuck does a “simulation” like this even work? so insane
Take polling data then randomly roll for some error within the margin of error for each state. Then adjust based on bias. Do this n times and get your prediction.
Is there a point to this? From the tweet it doesn’t give new information. It just reaffirms that three contest will be close which everyone knew.
They didn’t get a certain answer so it was useless this time, but if it had turned out that somehow one candidate won a supermajority of simulations then you got useful information. Can’t know unless you ask.
There is utility in some cases; there’s correlations between polling and areas, and the electoral college makes it all complicated (by design)
But, like, here? No, no practical difference between any of the ‘models’ all showing some variation of ‘its a toss up’
Yes, it’s possible that despite close in polls, the margin of error would favour one candidate being more likely to win.
“Everyone knows” something until there’s evidence to the contrary.
The polls and outcome could still be wrong if something unexpected happens, like if all the people who don’t usually vote decide this is the most important election and vote for the first and only time in their life.
stochastic modeling is the key word for this type of modeling if you actually care. that kind of thing is used for all kinds of stuff - weather, climate, ecology, river flows, economics
deleted by creator
This is more like slamming rocks together 300 times and getting sparks 150 times
deleted by creator
“We flipped a coin 80,000 times and it landed on Heads 40,012 times”
I ran 80,000 simulations of me taking a poop
In 40,000 of them, shit ran down my ballsack and then I had shit on my balls.
In 32 of them, I sneezed in the middle of a stream of diarrhea and covered the entire backside of the toilet.
homie’s monte carlo analysis probably took like 9 seconds to run
Based on my coworker’s workflow, the simulations took up all computing resources they had all day, and the confidence interval was like 0.1% tighter.
For anyone curious, this means Harris won 50.015% of the time
Truly an earth-shattering margin
I flippee a coin and it landed on heads 40,012 times, here’s how Harris can still win
We’re living in a Nate Silver simulation right now. :morpheus:
You best start believin in Nate silver simulations Tankie, you’re in one!
this is nothing
big “i do numbers” energy
40,000 the year?
We surveyed the Adeptus Astra Telepathica and every seer came back with the same answer: landslide victory for the Emperor of Mankind!
Praise be the God Emperor!
Of course you have to vote for the God Emperor! Sure he’s genociding everyone who isn’t human (and quite a few people that are but shush) but if you don’t vote for him then Horus will win! And Horus is going to be so much worse, he’ll implement project 025.M42 and abolish the planetary governors! The God Emperor can win if you vote for him!
(I may have mixed my 40k and 30k for the bit, shhh)
god i hope there is a dead tie in delegates