Skip to main content
56 votes

Find expected value using CDF

The result extends to the $k$th moment of $X$ as well. Here is a graphical representation:
StijnDeVuyst's user avatar
  • 2,591
55 votes

Why is the mean of the natural log of a uniform distribution (between 0 and 1) different from the natural log of 0.5?

This is another illustration of Jensen's inequality $$\mathbb E[\log X] < \log \mathbb E[X]$$ (since the function $x\mapsto \log(x)$ is strictly concave] and of the more general (anti-)property ...
Xi'an's user avatar
  • 107k
54 votes
Accepted

Why is the mean of the natural log of a uniform distribution (between 0 and 1) different from the natural log of 0.5?

Consider two values symmetrically placed around $0.5$ - like $0.4$ and $0.6$ or $0.25$ and $0.75$. Their logs are not symmetric around $\log(0.5)$. $\log(0.5-\epsilon)$ is further from $\log(0.5)$ ...
Glen_b's user avatar
  • 286k
52 votes
Accepted

Brain-teaser: What is the expected length of an iid sequence that is monotonically increasing when drawn from a uniform [0,1] distribution?

Here are some general hints on solving this question: You have a sequence of continuous IID random variables which means they are exchangeable. What does this imply about the probability of getting a ...
Ben's user avatar
  • 129k
40 votes
Accepted

I've heard that ratios or inverses of random variables often are problematic, in not having expectations. Why is that?

I would like to offer a very simple, intuitive explanation. It amounts to looking at a picture: the rest of this post explains the picture and draws conclusions from it. Here is what it comes down to: ...
whuber's user avatar
  • 329k
40 votes

Example of a non-negative discrete distribution where the mean (or another moment) does not exist?

Here's a famous example: Let $X$ take value $2^k$ with probability $2^{-k}$, for each integer $k\ge1$. Then $X$ takes values in (a subset of) the positive integers; the total mass is $\sum_{k=1}^\...
37 votes
Accepted

Why should the frequency of heads in a coin toss converge to anything at all?

This is an excellent question, and it shows that you are thinking about important foundational matters in simple probability problems. The convergence outcome follows from the condition of ...
Ben's user avatar
  • 129k
36 votes
Accepted

Sample two numbers from 1 to 10; maximize the expected product

Hint: Note the relationship between $E[XY]$ and the covariance. Now think about the sign of the covariance - or if you prefer it in those terms, the sign of the correlation will work - under the two ...
Glen_b's user avatar
  • 286k
35 votes

Why are we using a biased and misleading standard deviation formula for $\sigma$ of a normal distribution?

For the more restricted question Why is a biased standard deviation formula typically used? the simple answer Because the associated variance estimator is unbiased. There is no real ...
GeoMatt22's user avatar
  • 13.1k
32 votes
Accepted

Why do we use the Greek letter μ (Mu) to denote population mean or expected value in probability and statistics

The letters that derive from $\mu$ include the Roman M and the Cyrillic М. Hence considering that the word "mean" starts with an $m$ the choice seems relatively straightforward given an already ...
Jesper for President's user avatar
32 votes

Let X,Y be 2 r.v. with infinite expectations, are there possibilities where min(X,Y) have finite expectation?

Take two positive iid Cauchy variates $Y_1,Y_2$ with common density $$f(x)=\frac{2}{\pi}\frac{\mathbb I_{x>0}}{1+x^2}$$ and infinite expectation. The minimum variate $\min(Y_1,Y_2)$ then has ...
Xi'an's user avatar
  • 107k
32 votes

Intuition of Random Walk having a constant mean

To see what is happening you need more than one realisation of the random walk, because the mean and variance are summaries of the distribution of the walk, not of any single realisation. This code ...
Thomas Lumley's user avatar
31 votes
Accepted

Deriving Bellman's Equation in Reinforcement Learning

There are already a great many answers to this question, but most involve few words describing what is going on in the manipulations. I'm going to answer it using way more words, I think. To start, $...
Finncent Price's user avatar
31 votes
Accepted

Why do we care more about test error than expected test error in Machine Learning?

Why do we care more about $\operatorname{Err}_{\mathcal{T}}$ than Err? I can only guess, but I think it is a reasonable guess. The former concerns the error for the training set we have right now. ...
Demetri Pananos's user avatar
29 votes
Accepted

What is the expected value of the logarithm of Gamma distribution?

