DeepLLM Quiz
Statistics and Probability

Expectation, variance and covariance

10 questions on expected value, sample averages, variance, covariance and covariance matrices. With explanations.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    A game pays nothing 90% of the time and 100 euros the other 10% of the time. What is the expected payout per game?

    • 10 euros
    • 50 euros
    • 100 euros
  2. Sample 2

    You average a quantity that depends on two variables, x and y, over x alone, leaving y fixed. What is the result?

    • A single number that doesn't depend on y
    • A function of y, giving a different average for each value of y
    • Always zero

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

Three ideas appear in nearly every statistical report and every machine learning paper: where the values tend to sit, how much they scatter around that place, and whether two quantities move together. Their formal names are expectation, variance and covariance. They are used to describe the errors of a forecasting model, the risk of an investment, the noise in a sensor and the relationships among the inputs of a classifier. If you can read these three words correctly, a great deal of technical writing becomes easier to follow.

The quiz starts with expectation, which is just a weighted average. Each possible value is weighted by how likely it is, so a rare large payout counts for less than a common small one. You will use that idea on a simple game and then on the practical question that matters most for machine learning: how to estimate an expectation when you can only draw samples, and why more samples bring the estimate closer to the truth. You will also see what happens when you average over only one of two variables, which leaves you with a function rather than a single number.

Next comes variance, the standard measure of spread. Two sensors can have the same average error and very different reliability, and variance is the number that tells them apart. The quiz also covers a handy rearrangement, in words: the spread of a quantity equals the average of its squares minus the square of its average. Finally, it turns to covariance, which measures how far two variables vary together, and to the covariance matrix that collects these measurements for a whole list of variables at once.

A few errors recur. People use the plain average when a weighted one is called for. They confuse a large variance with a large average. They treat covariance as if it were a percentage you could compare across different units, or they assume that variables which move together must influence each other. Working through small examples helps to separate the pure bookkeeping from the interpretation, which needs context. Keeping these definitions straight also helps when you read about model errors, where the average error, the spread of the errors and the way different errors move together each tell a different part of the story, and a single summary number rarely tells all of it.

The quiz suits students in statistics, data science or engineering and anyone who wants the vocabulary to follow documentation and papers. It needs only arithmetic. There are 10 questions, each with an explanation, and the quiz takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. You see an explanation after every answer.

›Do I need to know any formulas?

No. Everything is described in words, and the numbers in the examples are chosen so that you can work them out in your head. The explanations show the reasoning without relying on symbols.

›What is an expectation?

It is the average of a quantity, where each possible value is weighted by its probability. It is also called the expected value or the mean of a distribution. It is not necessarily a value that can actually occur: the expected result of rolling a standard die is three and a half. A few practical cautions apply. An average can be dominated by rare, extreme values, which is why a variance estimated from a small sample can be unreliable, and why reports that quote only a mean can hide a great deal. When you meet a figure, ask which of the three quantities it is, and whether the spread or the way variables move together is also given.

›How is an expectation estimated from data?

By drawing a number of samples from the distribution and averaging the quantity over them. The more samples you use, the closer this sample average tends to be to the true expectation, and in the limit of infinitely many samples it matches it exactly. This idea underlies a large part of practical machine learning.

›What does variance measure?

It measures how far values typically stray from their average, by averaging the squared distances from the mean. A small variance means the values cluster closely, and a large one means they are widely scattered. Its square root, the standard deviation, is in the same units as the data and is often easier to interpret.

›What is covariance?

Covariance measures the extent to which two variables vary together. It is positive when they tend to be high or low at the same time, negative when one tends to be high while the other is low, and zero when there is no such tendency. Because its size depends on the units, it is often rescaled into a correlation before comparing.

›What is a covariance matrix?

When you have a whole list of variables, you can write the covariance of every pair in a table. The result is a covariance matrix. Its entries on the diagonal are the variances of the individual variables, and the other entries describe how each pair moves together. It is the main way of summarising a multi-dimensional spread.

›What is the relation between independence and covariance?

If two variables are independent, their covariance is zero, because knowing one tells you nothing about the other. The reverse is not guaranteed in general: a lack of covariance only rules out a simple tendency to move together, not every kind of dependence.

More quizzes