# Probability of a randomly selected line segment from a longer line being "x metres"?

• Sep 5th 2009, 02:48 PM
charleschafsky
Probability of a randomly selected line segment from a longer line being "x metres"?
Hello,
I am performing this problem as an exercise in computer science, but the mathematical knowledge required has me stumped. I have been away from statistics for a few years now, so this is shady to me. Here's the essence of the problem:

I have a 100 metre long line segment. I am going to give it "a" possible locations on the line segment where a "cut" may occur. Think of it like a long piece of string, and I am drawing on with a marker "a" spots where I might want to cut the string. Now, I pick a length, say "b" that I want at least one piece of string to be after I cut it. I will be cutting it in exactly two places and there will always be at least two and no more than 50 spots in "a".

What is the probability that, given equal chance for each mark in "a", at least one slice of string is of length "b" after cutting the string in two locations?

My apologies if this is unclear. I tried to keep things as clear as possible. Thanks in advance! :)
• Sep 5th 2009, 05:46 PM
awkward
Quote:

Originally Posted by charleschafsky
Hello,
I am performing this problem as an exercise in computer science, but the mathematical knowledge required has me stumped. I have been away from statistics for a few years now, so this is shady to me. Here's the essence of the problem:

I have a 100 metre long line segment. I am going to give it "a" possible locations on the line segment where a "cut" may occur. Think of it like a long piece of string, and I am drawing on with a marker "a" spots where I might want to cut the string. Now, I pick a length, say "b" that I want at least one piece of string to be after I cut it. I will be cutting it in exactly two places and there will always be at least two and no more than 50 spots in "a".

What is the probability that, given equal chance for each mark in "a", at least one slice of string is of length "b" after cutting the string in two locations?

My apologies if this is unclear. I tried to keep things as clear as possible. Thanks in advance! :)

If I understand your problem correctly (no guarantee of that), here is what I think you need to do.

Number the points on the string from 1 to $a$. Let's say the distance from the left end of the string to point i is $x_i$.

Define three $a$ by $a$ matrices L, M, and R as follows:

$L_{ij} = min(a_i, a_j)$ ... the length of the left end of the string if points i and j are chosen
$M_{ij} = |a_i - a_j|$ ... the length of the middle segment
$R_{ij} = 100 - max(a_i, a_j)$ ... the length of the right end of the string

Given a value $b$, compute
$N(b) = \sum_{i=1}^a \sum_{j=1}^a d_{ij}(b)$
where
$d_{ij}(b) = 1$ if $L_{ij} = b$ or $M_{ij} = b$ or $R_{ij} = b$, 0 otherwise.

Then, assuming all $a^2$ pairs of points (i,j) are equally likely to be chosen, the probability of occurrence of $b$ is $N(b) / a^2$.