Statistics & Probability First-year probability major 100% Free Open Access
Chapter 3 • Theory & Derivations

Random Variables, Distribution Functions and Transformations

Measurable numerical outcomes; Discrete, continuous and mixed distributions; PMFs, PDFs and CDFs; Quantiles and inverse CDFs; Functions of random variables and change of variables.

§3.1 Learning aims and numerical representations of outcomes

Many probability questions concern a number produced by an experiment rather than the complete recorded outcome. A committee has a number of represented departments. A sequence has a number of successes. A sensor has a measured response. A random variable connects the underlying outcome model to such numerical quantities. Its distribution describes how probability is allocated among its values, while leaving out details irrelevant to that numerical question.

The aims of this unit are to define random variables, distinguish mass, density and cumulative probability, calculate interval probabilities with correct endpoint handling, identify discrete, continuous and mixed distributions, and derive distributions of transformed variables. The reader should be able to explain why a density can exceed one, why a continuous point probability can be zero, and why a nonlinear transformation can require several inverse branches. These distinctions prevent common errors in later distribution formulas.

A random variable is a function $X:\Omega\to\mathbb R$ whose value is determined by the outcome. The word random refers to the uncertain outcome supplied to the function, not to a function changing its rule unpredictably. Once the outcome is known, the function has a definite value. Formally, events of the form $\{X\leq x\}$ must belong to the event collection for every real threshold $x$. This measurability requirement ensures that the probabilities used in a distribution are defined.

In a finite sample space with every subset allowed as an event, every numerical function is measurable. There is therefore no additional obstacle when counting successes or assigning scores to finitely many outcomes. For continuous models, ordinary functions used here satisfy the needed conditions. Advanced constructions of nonmeasurable functions are outside the book's scope; the formal condition is included to explain why a distribution is built from events rather than arbitrary unsupported subsets.

The distinction between an outcome and a random-variable value is essential. Several outcomes can give the same value. In three binary trials, eight detailed sequences produce only four possible success counts. The probability of a count is the sum of the probabilities of all sequences producing it. Counting the four count labels and assigning probability one quarter to each would usually be wrong. A distribution inherits weights from the underlying experiment; it does not replace the experiment with a new uniform choice among displayed values.

Two different random variables can have the same distribution without being the same function. A first-trial binary result and a second-trial binary result can both have equal probabilities of zero and one. They still refer to different positions, and their joint relationship requires additional information. Likewise, specifying two marginal distributions does not specify the dependence between the variables. Joint distributions will be developed in the next unit.

§3.2 Discrete random variables and probability mass functions

A discrete random variable takes values in a finite or countable set. Its probability mass function, or PMF, is $p_X(x)=P(X=x)$. The function is nonnegative and sums to one over its possible values. Values outside the possible set receive mass zero. Writing the support explicitly is part of specifying the distribution. A formula without its allowed integer range can represent the wrong law or fail normalization.

The support is often described as the values with positive probability. In this elementary discrete setting, that convention is convenient and unambiguous. For continuous laws, the word support has a broader meaning involving neighborhoods of values, so a singleton can lie in the support while having probability zero. The book will state ranges clearly rather than relying on one informal meaning of support across all cases.

For a discrete event $X\in S$, add the masses at values in $S$. When $S$ is infinite, countable additivity justifies the infinite sum. Nonnegative terms allow accumulation without cancellation concerns. A countably infinite PMF must include the entire tail when checking normalization. Summing the first few displayed values and treating the remainder as nonexistent produces an incomplete model.

A PMF is a probability at a value, so every mass lies between zero and one. Its graph is most naturally represented by isolated bars, stems or points, not by a continuous curve implying mass at intermediate values. Joining PMF values can be a visual guide, but the lines do not create probabilities between supported points. A displayed mass of one tenth at value three refers to an atom at three, not an area under a smooth curve near three.

The distribution of a discrete transformation is obtained by collecting all preimages of each new value. If $Y=g(X)$, then

$$p_Y(y)=\sum_{x:g(x)=y}p_X(x).$$

This formula combines probabilities when several old values map to one new value. It preserves normalization because every old value contributes to exactly one transformed value. A one-to-one transformation simply relabels masses; a many-to-one transformation merges them. The first worked question illustrates how squaring loses sign information and combines positive and negative values.

