Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Random Variables and Probability Distributions | Section
Exploring Probability Theory
Seksjon 1. Kapittel 8
single

single

bookRandom Variables and Probability Distributions

Sveip for å vise menyen

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?

Velg alle riktige svar

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 8
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt