Fun With Probability

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

University of Massachusetts Lowell Electrical and Computer Engineering 25.10 !ntroduction to Engineering !!

"#un$ %ith &ro'a'ility Have you ever been to the Science Museum and seen an experiment with a bunch of balls which when the fall tend to look like a bell curve? This is an example of an effect which occurs throughput nature called the Central Limit Theorem which says that any outcome formed by summing a large number of random occurrences will have the bell curve !ust like you see at the science museum" &art (. Step #" Create an array of #$$ $$$ samples of a uniform random variable on the interval %$ #&"'se the (rand) function" Step *" Create a histogram of the samples with #$$ bins" +otice for the most part that there are approximately #$$$ points in each bin which is what you would expect" a" 'sing your array find out how many points are ,$"- and divide by the total which is #$$$$$" .hat would you expect before doing it and what result did you get b" Try the same thing for number of points ,$"*-" /nd compare with what you would expect c" Take your array and subtract $"- from each number and do the histogram again note that the numbers are centered on $ rather than $"-" 0art 1" Create an array 2$ #$$$$$ of uniform random numbers on the interval $ #" 'se the command %rand%2$ #$$$$$&" Make the numbers go between 3$"- and "- by subtracting $"from each value" 4lip coins by using the command rightleft5My/rray,$ See how many are heads and tails by doing sum%rightleft&" Create an 63axis from x5$7#72$ 0lot a histogram of the number of heads which occurred hist%yoursum x& +ote it looks !ust like what you see at the science museum 0art C" Take #$$$$$ samples of a 8aussian random variable %randn%#$$$$$ #&9 4ind how many points lie between 3# and # %hint the answer should be about *:2& which is the probability of being within # standard deviation of the mean"

You might also like