LearnViz CompSci
Home / Learn / Math for Computing / Random Variables

Beginner Topic 12 of 51 Math for Computing

Random Variables

Numeric outcomes of random processes.

How it works

A random variable assigns a numerical value to each outcome of a random experiment, such as the number of heads in ten tosses. Discrete random variables take countable values and are described by a probability mass function, while continuous ones take values in intervals and are described by a probability density function, with probabilities as areas under the curve. The cumulative distribution function gives the probability of being less than or equal to a value. Joint distributions describe several variables, along with marginals and independence.

Where it is used

Modeling uncertain quantities such as response times, sensor noise, user counts, losses and machine-learning predictions, and defining expectations and variances use random variables.

Common pitfall

A density value is not a probability and can exceed 1, since only integrals over intervals give probabilities. Confusing the variable with the distribution it follows and mixing discrete and continuous formulas cause errors. Independent variables must be justified. Define the sample space and what the variable measures, and use simulation to check.

Where it fits in the course

Random Variables is topic 12 of 51 in Math for Computing, rated Beginner. It follows Probability Basics. The next topic is Expected Value.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Math for Computing quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Random Variables?
Numeric outcomes of random processes. It belongs to Math for Computing and is a beginner-level topic.
Where do people use Random Variables?
Modeling uncertain quantities such as response times, sensor noise, user counts, losses and machine-learning predictions, and defining expectations and variances use random variables.
What is the most common mistake with Random Variables?
A density value is not a probability and can exceed 1, since only integrals over intervals give probabilities.
What should I learn before this topic?
Start with Probability Basics, the topic just before it in Math for Computing.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Math for Computing quiz.
Is Random Variables hard to learn?
It is a Beginner topic, so it works as an entry point. If the terms are new, read the explanation twice and try the visualizer before the quiz.
How long does it take to learn Random Variables?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Random Variables?
Probability Basics, Expected Value, Determinants are closely connected. The full list is in the related topics section of this page.
What should I study after Random Variables?
Continue with Expected Value, the next topic in Math for Computing.

Related topics