Archive for June, 2013

Analytical solution to the chance of forming a triangle

June 15, 2013

Let’s consider each side one at a time. Let’s begin with side a. If a is the longest side it means that b+c > a. That means that the two opposite sides together must be longer. If they are not, then a triangle is not formed.  When a = b+c it means that the opposite sides just touch and the 3 line segments overlap to form a single line segment. When a > b+c, the ends cannot touch to form a triangle.

For simplicity we used the interval [0,1]. Thus a can be anything from 0 to 1. For any given a we can draw a plot of the line a = b+c. This line separates the two regions of success and failure. The line intercepts the b-axis at a and the c-axis at a. The failure area is a triangular region that runs from (0, 0) to (a,0) and then to (0, a). When a is a maximum, i.e. 1, then the area is 1/2. The failure volume is a 3-sided pyramid with height = 1 and base = 1/2. Thus the volume of the failure region is 1/3Bh = 1/3(1/2)1 = 1/6.

The volume of the entire solution space = 1, the volume of a cube of side 1. The volume of the failure region for a = 1/6. The same is true of the failure region for b and c.

Thus the volume of the success region = 1 – 3(1/6) = 1/2

The probability of success = V(success)/V(all possibilities) = (1/2)/1 = 1/2

A simple problem to illustrate a random geometry problem

June 14, 2013

Stereology works because the properties of interacting geometrical shapes are known.

Consider the following problem. Pick 3 random numbers from the same interval. Think of these as lengths. Can a triangle be formed from the 3 selected numbers? What is the chance that the 3 lengths selected at random can form a triangle?

Some parts of the problem need to be clarified. An interval begins with zero. It includes all numbers up to a maximum. The interval 0 to 10 fits our needs as does the interval 0 to 1. For simplicity, the interval from 0 to 1 is used. The maximum number of the interval has no effect on the solution. The numbers are chosen at random, but also chosen such that all numbers are chosen with equal probability. This means that no number is more likely to be picked than any other. So small numbers are as likely to be chosen as large numbers.

To form a  triangle, the lengths must be such that the two sides opposite any given side can touch. For example, a triangle cannot be formed from pieced 1, 3, and 5 in length. The 1 and 3 lengths cannot touch each other. They add up to only a length of 4 and the third side has a length of 5.

If the sides of the triangle have lengths a, b, and c, then the following 3 rules must be true.

a+b > c     a+c > b     b+c > a

Those tests must be applied to the 3 randomly selected numbers. If all of the tests are true, then the numbers can form a  triangle.

Before a simple analytical solution is offered, it might occur to people to write a simple program to determine the odds. What is interesting in this effort is that the program never obtains the correct answer, nor will it converge to the correct answer if run long enough. The reason was mentioned above. The random numbers need to be selected with equal probability from the interval. Computer pseudorandom number generators do not do that. They are fairly good, but not good enough. The random number generators available in the C language or the .NET framework or even in Matlab are not uniform enough for the program to eventually converge. Still you get an answer close enough to the correct value to be able to guess what it likely is.

The analytical solution will be posted shortly.