This one (maybe surprisingly) can be done with easy elementary operations (employing Richard Feynman's favorite trick of differentiating under the integral sign with respect to a parameter). We are ...
whuber's user avatar
  • 329k
28 votes
Accepted

Why is the expected value named so?

Imagine that you are in Paris in 1654 and you and your friend are observing a gambling game based on sequential rolling of a six sided dice. Now, gambling is highly illegal and busts by the gendarme ...
Alex's user avatar
  • 4,452
27 votes
Accepted

How do I analytically calculate variance of a recursive random variable?

Call the next chests as $X_1,X_2$. With $0.4$ probability, our new variable is $X_1+X_2$ and with $0.6$ probability, it is $1$. So, $$\begin{align}E[X^2]&=0.4\times E[(X_1+X_2)^2]+0.6\times1^2\\&...
gunes's user avatar
  • 57.9k
26 votes
Accepted

Why is ln[E(x)] > E[ln(x)]?

Recall that $e^x\geq 1+x$ $E\left[e^{Y}\right]=e^{ E(Y)} E\left[e^{Y- E(Y)}\right]\geq e^{E(Y)} E\left[1+{Y- E(Y)}\right] = e^{E(Y)}$ So $e^{E(Y)}\leq E\left[e^{Y}\right] $ Now letting $Y=\ln X$, ...
Glen_b's user avatar
  • 286k
26 votes
Accepted

if 2 random variables have exactly same mean and variance

In short: No. There are several properties of a probability distribution that need not affect its mean and variance, but do determine its shape. Skew & Kurtosis For example, a Poisson ...
Frans Rodenburg's user avatar
25 votes

Can somebody offer an example of a unimodal distribution which has a skewness of zero but which is not symmetrical?

Here is one I found at https://www.qualitydigest.com/inside/quality-insider-article/problems-skewness-and-kurtosis-part-one.html# which I find nice and reproduced in R: an inverse Burr or Dagum ...
Christoph Hanck's user avatar
25 votes
Accepted

Average time ant needs to get out to the woods

$$T=7/3+(8+T)/3+(12+T)/3=9+2T/3$$ $$T/3=9$$ $$T=27$$ From start point, each of 3 paths are equally possible. Two paths lead you back to start point.
Don Slowik's user avatar
25 votes
Accepted

Expectation of the product of iid random variables

First, let's establish the correct identity. When $X_1, \ldots, X_N$ are independent variables with finite expectations $\mu_i=X_i,$ then by laws of conditional expectation, $$E\left[\prod_{i=1}^N X_i\...
whuber's user avatar
  • 329k
25 votes

Sample two numbers from 1 to 10; maximize the expected product

If you don't get to the smart covariance trick by Glen B, then you could also consider the following approach which is one level of abstraction lower Step 1: consider computing the hard way by adding ...
Sextus Empiricus's user avatar
25 votes
Accepted

Expectation of random sum of non-random numbers

The expectation $$ \mathbb E\left[\sum_{i=1}^{\lfloor\tau\rfloor} Y_i\right]=\mathbb E\left[\sum_{i=1}^{\infty} \mathbb I_{\tau\ge i} Y_i\right]$$simplifies into $$Y_1\underbrace{\mathbb P(\tau\ge 1)}...
Xi'an's user avatar
  • 107k
24 votes
Accepted

Correlation between sine and cosine

Since $$\begin{align} \operatorname{Cov}(Y, Z) &= E[(Y - E[Y])(Z - E[Z])] \\ &= E[(Y - {\textstyle \int}_0^{2\pi} \sin x \;dx)(Z - {\textstyle \int}_0^{2\pi} \cos x \;dx)] \\ &= E[(Y - 0)(...
Kodiologist's user avatar
  • 20.4k
24 votes

Let X,Y be 2 r.v. with infinite expectations, are there possibilities where min(X,Y) have finite expectation?

Let's find a general solution for independent variables $X$ and $Y$ having CDFs $F_X$ and $F_Y,$ respectively. This will give us useful clues into what's going on, without the distraction of ...
whuber's user avatar
  • 329k
23 votes

What is the expected value of the logarithm of Gamma distribution?

The answer by @whuber is quite nice; I will essentially restate his answer in a more general form which connects (in my opinion) better with statistical theory, and which makes clear the power of the ...
guy's user avatar
  • 8,962
23 votes
Accepted

What is a random variable and what isn't in regression models

This post is an honest response to a common problem in the textbook presentation of regression, namely, the issue of what is random or fixed. Regression textbooks typically blithely state that the $X$ ...
BigBendRegion's user avatar
22 votes
Accepted

Expectation of a function of a random variable from CDF

When $F$ is the CDF of a random variable $X$ and $g$ is a (measurable) function, the expectation of $g(X)$ can be found as a Riemann-Stieltjes integral $$\mathbb{E}(g(X)) = \int_{-\infty}^\infty g(x) ...
whuber's user avatar
  • 329k
22 votes
Accepted

Constructing example showing $\mathbb{E}(X^{-1})=(\mathbb{E}(X))^{-1}$

Let's construct all possible examples of random variables $X$ for which $E[X]E[1/X]=1$. Then, among them, we may follow some heuristics to obtain the simplest possible example. These heuristics ...
whuber's user avatar
  • 329k

Only top scored, non community-wiki answers of a minimum length are eligible