The formula also explains why rescaling a discrete variable does not divide its masses by a derivative. A derivative factor belongs to the continuous density change-of-variable formula, where probability is spread over intervals. A discrete mass remains attached to an outcome value after relabeling. If a mass at two is moved to twenty by multiplying the variable by ten, its probability does not become one tenth as large. The distinction between masses and densities determines the correct transformation rule.

§3.3 The cumulative distribution function

The cumulative distribution function, or CDF, of any real-valued random variable is

$$F_X(x)=P(X\leq x),\qquad -\infty<x<\infty.$$

Unlike PMFs and PDFs, a CDF applies to discrete, continuous and mixed laws alike. It accumulates all probability at or below a threshold. It is nondecreasing, takes values between zero and one, approaches zero toward negative infinity, and approaches one toward positive infinity. It is also right-continuous. These properties are mathematical constraints, not merely common graph shapes.

Monotonicity follows from event inclusion: if one threshold is smaller than another, its lower-threshold event is a subset of the larger-threshold event. The limits follow from continuity of probability for nested events. As thresholds increase without bound, every finite real-valued outcome is eventually included. As thresholds decrease without bound, no such outcome remains included. Right-continuity follows by taking a decreasing sequence of thresholds approaching the threshold from above and applying decreasing-event continuity.

For a discrete variable, the CDF is a step function. Each jump equals the mass at that point. Between consecutive supported values it stays constant because no new outcomes are added. At a supported value, the CDF includes that value's mass, since the definition uses less than or equal to. A graph marking the wrong endpoint of a jump can misrepresent the definition even if the overall staircase shape looks familiar.

Let $F_X(a^-)$ denote the left limit at $a$. The probability of the point $a$ is

$$P(X=a)=F_X(a)-F_X(a^-).$$

The left limit accumulates values strictly below the threshold, while the CDF at the threshold includes the point itself. The difference is therefore exactly the atom. This identity provides a common language for point probabilities in every distribution type. A continuous CDF has no jumps and hence no point atoms, although continuity alone does not guarantee the existence of an ordinary density.

Interval formulas require careful endpoint choices. For $a<b$,

$$P(a<X\leq b)=F_X(b)-F_X(a).$$

Including the lower endpoint replaces the subtracted term by its left limit. Excluding the upper endpoint replaces the first term by its left limit. Thus $P(a\leq X\leq b)=F_X(b)-F_X(a^-)$ and $P(a<X<b)=F_X(b^-)-F_X(a)$. In a distribution with no atoms at the endpoints, these versions coincide. In a discrete or mixed distribution, they can differ substantially.

The survival function is $S_X(x)=P(X>x)=1-F_X(x)$. Some applications use a version with greater than or equal to instead. For a continuous variable the point distinction disappears; for a discrete variable it remains. State the convention before using a survival formula, especially for waiting counts where zero or one can be the first supported value. A notation convention should never silently change the event being calculated.

The CDF uniquely determines the distribution of a real-valued random variable. It gives all interval probabilities, and those probabilities determine the ordinary event probabilities used in this book. Knowing a few CDF values is different from knowing the full function. A table of selected quantiles or cumulative probabilities can support some questions without specifying the entire distribution. Interpolation between tabulated values adds a numerical approximation, not an exact property supplied by the table.

§3.4 Continuous densities and probability as area

An absolutely continuous distribution has a nonnegative density function $f_X$ whose total integral is one and whose interval probabilities are integrals of that density. Its CDF can be written as $F_X(x)=\int_{-\infty}^{x}f_X(t)\,dt$. Where the CDF is differentiable, its derivative agrees with a suitable density version. The term continuous distribution is often used informally for this case; this book states when a density is being assumed.

A density value is not a point probability. The probability of an interval is the area under the density over that interval. A singleton has zero interval width, so an absolutely continuous distribution gives it probability zero. This does not mean the value is impossible in the model. Every realized value of a continuously modeled measurement is a point, but the model allocates probability to intervals rather than positive masses at individual points.

A density can exceed one. A uniform law on an interval of width one quarter has density four over that interval, and its total area remains one. The density's units are reciprocal to the variable's units. If the variable is measured in seconds, its density has units per second. Integrating over a time interval multiplies by a time width and yields a dimensionless probability. Requiring a density to lie below one confuses it with a probability mass.

