You are on page 1of 21

# Lab 5: Probability density and cumulative distributions

1 Introduction
The purpose of this lab is to become familiar with the concepts of • probability density, • cumulative distribution, • mean, and • median. In particular, we will be studying the empirical data from some Bernoulli trials, which should ﬁt a binomial distribution. We will plot the probability density and cumulative distribution as bar graphs, and then compute the mean and median from these bar graphs. The mean x ¯ of a random variable whose possible values xi have probabilities p(xi ) is deﬁned by x ¯= xi p(xi ). The median m of an (unordered) list of numbers is the middle number after ordering. For instance, if the ordered list is 1, 2, 2, 2, 3, 3, 4 then the middle number (median) is 2. Thus, the median of the related random variable is the ﬁrst x for which the cumulative distribution function exceeds (or is equal to) 0.5. Convince yourself that this is so! (In cases of an even number of data points the convention is to use the average of the middle two, but this does not occur in this lab.) [
i

Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5

Previous Page Next Page Exit
]

2 Problems 2.1 Problem Set 1
Given below is the distribution of number of heads obtained by a group of people in an experiment in which each person tossed a fair coin ten times. Let: x = number of heads obtained out of ten tosses. N (x)=number of people who got x heads. • Use the above data to plot a bar graph of p(x), i.e., the empirical probability distribution of obtaining x heads in 10 tosses. Center the bars at the integers. (See note at the bottom for plotting.) • Plot the cumulative distribution (of obtaining up to x heads) for the empirical data. Technically this should be a step function, but step functions are diﬃcult to display using Mathsheet, so we suggest using a bar graph. • Use the spreadsheet to calculate the expected number of heads based on the same empirical data. • Find the median number of heads of the empirical data. • Finally, plot a bar graph of the theoretical probability distribution in the same way. • Submit a graph of these three bar graphs and write the values you found for the mean and the median of the empirical data on the bottom of the page. Also, please explain how you computed the median.

Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5

Previous Page Next Page Exit
[ ]

the theoretical probability distribution can be plotted over everything. but with the ﬁll setting oﬀ so that the other graphs show through. Finally. Previous Page Next Page Exit [ ] . One possible solution is to plot the cumulative distribution ﬁrst (ﬁlled) with the empirical probability distribution ﬁlled on top.x 0 1 2 3 4 5 6 7 8 9 10 N (x) 0 1 8 11 20 36 25 13 8 2 0 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Table 1 Problem Set 1: Of 124 people N (x) tossed x heads Note: It is somewhat tricky to display all three of these bar graphs without having them cover eachother.

2. Here’s how the data could be organized: Column 1 contains the number x of heads from 1 to 10.8 0. The median number of heads is 5.1.5) and the expected number of heads (also called mean number of heads) is calculated by the spreadsheet as x ¯ = 5. Column 2 contains the number of people who got x heads.1 Solution to Problem Set 1 1 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 0.5 0. (ﬁrst x for which the cumulative distribution function exceeds 0.6 0.4 0.1. Column 3 contains the theoretically expected number of people who got x heads. Column 4 totals [ Previous Page Next Page Exit ] .2 2 4 5 6 8 10 Figure 1 Solution for problem set 1.

1. From this graph.up the size of the group of people. Column 7 computes xp(x) and column 8 then sums these up to get the mean value of x for the probability density. This is the probability p(x) of getting x heads. we can read oﬀ the median value. This is at m = 5. Figure 1 then shows the graphs of p(x) and F (x) and the theoretical value on the same graph. The numbers in (x) column 5 are then the fraction N 124 of the group that got a given number of heads. Column 6 computes the cumulative function F (x). We see that the mean value is x ¯ = 5.5 for the ﬁrst time. (There were 124 people in all). Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . We locate the x at which the cumulative distribution function (blue curve) exceeds the value 0.

2 Problem Set 2 Given below is the distribution of number of heads obtained by a group of people in an experiment in which each person tossed a fair coin ten times.2. Let: x = number of heads obtained out of ten tosses. x 0 1 2 3 4 5 6 7 8 9 10 N (x) 0 1 3 13 16 14 20 9 5 1 0 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] Table 2 Problem Set 2: Of 82 people N (x) tossed x heads . N (x)=number of people who got x heads.

