# 3AM stats quiz

post by PhilGoetz · 2015-08-22T07:45:35.649Z · LW · GW · Legacy · 9 comments

Because I'm tired and easily amused.

1. Consider two independent, normally-distributed variables X and Y, each with a mean of 0.
• X has a standard deviation of 4.
• Y has a standard deviation of 1.
2. Consider the probability distribution function (in two dimensions) for <X, Y>.
3. Imagine contour lines on the PDF connecting points of equal probability density.  These would be a series of concentric ellipses.
4. Draw the contour line that is tangent to the line X = 4.
5. What values of Y does it pass through when X = 0?
7. Run this R code to plot the contours:

library(mvtnorm)
bivn <- mvrnorm(100000, mu = c(0, 0), Sigma = matrix(c(4, 0, 0, 1), 2, 2))
bivn.kde <- kde2d(bivn[,1], bivn[,2], n = 100)

comment by gjm · 2015-08-22T11:52:33.880Z · LW(p) · GW(p)

The ellipses of constant probability density are (x/4)^2 + y^2 = constant. The one tangent to x=4 is tangent at (4,0) so it's (x/4)^2 + y^2 = (4/4)^2 = 1. When x=0 this means y^2 = 1, so it passes through y=+-1.

I confess that it doesn't seem particularly amusing.

Replies from: PhilGoetz
comment by PhilGoetz · 2015-08-22T12:27:13.162Z · LW(p) · GW(p)

You're right, and I'm wrong. It was 3AM. It was amusing only because I had convinced myself from some graphs that the answer wasn't y=+-1, which I'd been fairly certain it ought to be.

comment by Elo · 2015-08-22T10:07:02.331Z · LW(p) · GW(p)

Apologies; I get lost at step 3. Probably because I don't know stats that well. Hope this feedback helps.

Replies from: None
comment by [deleted] · 2015-08-22T10:43:35.697Z · LW(p) · GW(p)

I guess, what is meant by (I could be wrong though) is the joint probability distribution of X and Y which would look something like this but centered at the origin and there would be a surface where the height represents the probability density. (Also, ignore that the ellipse in this visualization is oddly rotated.) The contour lines are the ellipses you get by slicing the surface with a horizontal plane.

Replies from: Elo
comment by Elo · 2015-08-22T11:08:17.934Z · LW(p) · GW(p)

That picture helps. Clarification: Now after step 3; Tangent in which plane? (I worked it out) turns out I didn't know what, " contour line" or precisely what "tangent" meant. (I guess I am rusty on my math)

Given that X and Y are values of unknown magnitudes; is this possible? (I suspect if I think about it for a day it will come to me)

comment by Epictetus · 2015-08-22T12:03:07.249Z · LW(p) · GW(p)

Used rot13 to avoid spoilers:

K unf qrafvgl N rkc(-k^2 / 32) jurer N = 1/(4 fdeg(2*cv))

L unf qrafvgl O rkc(-l^2 / 2) jurer O = 1/fdeg(2cv)

Fvapr gurl'er vaqrcraqrag gur wbvag qrafvgl vf gur cebqhpg bs gur vaqvivqhny qrafvgvrf, anzryl NO * rkc(-k^2 / 32 - l^2 / 2). Urapr, gur pbagbhe yvarf fngvfsl -k^2 / 32 - l^2 / 2 = pbafgnag. Nofbeovat gur artngvir vagb gur pbafgnag, jr trg k^2 / 32 + l^2 / 2 = pbafgnag, juvpu vf na ryyvcfr jvgu nkrf cnenyyry gb gur pbbeqvangr nkrf.

Guvf vf gnatrag gb gur yvar K = 4 ng gur cbvag (4,0). Fhofgvghgvat vagb gur rdhngvba sbe gur ryyvcfr, jr svaq gung gur pbafgnag vf 1/2, fb k^2 / 32 + l^2 / 2 = 1/2. Frggvat k = 0 naq fbyivat sbe l, jr svaq gung l = 1.

Replies from: gjm, PhilGoetz
comment by gjm · 2015-08-22T12:52:46.374Z · LW(p) · GW(p)

Small quibble: +- at the end.

[EDITED to be less spoilery.]

Replies from: Epictetus
comment by Epictetus · 2015-08-22T12:56:06.159Z · LW(p) · GW(p)

Of course. I seem to have overlooked that.

comment by PhilGoetz · 2015-08-22T12:29:39.814Z · LW(p) · GW(p)

You're right. That's what I expected, but not the answer I was getting. I was plotting bivariate distributions, it was 3AM, and a parameter that I thought was a standard deviation was a variance.