Problem 331. Compute Area from Fixed Sum Cumulative Probability
In Matlab the code
v = rand(1,3);
v = v/sum(v);
is sometimes suggested as a convenient means of generating three random variables, whose ranges are restricted to [0,1], which have a fixed sum of one. However, this procedure has the property that the area-wise density distribution of the three values, considered as cartesian coordinates in 3D space, is widely variable throughout the planar region of possible locations of v. For any given density value in the range of this density distribution, let A be the corresponding area of the subregion of all points whose density is less than or equal to this given value, and let P be the corresponding probability that v would lie in this subregion. The task is to write a function 'fixedsumarea' which receives P as an input and gives A as an output:
A = fixedsumarea(P);
You should assume that initially 'rand(1,3)' perfectly generates three independent random variables each uniformly distributed on [0,1], but subsequently each is modified by being divided by their mutual sum.
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Raphael Cautain
on 26 Feb 2012
A really nice problem : concrete origin, careful formulation, then a good walk in 3D geometry, analysis, integration and at the end a single formula. The critical value cuts the triangle in four pieces : my son said it was Zelda !
David Young
on 26 Feb 2012
Raphael: I agree completely!
Alfonso Nieto-Castanon
on 26 Feb 2012
Perhaps you could have a precision requirement a bit more liberal in order to allow numerical approximation algorithms or other approaches as well? just my two cents, the problem looks great
Rafael S.T. Vieira
on 30 Jul 2020
Tip: the probability grows from the vertices of simplex (triforce/triangle) toward its center (which has the highest frequency).
Kapil Pariya
on 4 Mar 2024
.
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
-
1718 Solvers
-
304 Solvers
-
77 Solvers
-
383 Solvers
-
Magic is simple (for beginners)
9187 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!