12

I'm a high school student, And I stumbled across this problem Q) if you arbitrarily choose 3 real positive numbers less than or equal to 2 What is the probability that their sum is less than or equal to 2?

In my course I have learnt to solve 2 number based probability problems by using the ratio of the areas plotted by their graphs. This was an application question that required me to plot it in 3 dimensions and find the ratio of their volumes to get the required probability, and so I managed to pull it off and got the required answer.

My question then arose... How do I deal with N dimensions? As I only have the knowledge to visualize 3 dimensions at my level of Math, Can anyone help me out?

I am really curious to see 1) the actual function and how it's growth is 2) the way you solve such kind of problems! (some kind of multivariable calculus??)

Thanks!

  • 4
    Familiar with integrals? The answer is $\frac18\int_0^2\int_0^2\int_0^2f(x,y,z)dxdydz$ where $f(x,y,z)$ is a function that takes value $1$ if $x+y+z<2$ and takes value $0$ otherwise. This time 3 variables. It works likewise with $n$ variables. I preassume here that the distribution is "uniform". See the answer of Lord Shark for a further explanation of that. – drhab Mar 19 '18 at 09:14
  • 3
    If we have $n$ independent, identicallt distributed random variables with mean $m$ and standard deviation $s$, then their sum is, for large $n$, roughly normal distributed with mean $mn$ and standard deviation $s\sqrt n$. This is called the central limit theorem (and can be formulated a lot more rigorously). So if you don't need an exact answer, and $n$ is large enough (I don't know what "large enough" means in this case), then that is usually a good place to start. – Arthur Mar 19 '18 at 09:15
  • @drhab thanks! I did solve the case for n=3 but I wanted a solution for a case where n is any integer – amay_varma Mar 19 '18 at 09:24
  • @Arthur thanks for the share! I did know a little bit about the central limit theorem.. I was more curious for stuff like n =4,5,6 though but still good to know! – amay_varma Mar 19 '18 at 09:46
  • @Arthur I'm sure "large enough" doesn't mean n=3 (unless you just want just an extremely rough hint). – Pere Mar 19 '18 at 10:19
  • I had solved for n =3, I needed for a general 'n' so it's alright I guess! In the middle of the post I had clarified that I could manage for the cases n=1 n=2 n=3, – amay_varma Mar 19 '18 at 10:20
  • You can use MathJax to format your posts. – gen-ℤ ready to perish Mar 19 '18 at 15:53

2 Answers2

13

This of course depends on how you choose the numbers.

We could assume $X_1$, $X_2$, $X_3$ are independent random variables each uniformly distributed on the interval $[0,2]$.

I'd rather consider $Y_1=X_1/2$ etc., and ask for the probability that $Y_1+Y_2+Y_3<1$. Then $(Y_1,Y_2,Y_3)$ is a point uniformly distributed in the unit cube $C$ (with vertices $(0,0,0)$, $(1,0,0)$, $(0,1,0)$ etc.) Of course $C$ has volume $1$, and the probability you seek is the volume of the tetrahedron $T$ with vertices $(0,0,0)$, $(1,0,0)$, $(0,1,0)$ and $(0,0,1)$.

Using the formula that the volume of a tetrahedron is a third of the area of the base times the height, then this is $1/6$.

In $n$ dimensions the probability is the $n$-volume of an $n$-simplex with vertices $(0,0,\ldots,0)$ and the $n$ standard unit vectors. You can compute its volume when you know that the volume of an $n$-simplex is $1/n$ times the $(n-1)$-volume of a face times the corresponding height.

Angina Seng
  • 158,341
  • Hey! Thanks alot i looked up what a simplex is, and I got what you meant roughly..if we define f(n) such that it denotes the probability for dimensions, Could you tell me if it would be true to say that f(n) = 1/g(n) where g(n) is a polynomial function of degree 2?? I just wanted to know that.. I'd do it myself but I can't as I coildnt understand exactly on how to calculate the volume of the nth simplex and I was just really curious if g(n) is a quadratic polynomial..so if you could answer it for me.. I'd be really grateful – amay_varma Mar 19 '18 at 09:21
  • 1
    @user543309 $g(n)$ is not a quadratic function, but it is a well-known function. Can you work out what $g(4)$ is? – Angina Seng Mar 19 '18 at 09:25
  • Okay let me try, I couldn't get the sentence "the (n-1)-volume of a......." if you can elaborate this I can try! Do you mean g4 is 1/4 times the volume of g3 * height of g4? – amay_varma Mar 19 '18 at 09:27
  • 1
    $1$-volume is length, $2$-volume is area, $3$-volume is ordinary volume, $4$-volume is the natural extension to four-dimensional things... @user543309 – Angina Seng Mar 19 '18 at 09:29
  • I got it!! You are talking about the factorial function yes?? – amay_varma Mar 19 '18 at 09:34
  • @user543309 Indeed! – Angina Seng Mar 19 '18 at 09:35
  • Sorry for acting stupid!! Thanks so muchhhh! – amay_varma Mar 19 '18 at 09:36
  • 4
    @user543309 Not stupid at all. You just did a nice piece of research/exploration with Lord Shark as a mentor. – Ethan Bolker Mar 19 '18 at 11:59
  • Thanks... This was the first time I ventured outside for a solution, as it was beyond the scope of my syllabus..and no one nearby could help me.. When you put it like that it makes me feel really nice! – amay_varma Mar 19 '18 at 12:36
1

I'm not a math guy or a statistician, but I'm an engineer. In engineering, often we don't care about the exact result achieved by integrating 4 times, but rather a way to just get close enough. Here is what I did to get close enough using python.

import random
# You can try changing this number.
n = 5

#a large number of trials. i.e. how many times we are going to 'roll the dice'?
trials = 500000 

successes = 0 # number of times the sum of n random numbers between 0 and 2 are less than 2
failures = 0 # number of times the sum of n random numbers between 0 and 2 are NOT less than 2

for i in range(0, trials): 
    #sum up n random numbers
    total = sum([random.uniform(0,2) for j in range(0,n)]) 

    # if the sum of our numbers is less than or equal to two, let's call it a success, otherwise a failure
    if total <= 2: successes += 1 
    else: failures += 1

# Finally, divide our number of successes by the total
probability = successes / (successes + failures) 
print("Approx. probability that {} random numbers between 0 and 2 sum up to be less than 2:".format(n), probability)

Output:

n = 2: 0.501466
n = 3: 0.167362
n = 4: 0.042046
n = 5: 0.008338
n = 6: 0.001262
n = 7: 0.000192
n = 8: 2.8e-05

Basically, the code above simulates 500,000 trials of the experiment and keeps track of how many successes and failures there are then divides the number of successes by the number of trials to estimate a probability.

  • 1
    While this would be a good answer on, perhaps, StackExchange, I don't think that it is a good answer here, for several reasons: (1) it is a wall of code, which is likely difficult for the average math student (let alone high school student) to understand; (2) there is no description of what the code does (other than in the comments of the code, which are non-obvious to the general reader, see (1); and (3) ... – Xander Henderson Mar 19 '18 at 23:42
  • ... (3) while numerical methods are often interesting, in mathematics one of the important questions about such methods is "do these methods necessarily converge to the correct result? how do we know?" You haven't addressed this issue at all, except, perhaps, by empirically showing that your method seems to converge to something. – Xander Henderson Mar 19 '18 at 23:43