Expected Value vs Expected Count
Both terms below come up in the same part of the course, and students mix them up. Here is each one defined on its own, side by side, so you can see where they part company.
Expected value
Random variables and distributions
The expected value of a random variable is its long-run average, found by multiplying each value by its probability and adding the products.
The expected value of a random variable is written (E of X) or (mu sub X), and it is the probability-weighted average of the possible values:
Each value is multiplied by its own probability rather than counted once, and that weighting is the whole difference between an expected value and an ordinary average.
Let be the number of cars a household owns, with , , and . Then cars.
That 1.3 carries two lessons. First, an expected value need not be a value the variable can actually take: no household owns 1.3 cars. It describes the average over many households, not a prediction about the next one. Second, it is not the most likely outcome either. Owning 1 car is the most probable single result here, and most likely and average are separate questions. The mode answers the first, the expected value answers the second.
The other frequent slip is dropping the weights entirely. The plain average of 0, 1, 2 and 3 is 1.5, and that would be correct only if all four outcomes were equally likely. They are not. Weight only moves the average through the value it sits on, so the 0.2 parked on 0 contributes nothing at all: . The pull comes from the top of the table, where 3 carries only 0.1 of the weight instead of the 0.25 a flat average assumes, and that is what brings the expected value down to 1.3.
Some distributions come with a shortcut. A binomial variable with trials and success probability has directly, so 10 free throws shot at give an expected 3 makes without summing eleven separate terms. The law of large numbers is what makes any of this useful in practice: as the number of repetitions grows, the observed sample mean converges on . That also fixes the relationship worth keeping straight. is a parameter of the probability distribution, a fixed number you calculate; a sample mean is a statistic that varies from one batch of data to the next and settles toward it.
The sum here is the discrete version. For a continuous variable the same weighted-balance idea becomes an integral of against the density instead of a sum, which is the calculus notion of the average value of a function.
The same weighted sum, with dollar payoffs, is how expected value is calculated in economics: how to calculate expected value.
Expected count
Hypothesis testing
An expected count is how many observations a category would get if the null hypothesis were exactly true; it is the baseline in a chi-square test.
An expected count is what a cell would hold on average if the null hypothesis were exactly true. In a two-way table the null says one variable tells you nothing about the other, so a cell's share of the table is its row share times its column share, and multiplying by the grand total gives . The expected counts are built from the margins of your own table, so the observed and expected tables always carry identical row totals, column totals, and grand total.
Two schools are surveyed about biking to school. School A has 45 bikers out of 100, School B 45 out of 140, so the column totals are 90 bikers and 150 non-bikers out of 240. School A bikers have and School A non-bikers , which add back to that row's 100. The second row gives 52.5 and 87.5.
The objection to answer: "expected counts have to be whole numbers, because there is no such thing as 37.5 students." Round 37.5 up to 38 and the chi-square statistic changes. is an average across repeated samples under the null, not a forecast of any single table, and it goes into with its decimals intact. If the expected counts fail to add back to the margins, the arithmetic is wrong.
The condition for trusting the chi-square approximation is that every expected count is at least 5, and it is checked on the expected counts, never the observed ones. A cell holding 2 observed is fine as long as its clears 5. When some fall short, categories get combined or more data collected rather than reading the p-value anyway.
Building these counts is AP Statistics topic 3.14, Setting Up a Chi-Square Test for Homogeneity or Independence, and topic 3.15 carries the test out. A goodness-of-fit test instead uses from claimed proportions, which is standard college content but no longer on the AP exam.