Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Random variable
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Examples== ===Discrete random variable=== Consider an experiment where a person is chosen at random. An example of a random variable may be the person's height. Mathematically, the random variable is interpreted as a function which maps the person to their height. Associated with the random variable is a probability distribution that allows the computation of the probability that the height is in any subset of possible values, such as the probability that the height is between 180 and 190 cm, or the probability that the height is either less than 150 or more than 200 cm. Another random variable may be the person's number of children; this is a discrete random variable with non-negative integer values. It allows the computation of probabilities for individual integer values – the probability mass function (PMF) – or for sets of values, including infinite sets. For example, the event of interest may be "an even number of children". For both finite and infinite event sets, their probabilities can be found by adding up the PMFs of the elements; that is, the probability of an even number of children is the infinite sum <math>\operatorname{PMF}(0) + \operatorname{PMF}(2) + \operatorname{PMF}(4) + \cdots</math>. In examples such as these, the [[sample space]] is often suppressed, since it is mathematically hard to describe, and the possible values of the random variables are then treated as a sample space. But when two random variables are measured on the same sample space of outcomes, such as the height and number of children being computed on the same random persons, it is easier to track their relationship if it is acknowledged that both height and number of children come from the same random person, for example so that questions of whether such random variables are correlated or not can be posed. If <math display = "inline">\{a_n\}, \{b_n\}</math> are countable sets of real numbers, <math display="inline">b_n >0</math> and <math display="inline">\sum_n b_n=1</math>, then <math display="inline"> F=\sum_n b_n \delta_{a_n}(x)</math> is a discrete distribution function. Here <math> \delta_t(x) = 0</math> for <math> x < t</math>, <math> \delta_t(x) = 1</math> for <math> x \ge t</math>. Taking for instance an enumeration of all rational numbers as <math>\{a_n\}</math> , one gets a discrete function that is not necessarily a [[step function]] ([[piecewise]] constant). ====Coin toss==== The possible outcomes for one coin toss can be described by the sample space <math>\Omega = \{\text{heads}, \text{tails}\}</math>. We can introduce a real-valued random variable <math>Y</math> that models a $1 payoff for a successful bet on heads as follows: <math display="block">Y(\omega) = \begin{cases} 1, & \text{if } \omega = \text{heads}, \\[6pt] 0, & \text{if } \omega = \text{tails}. \end{cases}</math> If the coin is a [[fair coin]], ''Y'' has a [[probability mass function]] <math>f_Y</math> given by: <math display="block">f_Y(y) = \begin{cases} \tfrac 12,& \text{if }y=1,\\[6pt] \tfrac 12,& \text{if }y=0, \end{cases}</math> ====Dice roll==== [[File:Dice Distribution (bar).svg| right | thumb | If the sample space is the set of possible numbers rolled on two dice, and the random variable of interest is the sum ''S'' of the numbers on the two dice, then ''S'' is a discrete random variable whose distribution is described by the [[probability mass function]] plotted as the height of picture columns here.]] A random variable can also be used to describe the process of rolling dice and the possible outcomes. The most obvious representation for the two-dice case is to take the set of pairs of numbers ''n''<sub>1</sub> and ''n''<sub>2</sub> from {1, 2, 3, 4, 5, 6} (representing the numbers on the two dice) as the sample space. The total number rolled (the sum of the numbers in each pair) is then a random variable ''X'' given by the function that maps the pair to the sum: <math display="block">X((n_1, n_2)) = n_1 + n_2</math> and (if the dice are [[fair die|fair]]) has a probability mass function ''f''<sub>''X''</sub> given by: <math display="block">f_X(S) = \frac{\min(S-1, 13-S)}{36}, \text{ for } S \in \{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12\}</math> ===Continuous random variable=== Formally, a continuous random variable is a random variable whose [[cumulative distribution function]] is [[Continuous function|continuous]] everywhere.<ref name=":0">{{Cite book|title=Introduction to Probability|last=Bertsekas|first=Dimitri P.|date=2002|publisher=Athena Scientific|others=Tsitsiklis, John N., Τσιτσικλής, Γιάννης Ν.|isbn=188652940X|location=Belmont, Mass.|oclc=51441829}}</ref> There are no "[[Discontinuity (mathematics)#Jump discontinuity|gaps]]", which would correspond to numbers which have a finite probability of [[Outcome (probability)|occurring]]. Instead, continuous random variables [[almost never]] take an exact prescribed value ''c'' (formally, <math display="inline">\forall c \in \mathbb{R}:\; \Pr(X = c) = 0</math>) but there is a positive probability that its value will lie in particular [[Interval (mathematics)|intervals]] which can be [[arbitrarily small]]. Continuous random variables usually admit [[probability density function]]s (PDF), which characterize their CDF and [[probability measure]]s; such distributions are also called [[Absolutely continuous random variable|absolutely continuous]]; but some continuous distributions are [[Singular distribution|singular]], or mixes of an absolutely continuous part and a singular part. An example of a continuous random variable would be one based on a spinner that can choose a horizontal direction. Then the values taken by the random variable are directions. We could represent these directions by North, West, East, South, Southeast, etc. However, it is commonly more convenient to map the sample space to a random variable which takes values which are real numbers. This can be done, for example, by mapping a direction to a bearing in degrees clockwise from North. The random variable then takes values which are real numbers from the interval [0, 360), with all parts of the range being "equally likely". In this case, '''''X''''' = the angle spun. Any real number has probability zero of being selected, but a positive probability can be assigned to any ''range'' of values. For example, the probability of choosing a number in [0, 180] is {{frac|1|2}}. Instead of speaking of a probability mass function, we say that the probability ''density'' of '''''X''''' is 1/360. The probability of a subset of [0, 360) can be calculated by multiplying the measure of the set by 1/360. In general, the probability of a set for a given continuous random variable can be calculated by integrating the density over the given set. More formally, given any [[Interval (mathematics)|interval]] <math display="inline">I = [a, b] = \{x \in \mathbb{R} : a \le x \le b \}</math>, a random variable <math>X_I \sim \operatorname{U}(I) = \operatorname{U}[a, b]</math> is called a "[[Continuous uniform distribution|continuous uniform]] random variable" (CURV) if the probability that it takes a value in a [[subinterval]] depends only on the length of the subinterval. This implies that the probability of <math>X_I</math> falling in any subinterval <math>[c, d] \sube [a, b]</math> is [[Proportionality (mathematics)|proportional]] to the [[Lebesgue measure|length]] of the subinterval, that is, if {{math|''a'' ≤ ''c'' ≤ ''d'' ≤ ''b''}}, one has <math display="block"> \Pr\left( X_I \in [c,d]\right) = \frac{d - c}{b - a} </math> where the last equality results from the [[Probability axioms#Unitarity|unitarity axiom]] of probability. The [[probability density function]] of a CURV <math>X \sim \operatorname {U}[a, b]</math> is given by the [[indicator function]] of its interval of [[Support (mathematics)|support]] normalized by the interval's length: <math display="block">f_X(x) = \begin{cases} \displaystyle{1 \over b-a}, & a \le x \le b \\ 0, & \text{otherwise}. \end{cases}</math>Of particular interest is the uniform distribution on the [[unit interval]] <math>[0, 1]</math>. Samples of any desired [[probability distribution]] <math>\operatorname{D}</math> can be generated by calculating the [[quantile function]] of <math>\operatorname{D}</math> on a [[Random number generation|randomly-generated number]] distributed uniformly on the unit interval. This exploits [[Cumulative distribution function#Properties|properties of cumulative distribution functions]], which are a unifying framework for all random variables. ===Mixed type=== A '''mixed random variable''' is a random variable whose [[cumulative distribution function]] is neither [[discrete random variable|discrete]] nor [[Continuous function|everywhere-continuous]].<ref name=":0" /> It can be realized as a mixture of a discrete random variable and a continuous random variable; in which case the {{Abbr|CDF|cumulative distribution function}} will be the weighted average of the CDFs of the component variables.<ref name=":0" /> An example of a random variable of mixed type would be based on an experiment where a coin is flipped and the spinner is spun only if the result of the coin toss is heads. If the result is tails, '''''X''''' = −1; otherwise '''''X''''' = the value of the spinner as in the preceding example. There is a probability of {{frac|1|2}} that this random variable will have the value −1. Other ranges of values would have half the probabilities of the last example. Most generally, every probability distribution on the real line is a mixture of discrete part, singular part, and an absolutely continuous part; see {{Section link|Lebesgue's decomposition theorem|Refinement}}. The discrete part is concentrated on a countable set, but this set may be dense (like the set of all rational numbers).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)