but step functions are diﬃcult to display using Mathsheet. One possible solution is to plot the cumulative distribution ﬁrst (ﬁlled) with the empirical probability distribution ﬁlled on top. the theoretical probability distribution can be plotted over everything.) • Plot the cumulative distribution (of obtaining up to x heads) for the empirical data. • Submit a graph of these three bar graphs and write the values you found for the mean and the median of the empirical data on the bottom of the page. • Use the spreadsheet to calculate the expected number of heads based on the same empirical data. but with the ﬁll setting oﬀ so that the other graphs show through. so we suggest using a bar graph. (See note at the bottom for plotting. please explain how you computed the median.. Technically this should be a step function.• Use the above data to plot a bar graph of p(x). i. Note: It is somewhat tricky to display all three of these bar graphs without having them cover eachother. • Find the median number of heads of the empirical data. Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . Finally. • Finally.e. the empirical probability distribution of obtaining x heads in 10 tosses. plot a bar graph of the theoretical probability distribution in the same way. Center the bars at the integers. Also.

Column 3 contains the theoretically expected number of people who got x heads.2 2 4 5 6 8 10 Figure 2 Solution for problem set 2.5) and the expected number of heads (also called mean number of heads) is calculated by the spreadsheet as x ¯ = 5. The median number of heads is 5.2. Here’s how the data could be organized: Column 1 contains the number x of heads from 1 to 10.4 0.8 0.2.1 Solution to Problem Set 2 1 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 0.6 0. (ﬁrst x for which the cumulative distribution function exceeds 0.02.5 0. Column 2 contains the number of people who got x heads. Column 4 [ Previous Page Next Page Exit ] .

From this graph. Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . Figure 2 then shows the graphs of p(x) and F (x) and the theoretical value on the same graph.totals up the size of the group of people. Column 7 computes xp(x) and column 8 then sums these up to get the mean value of x for the probability density. (There were 82 people in all).02. We locate the x at which the cumulative distribution function (blue curve) exceeds the value 0. we can read oﬀ the median value. Column 6 computes the cumulative function F (x).5 for the ﬁrst time. We see that the mean value is x ¯ = 5. The numbers (x) of the group that got a given number of heads. in column 5 are then the fraction N82 This is the probability p(x) of getting x heads. This is at m = 5.

x 0 1 2 3 4 5 6 7 8 9 10 N (x) 0 1 9 17 25 37 20 14 6 1 0 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] Table 3 Problem Set 3: Of 130 people N (x) tossed x heads .3 Problem Set 3 Given below is the distribution of number of heads obtained by a group of people in an experiment in which each person tossed a fair coin ten times.2. Let: x = number of heads obtained out of ten tosses. N (x)=number of people who got x heads.

Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . please explain how you computed the median. • Submit a graph of these three bar graphs and write the values you found for the mean and the median of the empirical data on the bottom of the page. Center the bars at the integers. (See note at the bottom for plotting. Technically this should be a step function. • Find the median number of heads of the empirical data. Finally. Also.. • Finally. Note: It is somewhat tricky to display all three of these bar graphs without having them cover eachother. so we suggest using a bar graph. the empirical probability distribution of obtaining x heads in 10 tosses. but step functions are diﬃcult to display using Mathsheet.e. plot a bar graph of the theoretical probability distribution in the same way. but with the ﬁll setting oﬀ so that the other graphs show through.) • Plot the cumulative distribution (of obtaining up to x heads) for the empirical data. i. One possible solution is to plot the cumulative distribution ﬁrst (ﬁlled) with the empirical probability distribution ﬁlled on top. • Use the spreadsheet to calculate the expected number of heads based on the same empirical data. the theoretical probability distribution can be plotted over everything.• Use the above data to plot a bar graph of p(x).

2. Here’s how the data could be organized: Column 1 contains the number x of heads from 1 to 10.5 0.1 Solution to Problem Set 3 1 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 0. Column 4 totals [ Previous Page Next Page Exit ] .3.6 0. Column 2 contains the number of people who got x heads. Column 3 contains the theoretically expected number of people who got x heads.2 2 4 5 6 8 10 Figure 3 Solution for problem set 3. (ﬁrst x for which the cumulative distribution function exceeds 0.8 0.4 0. The median number of heads is 5.85.5) and the expected number of heads (also called mean number of heads) is calculated by the spreadsheet as x ¯ = 4.

Figure 3 then shows the graphs of p(x) and F (x) and the theoretical value on the same graph. Column 7 computes xp(x) and column 8 then sums these up to get the mean value of x for the probability density. We locate the x at which the cumulative distribution function (blue curve) exceeds the value 0.up the size of the group of people. We see that the mean value is x ¯ = 4.5 for the ﬁrst time. (There were 130 people in all). This is at m = 5. From this graph. we can read oﬀ the median value.85. The numbers in (x) column 5 are then the fraction N 130 of the group that got a given number of heads. This is the probability p(x) of getting x heads. Column 6 computes the cumulative function F (x). Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] .

4 Problem Set 4 Given below is the distribution of number of heads obtained by a group of people in an experiment in which each person tossed a fair coin ten times.2. Let: x = number of heads obtained out of ten tosses. N (x)=number of people who got x heads. x 0 1 2 3 4 5 6 7 8 9 10 N (x) 0 0 1 8 35 17 20 14 3 1 0 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] Table 4 Problem Set 4: Of 99 people N (x) tossed x heads .

