[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MATH] Random bar
Tuan V Nguyen <t.nguyen@garvan.unsw.edu.au> wrote:
> "A bar is broken at random in two places. Find the average size of
> the smallest of the middle-sized and the largest pices."
I guess the problem to be:
"A bar is broken at random in two places. Find the average size of the
smallest, the middle-sized and the largest pieces."
My solution for the 1st question:
---------------------------------
Let the length of the bar be 1. The chance of a piece to be the
smallest is the same among three, so the average size of the smallest
piece equals the average size of the left piece when it happens to be
the smallest.
The size of the left piece is a random variable, name the variable x.
About the breaks, we have: the first and the second and the left and
the right. For the size of the left piece to be x, one of the breaks
has to be x and the other has to be the right. When we have the first
condition the chance for the second is 1 - x. Hence the probability
density function of x is:
f(x) = 2(1 - x)
The reason for the coefficient 2 is that the left break can be the
first or the second. Two additional conditions for the left piece with
size x also to be the smallest are:
(1) x <= 1/3
(2) The right break doesn't make a piece less than x.
Assume other conditions are held, the chance of (2) is:
[(1 - x) - 2x] / (1 - x) = (1 - 3x) / (1 - x)
Hence we have the probability density function of the size of a piece
witch is both left and smallest:
f(x) = 2(1 - x) * [(1 - 3x) / (1 - x)] = 2(1 - 3x)
We come to the average ($ denotes integral):
a = [$_{0, 1/3}2(1 - 3x)x] / (1/3) = 6(x^2 / 2 + x^3) |_{0, 1/3}
= 1/9
@
The solutions for the 2 remaining questions should be similar. Please
send me those answers if you solve them. I attached here a simulation
program. It gives the answer of 0.111601 in my machine.
Thank you for fun problems. Have a nice weekend.
d~
/*---------------------------- sim.c -------------------------------*/
double drand48();
#define TIMES 1000
main()
{
double left_brk, right_brk, smallest, average, t;
int i;
average = 0;
for (i = 0; i < TIMES; i++) {
/* let break the bar */
left_brk = drand48();
right_brk = drand48();
/* make sure left_brk is the left */
if (left_brk > right_brk) {
t = left_brk;
left_brk = right_brk;
right_brk = t;
}
/* which is the smallest? */
smallest = left_brk;
if (smallest > right_brk - left_brk)
smallest = right_brk - left_brk;
if (smallest > 1 - right_brk)
smallest = 1 - right_brk;
average += smallest;
}
printf("%lf\n", average/TIMES);
}
/*---------------------------- sim.c -------------------------------*/