Density values at isolated points do not change interval integrals. Assigning one value at a boundary and another value at the same boundary gives the same distribution when the functions differ only at finitely many points. Consequently a density formula can use convenient endpoint conventions without implying point masses. A jump in a density is also different from a jump in a CDF. The former can occur in an absolutely continuous law; the latter signals an atom.

For a narrow interval around a point where the density varies slowly, probability is approximately density times interval width. This is a local approximation, not an exact identity for arbitrary interval size. If the density changes sharply or has a singularity nearby, a single midpoint density may be a poor approximation. Integrating the formula or using a stable numerical method is safer. Later units will show several distributions with very different boundary behavior.

Normalization must be checked over the correct range. A nonnegative expression can fail to be a density if its integral is not one. Multiplying it by a constant may produce a valid density when the integral is positive and finite. If the expression is negative on part of the range, a normalizing constant does not repair the underlying sign problem. If the integral diverges, no finite positive constant can turn it into a probability density on that entire range.

§3.5 Mixed distributions and measurement conventions

Some variables have both atoms and a continuously distributed component. A waiting-time model might assign positive probability to immediate service at zero and distribute positive waiting times continuously. A censoring or recording mechanism can also produce a point mass at a boundary. Such a distribution cannot be represented fully by an ordinary density integrating to one over the real line unless the atoms are handled separately in a more general mathematical representation.

For example, suppose a model assigns probability one fifth to zero and uses a uniform continuous component on the interval from zero to two for the remaining four fifths. Its CDF is zero below zero, jumps to one fifth at zero, then increases linearly to one at two. On the positive interval its ordinary density is two fifths per unit. That continuous density integrates to four fifths, while the atom supplies the remaining one fifth. Forgetting the atom would leave a distribution with missing probability.

The probability of an interval containing zero includes the atom as well as the appropriate continuous area. The probability of a positive interval excludes the atom. Endpoint conventions therefore matter even though most of the distribution is continuous. The CDF interval formulas automatically handle both components. This is one reason to treat the CDF as the common representation rather than trying to force every law into either a PMF or a PDF.

Rounding a continuous measurement creates a discrete recorded variable. A device displaying whole seconds maps an interval of underlying times to each displayed integer. The probability of a displayed value is the probability of its rounding interval under the underlying continuous model. It is not the density at the displayed integer. Different rounding rules, truncation rules and saturation limits produce different recorded distributions. The measurement protocol belongs in the model.

A zero in a dataset can mean a genuine atom, a rounded small value, a censored value or a missing-value code. Probability theory cannot determine which interpretation is correct from the numeral alone. The data dictionary and collection mechanism provide that information. A model with a point mass at zero should describe why the point mass exists rather than inferring it automatically from repeated displayed zeros.

Distributions can also be neither discrete nor absolutely continuous nor a simple mixture of those two forms. A continuous CDF need not possess a density. Such singular distributions are not developed in this introductory course, but acknowledging their existence avoids the incorrect statement that every CDF without jumps can be differentiated into a complete density. The practical laws used later in this book have explicit PMFs, PDFs or stated mixtures, so their required computations remain elementary.

§3.6 Quantiles and inverse distribution functions

For a probability level $u$ strictly between zero and one, a standard quantile convention is

$$Q(u)=\inf\{x:F_X(x)\geq u\}.$$

This generalized inverse works even when the CDF has jumps or flat portions. In a strictly increasing continuous part, solving $F_X(x)=u$ produces the same result. A discrete quantile need not have cumulative probability exactly equal to the requested level. It is the first value at which the cumulative probability reaches or exceeds that level.

The median is a central quantile, often specified by the same generalized-inverse convention at one half. Other median definitions allow any value with at least half the probability at or below it and at least half at or above it. These conventions can yield an interval of acceptable medians in some discrete models. A calculation should identify its convention rather than labeling every different reported value an error.

Quantiles and means answer different questions. A ninetieth percentile is a threshold exceeded with a specified tail probability under the chosen convention. A mean is an average defined through expectation, which will be developed in the next unit. A distribution can have a finite median while lacking a finite mean. Treating a central quantile as an average of values replaces one summary with another without justification.

Inverse-CDF sampling uses a uniform variable on the interval from zero to one and transforms it through the generalized inverse. The resulting variable has the target distribution under suitable endpoint conventions. The idea can be verified by relating threshold events for the inverse to the corresponding cumulative probability. A program implementation must still handle numerical endpoints, finite precision and noninvertible flat portions correctly. Calling a numerical routine inverse does not prove that its output follows the desired law.

