Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Random Variables and Probability Distributions | Section
Exploring Probability Theory
Avsnitt 1. Kapitel 8
single

single

bookRandom Variables and Probability Distributions

Svep för att visa menyn

A random variable is a function that assigns a numerical value to each outcome of a random experiment. Random variables are classified as either discrete or continuous.

A discrete random variable can take on a finite or countably infinite set of possible values. For instance, the number of heads when flipping three coins is a discrete random variable, as its possible values are 0, 1, 2, or 3.

A continuous random variable can take on any value within a given interval or collection of intervals. For example, the exact height of a randomly selected person is a continuous random variable, as it can be any real number within a certain range.

The probability mass function (PMF) describes the probability that a discrete random variable is exactly equal to some value. For a discrete random variable XX, the PMF is defined as P(X=x)P(X = x). For example, if XX is the roll of a fair six-sided die, the PMF assigns a probability of 1/61/6 to each possible outcome from 1 to 6.

The probability density function (PDF) is used for continuous random variables. It describes the relative likelihood for this random variable to take on a given value. Unlike the PMF, the PDF itself does not give probabilities directly; instead, the probability that the variable falls within a particular interval is given by the area under the curve of the PDF over that interval. For example, the time between bus arrivals might follow an exponential distribution with a specific PDF.

Understanding the distinction between PMF and PDF is crucial for working with different types of random variables and their distributions.

123456789101112131415161718
import matplotlib.pyplot as plt import numpy as np # Simulate a discrete random variable: rolling a fair six-sided die 1000 times np.random.seed(42) n_trials = 1000 outcomes = np.random.choice([1, 2, 3, 4, 5, 6], size=n_trials) # Calculate the PMF (empirical probabilities) values, counts = np.unique(outcomes, return_counts=True) pmf = counts / n_trials # Plot the PMF plt.bar(values, pmf, tick_label=values) plt.xlabel("Die Face") plt.ylabel("Probability") plt.title("Empirical PMF of a Fair Six-Sided Die") plt.show()
copy
question mark

Which statements about random variables, PMF, and PDF are correct?

Välj alla rätta svar

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 8
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

some-alt