This is a gambling simulator run on an Excel spreadsheet. You start with a bankroll of $500 in bet one dollar at a time and each time I press the F9 key, the simulator generates 400 coin flips and the graph shows you what happens to your money. If I press this a few times, you’ll see that generally you end up somewhere close to what you started with. The red line shows the results of gambling with roulette, and the blue line shows the results gambling with a fair coin flip game. I’ll show you how to set this up, starting with a blank spreadsheet. I’ll start by putting some labels Here, this will be the random data column This will be the bankroll And this will be the win-lose amount To make the random number you type this:=RND( ) That’s the random number generator. You see there’s a random number there. I can copy this, And it generates a different random number for each instance and each time I press the F9 key or make another an entry anywhere in in the table, it generates a new random sequence. Let’s start with a bankroll of $500. Now this will be the win-lose amount. It’s a function, a logical function. I’ll type=IF( and there you can see the function logical test value of true, value of false, so I’ll say if the value in this cell the random number is less than 0.5, less than one-half, then you win, and that’s a plus one. Otherwise you lose. That’s a negative 1. Okay, so that’s the function. Press Enter. So whenever this number is less than .5 you get 1 one here, and whenever it’s greater than .5. You get a -1, So let’s copy this function over. See that this is greater than 0.5, you get -1. Now how does the bankroll change each time you win or lose? You need to add or subtract, or actually just add this win or lose value whether it’s negative or positive. So for after the first flip it’s the value of the bankroll is equal to the previous Bankroll value, which is right above plus this kitty-corner value over here. I press Enter, so you can see the bankroll went up by one because that was a win Now let’s copy the same function over. Now each time — each time there’s a negative 1, this bankroll goes down by one Each time there’s the positive 1, the bankroll goes up Now I’d like to repeat this not just sixteen or two times but four hundred times, so if I click here to select, Hold down the shift key let’s click here, select this whole … row here. There’s the little green dot. I drag downward until I reach 403 That’ll be four hundred trials. So we started from row 2 to 403 Okay, scroll back up. Now I would like to graph this change in Bankroll, so let me so first select the whole stack from from row 2. I’ll click there to select this one, scroll down to the end Hold down the shift key, press Select and click That is, hold down shift and click Now I can insert a graph of that, so I’ll do insert Charts I see variety of charts. I’ll choose this one here and I’ll go down click the OK button and there’s our chart of 400 coin flip … results. I’ll change the chart title to Bankroll Bankroll I’d like this line to be thinner. Select this line, right click Outline … Weight Here we go … 3/4 Point … 1 point Let me try pressing the F9 key a few times You can see each time I press F9, it generates a new sequence Here you have a long winning streak from $510 to %530 I would like to have a … show this starting line as black I don’t know the simple way to do it, so I’ll do it the hard way. Start from here and I’ll just enter the value=500 Select it. Go the little dot, drag down and make a sequence of 400 of the 500s and I’ll graph that Okay, I’ll right-click this, choose Select Data click Add Series name, I’ll call it 500, and the values will be here from here all the way to the end Shift-Click press Enter here, and There’s the line. I’ll click OK Okay, I’m going to want this brown. I want to be black, so let me get black And I will make it thin Weight 3/4 point. All right, there’s our graph Now when I press F9 it automatically adjusts the scale to fit the data. I’d like to have a fixed scale instead of always adjusting automatically, so I’m going to click here on the left scale And I’ll right-click that and say … Format axis I’d like to go from always from 440 to 560 Okay. Close this and I can press F9 any number of times here and show a different 400 coin flip sequence. Now the way I’ve drawn this … set this up with with these lines and intervals of 20 this this represents one standard deviation for 400 coin flips so that means after you’ve done, this the amount of capital you have at the end has a 2/3 chance of ending up between these two lines, the two closest lines somewhere between 2/3 chance Between the next set of lines, from between here and here, it has a 95% chance or 19 out of 20 times it should end up between these two lines and then these outermost lines should almost always end up between them Let’s see if that’s true. So I’ll just press F9 a bunch of times That’s outside of that inner Zone, so We expect to fall outside that zone about 1/3 of the time, and it’s about right and There there was one That last one went out here outside of the more than 2 lines away that should happen about once every 20 times OK, this is for a fair coin coin flip game. Let’s let’s look at the result for an unfair game like Roulette well the different We’ll do the same kind of thing — bankroll here start with a bankroll of 500 Win Lose, and I’ll enter the formula here:=this random number No, we need the IF function IF left parenthesis logical test this number less than Instead of last time we did 0.5. This time, we’ll put the probability of Say winning of red on a roulette wheel is … there are 18 red There are 18 red slots out of total 38 so the chance of getting red is 18/38 so if A2 … if the random number is less than 18/38 that’s a win Otherwise it will lose. Okay Once again that formula is if the random number is less than 18/38 you win, otherwise you lose Let’s Copy this oh, and then the bankroll of course is equal to your previous bankroll plus the value kitty-corner, the win or lose value here, Enter so now I can pull this down There’s loss. It’s $4.99. There’s another it’s followed by win. I can copy this click here to select hold down shift select this Drag down to 403 Or whatever it was The more I pull down the faster it drags Okay, 403 Okay, now we need to add that that plot, so if I right click on this graph Select Data add another line Series Name, I’ll call it Red and What will it contain? … It will contain all the values in this bank row from here. I click there to select, scroll down to the bottom, hold down shift, click here, select that whole column and there there it is sheet one From F2 to F403, press Enter Click OK Click OK again and There it is. I will change the color to red. I select it right-click change the color to red and change the weight to 3/4 point Okay, there’s our graph, and you can see that I’m going to make this little bigger That’s a little too big. I want to be able to fit it in here OK, now I can press F9 and you can see That playing roulette is worse than a fair game. On the average you lose about 20 bets or so more than in 400 bets. You lose about 20 more than you do with a fair game Okay, well let’s see what happens instead of betting on red, let’s say you bet on a number. Say you’re playing roulette, you bet on number 7. What does that look like? We’ll change this one the Win or Lose we’ll say instead of 18/38 put 1/38, that’s that’s the probability of hitting your lucky number 7 or whatever If you win, it pays 35 to 1, so, I’ll put a 35 here, if it loses you lose 1 press Enter OK, I’ve only changed the formula in this cell. I need to copy that to all the other cells, so I’ll select it This is still got the old formula take the new formula Go to little dot, drag downward to 403 403 Okay This is Much more volatile because when you hit that 35 to 1 you go off … you can go off this the screen This is what we’ve done So let’s change this, the range here on the left side. I’ll select the vertical axis Format axis instead of from 440 … 560 I’m going to go from 0 to 1000 Okay, let me get some interesting results. You got some nice big win here Let’s see what happens if we press F9 a few times Hmm. That’s pretty bad losing streak you lost down from $500 to $300 because of these … a fairly long losing streak On average you get about … you hit this about 10 times you hit your lucky number about 10 times in 400 trials Let’s look at a few more OK In the next video. I’ll do something a little more complicated I’ll I’ll try to do a double up Martingale progression and see what happens when you try to Use a betting system to get ahead.