For a discrete PMF, inverse sampling divides the uniform interval into subintervals whose lengths equal the masses. A uniform value selects the first cumulative threshold it does not exceed, according to the stated convention. For an absolutely continuous CDF with an explicit inverse, the transformation can be direct. When no convenient inverse is available, numerical inversion or another sampling algorithm may be preferable. The sampling method is a representation of the distribution, not part of its definition.

§3.7 Transformations through events and distribution functions

If $Y=g(X)$, a reliable starting point is the event identity $\{Y\leq y\}=\{g(X)\leq y\}$. The CDF of $Y$ is the probability of that event under the known law of $X$. This method works for discrete, continuous and mixed variables and handles many-to-one transformations naturally. It should be preferred whenever a remembered density formula would hide the transformed support or miss a branch.

For a strictly increasing transformation, the event becomes $\{X\leq g^{-1}(y)\}$ on the transformed range. For a strictly decreasing transformation, it becomes a lower-bound event for $X$, so the complement and possible endpoint mass must be handled. For an absolutely continuous variable with no endpoint atom, the resulting density can often be obtained by differentiating the transformed CDF. Deriving the CDF first makes the sign and range changes visible.

For a differentiable one-to-one transformation with nonzero derivative on the relevant range, the density rule is

$$f_Y(y)=f_X(g^{-1}(y))\left|\frac{d}{dy}g^{-1}(y)\right|.$$

The absolute value ensures nonnegative density for a decreasing transformation. It accounts for the stretching or compression of interval widths. If a small transformed interval corresponds to a larger original interval, its density must be larger in order to preserve the same probability area. This width adjustment has no analogue in relabeling discrete point masses.

A linear transformation $Y=a+bX$ with nonzero $b$ has density $f_X((y-a)/b)/|b|$ when $X$ is absolutely continuous. The transformed support must also be changed. If $b$ is negative, the endpoints reverse order. A density copied onto the old support can have the correct-looking formula and still describe the wrong distribution. If $b=0$, the transformed variable is a point mass at $a$, so the ordinary density formula is inapplicable.

For a transformation with several monotone branches, each inverse branch contributes a density term where it lies in the original support. The total density is the sum of those terms. Squaring a variable often combines a positive and a negative branch, but an asymmetric original range can admit both branches for some transformed values and only one for others. A blanket factor of two is therefore not generally correct.

The branch formula assumes the regularity needed for differentiating and changing variables on the stated pieces. At isolated critical values where derivatives vanish or branches meet, density expressions may diverge or need separate limiting descriptions. This does not automatically invalidate the distribution. An integrable singularity can still yield total probability one and a continuous CDF. The third worked question gives a square-root singularity that is integrable and has no atom at zero.

Transformations can also create atoms. If a continuous variable is mapped to zero for an entire interval, the probability of that interval becomes a point mass at zero. Rounding, thresholding and clipping are common examples. A function need not be one-to-one or smooth simply because its input is continuous. The event-based method accounts for those collapsed regions; a smooth inverse-density formula used indiscriminately would omit their probability.

§3.8 Rounding and clipping as probability transformations

Transforming a variable through a recording rule is different from transforming its physical units. A change from seconds to milliseconds is one-to-one and preserves all information in an exact value. Rounding a time to the nearest second combines many different physical values into one displayed integer. Clipping a sensor at a maximum value combines every sufficiently large physical reading into a single boundary value. These rules alter distribution type and should be modeled as functions of an underlying quantity.

To make the distinction concrete, consider a uniform underlying variable on the interval from zero to four. Its density is one quarter per original unit. If it is rounded to the nearest integer, with ties assigned by any fixed rule, the displayed zero corresponds to an underlying interval of length one half. The displayed four also corresponds to an interval of length one half. Each has probability one eighth. The displayed values one, two and three each correspond to intervals of length one and therefore each have probability one quarter. The displayed values are not equally likely even though they are consecutive integer labels.

The tie rule at exact half-integers does not affect these probabilities because the underlying model has no point masses there. If the underlying distribution did have an atom at a half-integer, the tie rule would matter. This qualification illustrates a broader principle: an endpoint detail that is irrelevant under one distribution can be consequential under another. Numerical software should record the actual rounding convention rather than assuming that all possible inputs follow an absolutely continuous law.