Finally. so we suggest using a bar graph. Center the bars at the integers.• Use the above data to plot a bar graph of p(x). Note: It is somewhat tricky to display all three of these bar graphs without having them cover eachother. plot a bar graph of the theoretical probability distribution in the same way. • Submit a graph of these three bar graphs and write the values you found for the mean and the median of the empirical data on the bottom of the page. Also. One possible solution is to plot the cumulative distribution ﬁrst (ﬁlled) with the empirical probability distribution ﬁlled on top.) • Plot the cumulative distribution (of obtaining up to x heads) for the empirical data. • Finally. but step functions are diﬃcult to display using Mathsheet. the theoretical probability distribution can be plotted over everything. Technically this should be a step function.. the empirical probability distribution of obtaining x heads in 10 tosses. please explain how you computed the median. i.e. Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . but with the ﬁll setting oﬀ so that the other graphs show through. • Use the spreadsheet to calculate the expected number of heads based on the same empirical data. • Find the median number of heads of the empirical data. (See note at the bottom for plotting.

6 0.4 0. The median number of heads is 5.4.5 0.2. Here’s how the data could be organized: Column 1 contains the number x of heads from 1 to 10.07. Column 4 [ Previous Page Next Page Exit ] . Column 2 contains the number of people who got x heads.1 Solution to Problem Set 4 1 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 0. Column 3 contains the theoretically expected number of people who got x heads.5) and the expected number of heads (also called mean number of heads) is calculated by the spreadsheet as x ¯ = 5.8 0.2 2 4 5 6 8 10 Figure 4 Solution for problem set 4. (ﬁrst x for which the cumulative distribution function exceeds 0.

Figure 4 then shows the graphs of p(x) and F (x) and the theoretical value on the same graph. (There were 99 people in all). Column 6 computes the cumulative function F (x). From this graph. Column 7 computes xp(x) and column 8 then sums these up to get the mean value of x for the probability density. in column 5 are then the fraction N99 This is the probability p(x) of getting x heads. This is at m = 5. we can read oﬀ the median value. The numbers (x) of the group that got a given number of heads.totals up the size of the group of people. We see that the mean value is x ¯ = 5.5 for the ﬁrst time. Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . We locate the x at which the cumulative distribution function (blue curve) exceeds the value 0.07.

2. Let: x = number of heads obtained out of ten tosses.5 Problem Set 5 Given below is the distribution of number of heads obtained by a group of people in an experiment in which each person tossed a fair coin ten times. x 0 1 2 3 4 5 6 7 8 9 10 N (x) 0 2 1 17 15 31 28 10 2 1 0 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] Table 5 Problem Set 5: Of 107 people N (x) tossed x heads . N (x)=number of people who got x heads.

i. plot a bar graph of the theoretical probability distribution in the same way.) • Plot the cumulative distribution (of obtaining up to x heads) for the empirical data. Also. but step functions are diﬃcult to display using Mathsheet.. (See note at the bottom for plotting. so we suggest using a bar graph. Center the bars at the integers. please explain how you computed the median.• Use the above data to plot a bar graph of p(x). Technically this should be a step function. • Use the spreadsheet to calculate the expected number of heads based on the same empirical data. the empirical probability distribution of obtaining x heads in 10 tosses. but with the ﬁll setting oﬀ so that the other graphs show through. • Find the median number of heads of the empirical data. • Submit a graph of these three bar graphs and write the values you found for the mean and the median of the empirical data on the bottom of the page. Note: It is somewhat tricky to display all three of these bar graphs without having them cover eachother. Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] .e. • Finally. Finally. One possible solution is to plot the cumulative distribution ﬁrst (ﬁlled) with the empirical probability distribution ﬁlled on top. the theoretical probability distribution can be plotted over everything.

8 0.2 2 4 5 6 8 10 Figure 5 Solution for problem set 5. Column 3 contains the theoretically expected number of people who got x heads.5) and the expected number of heads (also called mean number of heads) is calculated by the spreadsheet as x ¯ = 4. The median number of heads is 5.1 Solution to Problem Set 5 1 Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 0. (ﬁrst x for which the cumulative distribution function exceeds 0.5 0. Column 2 contains the number of people who got x heads.98.5. Here’s how the data could be organized: Column 1 contains the number x of heads from 1 to 10.4 0. Column 4 totals [ Previous Page Next Page Exit ] .2.6 0.

From this graph.up the size of the group of people. Column 7 computes xp(x) and column 8 then sums these up to get the mean value of x for the probability density. We see that the mean value is x ¯ = 4.98. Figure 5 then shows the graphs of p(x) and F (x) and the theoretical value on the same graph.5 for the ﬁrst time. The numbers in (x) column 5 are then the fraction N 107 of the group that got a given number of heads. Introduction Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Previous Page Next Page Exit [ ] . we can read oﬀ the median value. (There were 107 people in all). This is at m = 5. We locate the x at which the cumulative distribution function (blue curve) exceeds the value 0. This is the probability p(x) of getting x heads. Column 6 computes the cumulative function F (x).