Now apply clipping instead of rounding. Let the recorded variable equal the underlying uniform value when it is below three and equal three otherwise. Below three, the recorded distribution retains the original continuous density one quarter. At three, the probability of the entire underlying interval from three to four becomes an atom of one quarter. The continuous area is three quarters, and the atom supplies the remaining quarter. An analyst fitting a purely continuous density to the recorded values would miss the boundary pileup caused by the instrument.

The clipped CDF equals zero below zero, equals one quarter times the threshold from zero up to three, and jumps to one at three. It is constant thereafter. The difference between its left limit at three and its value at three is one quarter. This representation shows the atom directly and handles probabilities such as a reading of at least three without relying on an inappropriate density-at-the-boundary calculation.

These examples also distinguish a property of the measured phenomenon from a property of the recording process. A concentration of displayed readings at a sensor limit can arise from clipping even when the physical quantity has no concentration at that exact value. Repeated displayed values do not by themselves identify the underlying distribution type. A defensible analysis specifies the physical model, the recording map and the resulting observed-data model separately.

§3.9 Comparing distributions through their CDFs

A full CDF contains more information than a single central summary. If one variable has a smaller CDF than another at every threshold, it places less probability below every threshold and is larger in the sense of first-order stochastic dominance. This is a distributional comparison, not a claim that every individual realized value of the first variable will exceed every realized value of the second. A statement about a pair of realized values would require a joint model.

The distinction can be seen with two uniform laws on overlapping intervals. A uniform variable on the interval from one to three is larger in this CDF sense than a uniform variable on the interval from zero to two. At every threshold its accumulated probability is no greater. Yet a draw near one from the first law can be less than a draw near two from the second law. Dominance concerns the entire marginal distributions, while a pairwise comparison concerns how two values are generated together.

CDFs can also cross. One distribution may put more probability below small thresholds but less below larger thresholds. In that case there is no simple ordering of all thresholds. Reporting only that one median is larger can conceal the crossing and the different tail behavior. A threshold-specific question, such as the chance of exceeding a capacity limit, should be answered using that threshold rather than inferred from a central summary alone.

Quantile curves supply another view of the comparison. A generalized inverse maps a probability level to a threshold. When a CDF dominance order holds, the corresponding quantiles are ordered in the opposite threshold direction: the distribution that accumulates probability more slowly reaches a specified level at a larger value. For crossing CDFs, the quantile comparison can depend on the chosen level. This is why a ninetieth-percentile comparison need not agree with a median comparison.

Two distributions can share several quantiles and still differ elsewhere. Knowing the median and two tail quantiles does not establish identical PMFs or densities. Likewise, two plotted curves may look similar at a coarse resolution while differing materially in a narrow interval. The numerical event of interest should be checked directly with the distribution formulas or sufficiently accurate integration. Visual similarity is useful evidence about shape, but it does not replace probability calculations.

§3.10 Why generalized inverse sampling works

The generalized inverse has a probabilistic purpose beyond reporting quantiles. Let $U$ be uniform on the interval from zero to one and set $Y=Q(U)$ for a CDF $F$. Apart from endpoints of zero probability under this uniform law, the threshold relation between the inverse and the original CDF is $Q(U)\leq x$ exactly when $U\leq F(x)$. The probability of the latter event is $F(x)$. Therefore the generated variable has CDF $F$.

For a discrete law, this threshold argument is particularly transparent. Each jump in the CDF corresponds to an interval of uniform input values of the same length. All inputs in that interval map to the supported value at the jump. A large mass receives a wide input interval, while a small mass receives a narrow one. No interpolation between supported values is needed, and such interpolation would generally generate the wrong distribution.

For a mixed law, a jump similarly produces a flat segment in the quantile function. A whole interval of uniform inputs maps to the atomic value. On the continuous portion, the quantile changes continuously where the CDF is strictly increasing. Thus the same sampling principle handles both point masses and continuous probability without pretending that an atom is an ordinary density peak. The input interval assigned to the atom carries its probability exactly.

Numerical endpoints require care. Some pseudorandom interfaces can return zero, while others exclude both endpoints or use a different interval convention. A theoretical inverse may be infinite at a boundary for an unbounded distribution. A robust implementation follows a documented input convention and checks the transformed output for validity. Silently replacing every nonfinite value by zero changes the distribution and creates an artificial atom. Numerical repair should preserve the intended probability law rather than merely produce a finite display.

The inverse method does not require observations from a physical phenomenon with the target law. It produces model-generated samples from uniform inputs. Those samples can illustrate a distribution and test an implementation, but they do not establish that the distribution describes real data. This limitation is especially important when simulations use attractive plots: successful sampling validates a computational mechanism conditional on the model, not the model's empirical suitability.

§3.11 Computational and conceptual checks

For a PMF, check nonnegative masses, an explicit support and a total of one. For a density, check nonnegativity and total area over the entire range. For a CDF, check monotonicity, right-continuity and the limits at both infinities. For a mixed model, account for each atom separately and verify that continuous and atomic weights sum to one. These requirements concern the mathematical law before any numerical display or simulation is considered.

For a transformation, first find the image of the original support. Then identify whether several original values produce the same transformed value. A discrete transformation collects masses; a continuous one-to-one transformation adjusts interval widths; a many-to-one continuous transformation sums valid branches; and a transformation that collapses intervals may create atoms. The event-based CDF method offers one coherent starting point for all of them.

Numerical integration should be checked against exact integrals where available. Uniform grids can perform poorly near integrable singularities if they evaluate an infinite endpoint density directly. Transforming the integration variable, excluding endpoints appropriately, or using an adaptive rule can address that numerical issue. A program returning an invalid number at an endpoint does not prove that the probability model is invalid. The mathematical integral and the chosen numerical representation must be examined separately.

An educational density explorer should show the shaded area of a selected interval and the corresponding CDF difference. It should label a density ordinate with reciprocal units when the variable has units, and it should display atoms distinctly in mixed models. Controls changing interval endpoints must preserve their order or explain an invalid input. A plot alone cannot teach these distinctions if its output labels call both a curve height and a shaded area probability.

Finally, compare every answer with its event. A tail probability must correspond to the chosen strict or nonstrict inequality. A quantile must use its stated convention. A transformed variable's value should not be interpreted as retaining information that the transformation discarded. These habits prepare the reader for joint distributions and expectation, where compact notation makes it even more important to keep the underlying events and assumptions visible.

THREE WORKED QUESTIONS

Step-by-Step Probability Solutions

Three original questions connect calculations, definitions and interpretation. Open each solution to follow the reasoning.

Solved Problem Example 3.1: Squaring a discrete variable

A discrete variable $X$ has masses $0.10$, $0.20$, $0.30$, $0.25$, and $0.15$ at $-2$, $-1$, $0$, $1$, and $2$, respectively. Let $Y=X^2$. Find the PMF and CDF of $Y$, calculate $P(Y>1)$, and find the median using the generalized-inverse quantile convention. Explain whether observing $Y=1$ determines the sign of $X$.

Collect preimages

The transformed value zero is produced only by $X=0$, so its mass is $0.30$. The value one is produced by $X=-1$ and $X=1$, so its mass is $0.20+0.25=0.45$. The value four is produced by $X=-2$ and $X=2$, so its mass is $0.10+0.15=0.25$. The transformed support is $\{0,1,4\}$, and the masses sum to one. They are combined original masses, not newly uniform weights.

Accumulate the CDF

The CDF is zero for thresholds below zero, $0.30$ for thresholds from zero up to but not including one, $0.75$ from one up to but not including four, and one from four onward. At each supported value the new mass is included. The jump at one is $0.45$, agreeing with the PMF. A threshold just below one has cumulative probability $0.30$, while the threshold exactly one has cumulative probability $0.75$.

Calculate the tail and quantile

The event $Y>1$ includes only value four and has probability $0.25$. Equivalently it is $1-F_Y(1)=1-0.75$. The first value where the CDF reaches one half is one, so the generalized-inverse median is one. The CDF need not equal one half at that value; it can jump across the requested level.

Describe the lost sign information

Observing $Y=1$ means $X$ is either minus one or plus one. Conditional on that observation, the probabilities are $0.20/0.45=4/9$ for minus one and $0.25/0.45=5/9$ for plus one. The sign is not determined. A many-to-one transformation preserves a distribution of the new quantity but can discard information about the original outcome. The two conditional probabilities sum to one and reflect the unequal original masses.

Solved Problem Example 3.2: A triangular density and its quantiles

A proposed density equals $cx$ for $0\leq x\leq1$, equals $c(2-x)$ for $1<x\leq2$, and equals zero elsewhere. Find the normalizing constant and the CDF. Calculate $P(0.5<X\leq1.5)$, the median and the ninetieth percentile. State the probability of the exact value one and explain why the density value there gives a different quantity.

Normalize the area

The integral of $cx$ from zero to one is $c/2$. The integral of $c(2-x)$ from one to two is also $c/2$. Total area is $c$, so normalization requires $c=1$. The resulting function is nonnegative over the stated range. It is zero outside that range, and no additional point mass is included by its endpoint definitions.

Integrate piecewise

Below zero the CDF is zero. From zero to one it is $x^2/2$. From one to two it is $1-(2-x)^2/2$, and above two it is one. The two formulas agree at one with value one half. They agree with the exterior pieces at zero and two. The resulting function is continuous and nondecreasing, as required.

Evaluate the interval probability

The CDF at one half is $1/8$, and at three halves it is $7/8$. Their difference is $3/4$. Thus the interval probability is $0.75$. Since there are no atoms at either endpoint, replacing the strict lower inequality with a nonstrict one would not change this value. That endpoint simplification is justified by the density model, not by a universal rule for all distributions.

Solve the quantile equations

The median is one because the CDF equals one half there and is strictly increasing in the interior. The ninetieth percentile lies above one, so solve $1-(2-x)^2/2=0.9$. The solution in the stated range is $x=2-\sqrt{0.2}$, approximately $1.552786$. Choosing the other algebraic root would put the threshold outside the support and would not solve the correct branch problem.

Distinguish density and point probability

The exact-value probability $P(X=1)$ is zero because the CDF has no jump at one. The density value at one is one per unit of $X$. It describes local probability area per width, not a one-hundred-percent chance of the exact value. A small interval around one has a positive area, while the singleton itself has zero width and zero probability.

Solved Problem Example 3.3: Two inverse branches with unequal ranges

Let $X$ be uniform on the interval $[-2,1]$ and let $Y=X^2$. Derive the CDF and density of $Y$, calculate $P(Y\leq1)$, and find its median under the generalized-inverse convention. Explain why a two-branch density formula applies below one but only a one-branch formula applies above one. Check that the apparent singularity at zero is integrable and does not represent an atom.

Translate the threshold event

The original density is one third on an interval of length three. For a nonnegative threshold $y$, the condition $X^2\leq y$ corresponds to $-\sqrt y\leq X\leq\sqrt y$, intersected with the original support. For $0\leq y\leq1$, both bounds lie in the support, so the retained interval has length $2\sqrt y$. The CDF is $2\sqrt y/3$ on that range.

Handle the asymmetric upper range

For $1<y\leq4$, the positive bound exceeds the upper endpoint one, so the retained interval is $[-\sqrt y,1]$. Its length is $1+\sqrt y$, giving CDF $(1+\sqrt y)/3$. The CDF is zero below zero and one from four onward. At one, both formulas equal two thirds, so there is no jump where the number of inverse branches changes.

Differentiate the two pieces

On $0<y<1$, the density is $1/(3\sqrt y)$. On $1<y<4$, it is $1/(6\sqrt y)$. Outside the transformed range it is zero. Below one, both roots are allowed values of $X$ and each contributes one sixth divided by the square root. Above one, the positive root lies outside the original support, leaving only the negative contribution. The density value at the isolated point one can be assigned conveniently without changing the distribution.

Obtain probability and median

Evaluating the CDF at one gives $P(Y\leq1)=2/3$. The median lies below one, so solve $2\sqrt y/3=1/2$. This gives $\sqrt y=3/4$ and median $y=9/16=0.5625$. Squaring a median of $X$ would not generally give a median of $Y$ because squaring is not monotone over the entire original support.

Check total probability and the boundary

Integrating the first density piece from zero to one gives two thirds. Integrating the second piece from one to four gives one third. Their sum is one. Although the density grows without bound near zero, its integral over a shrinking interval from zero to a positive threshold tends to zero. The CDF at zero and its left limit are both zero, so there is no atom at zero. An unbounded density and a positive point mass are different mathematical objects.