Probability that one of a set of four points lies within the triangle formed by the other three

1,375

Solution 1

As the estimate answer is a bit long winded, I've posted this mathematical answer separately.

Given a random triangle in a circle, the chance of a random point landing in the triangle is the area of a triangle divided by the area of a circle.

So what we need is the average area of a triangle in a circle. The average area of a triangle for a unit disk (r=1) can be determined with the following formula as per Worlfram Disk Triangle Picking

$$A_t = \frac{35}{48 \pi} \approx 0.232100... $$

As we all know the area of a circle is

$$A_c = \pi r^2 $$

Because r=1 for a unit disk it is simplified to

$$A_c = \pi $$

So the chance of the fourth random dot landing in a random triangle is

$$p_4 = \frac{A_t}{A_c} = \frac{35}{48 \pi^2} \approx 0.07388003$$

However with four points we are forming four triangles, each point will have the same chance to land in the triangle formed by the three other points, so the probability is.

$$p = 4 \frac{A_t}{A_c} = 4 \frac{35}{48 \pi^2} = \frac{35}{12π^2} \approx 0.295520119$$

The above formula is only valid for

  1. A unit disk (r=1). I've not yet come across any proofs for the average area of a triangle in a circle with radius r. Does it increase at the same rate as the area of the circle at $r^2$?*

  2. Four random points only. The extended question asking for more points is not yet covered.

EDIT: Probability remains the same for all r > 0

Now I've looked at more than 4 points as well and generated sets of random points (100000 times) and tallied up how many points landed in a triangles. Some interesting results which I've not worked out the math for yet.

╔═════════════╦═════════╦═════════╦═════════╦═════════╦═════════╗
║      Points ║    4    ║    5    ║    6    ║    7    ║    8    ║
╠═════════════╬═════════╬═════════╬═════════╬═════════╬═════════╣
║ Triangles   ║    4    ║    10   ║    20   ║    35   ║    56   ║
║ Any         ║ 0.29845 ║ 0.64469 ║ 0.86461 ║ 0.96053 ║ 0.99096 ║
║ 0           ║ 0.70155 ║ 0.35531 ║ 0.13539 ║ 0.03947 ║ 0.00904 ║
║ 1           ║ 0.29845 ║ 0       ║ 0       ║ 0       ║ 0       ║
║ 2           ║ 0       ║ 0.54789 ║ 0       ║ 0       ║ 0       ║
║ 3           ║ 0       ║ 0       ║ 0.24551 ║ 0       ║ 0       ║
║ 4           ║ 0       ║ 0.0968  ║ 0.20193 ║ 0.08295 ║ 0       ║
║ 5           ║ 0       ║ 0       ║ 0.04365 ║ 0       ║ 0.02192 ║
║ 6           ║ 0       ║ 0       ║ 0.12658 ║ 0.12148 ║ 0       ║
║ 7           ║ 0       ║ 0       ║ 0.14877 ║ 0       ║ 0       ║
║ 8           ║ 0       ║ 0       ║ 0.06697 ║ 0.12974 ║ 0.02969 ║
║ 9           ║ 0       ║ 0       ║ 0.00447 ║ 0       ║ 0.01231 ║
║ 10          ║ 0       ║ 0       ║ 0.01476 ║ 0.16427 ║ 0.01963 ║
║ 11          ║ 0       ║ 0       ║ 0.0096  ║ 0       ║ 0.01344 ║
║ 12          ║ 0       ║ 0       ║ 0.00237 ║ 0.19293 ║ 0.01909 ║
║ 13          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.06144 ║
║ 14          ║ 0       ║ 0       ║ 0       ║ 0.11626 ║ 0.02674 ║
║ 15          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00612 ║
║ 16          ║ 0       ║ 0       ║ 0       ║ 0.08477 ║ 0.05515 ║
║ 17          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.05771 ║
║ 18          ║ 0       ║ 0       ║ 0       ║ 0.04646 ║ 0.05092 ║
║ 19          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.04256 ║
║ 20          ║ 0       ║ 0       ║ 0       ║ 0.01522 ║ 0.04368 ║
║ 21          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.07326 ║
║ 22          ║ 0       ║ 0       ║ 0       ║ 0.00392 ║ 0.05944 ║
║ 23          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.03105 ║
║ 24          ║ 0       ║ 0       ║ 0       ║ 0.00192 ║ 0.0459  ║
║ 25          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.06104 ║
║ 26          ║ 0       ║ 0       ║ 0       ║ 0.00061 ║ 0.04756 ║
║ 27          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.02972 ║
║ 28          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.03464 ║
║ 29          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.03928 ║
║ 30          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.02749 ║
║ 31          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.01559 ║
║ 32          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.01359 ║
║ 33          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.01606 ║
║ 34          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.01174 ║
║ 35          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00531 ║
║ 36          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00451 ║
║ 37          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00515 ║
║ 38          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00333 ║
║ 39          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00132 ║
║ 40          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00119 ║
║ 41          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00121 ║
║ 42          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.0009  ║
║ 43          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00036 ║
║ 44          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00014 ║
║ 45          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00025 ║
║ 46          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00017 ║
║ 47          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00009 ║
║ 48          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.0001  ║
║ 49          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.0001  ║
║ 50          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00006 ║
║ 51          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0.00001 ║
║ 52          ║ 0       ║ 0       ║ 0       ║ 0       ║ 0       ║
╚═════════════╩═════════╩═════════╩═════════╩═════════╩═════════╝

Solution 2

I'm posting this code to numerically compute the answer as community wiki as a response to @Dijkgraaf's post. It gives values

average area =  0.23156136586256632
probability of hitting =  0.0737082720122766
rejected =  81491 3.1455525818433463

Here is the code (Google Go language):

package main

import (
    "fmt"
    "math/rand"
    "math"
)

var rejected int = 0
var calls int = 0

type point struct {
    x float64
    y float64
}

func rpoint() point {
    var p point
tryagain:
    calls++
    p.x = 2.0*rand.Float64()-1.0;
    p.y = 2.0*rand.Float64()-1.0;
    len := p.x*p.x + p.y*p.y
    if len > 1.0 {
        rejected++
        goto tryagain;
    }
    return p
}

func lensq(p1 point, p2 point) float64 {
    x := p1.x - p2.x
    y := p1.y - p2.y
    l := math.Sqrt(x*x + y*y)
    return l
}

func area(p1 point, p2 point, p3 point) float64 {
    a := lensq(p1, p2)
    b := lensq(p3, p2)
    c := lensq(p3, p1)
    s := (a + b + c)/2.0
    hero := math.Sqrt(s*(s-a)*(s-b)*(s-c))
    return hero
}

func main() {
    max := 100000
    total := 0.0
    for test := 0; test < max; test++ {
        p1 := rpoint()
        p2 := rpoint()
        p3 := rpoint()
        a := area(p1, p2, p3)
        total += a
    }
    fmt.Println("average area = ",total/(float64(max)))
    fmt.Println("probability of hitting = ",total/(float64(max)*math.Pi))
    // As a check, see if we get a value close to PI here.
    fmt.Println("rejected = ", rejected, 4.0*float64(calls-rejected)/float64(calls))
}

Solution 3

I know this isn't a mathematical proof yet, but it can give an approximate answer to the probability by using a large random data set.

So first lets have a method of randomly generating a number in a circle as per this Disk Point Picking formula.

Defining $r \in [0,1]$ and $\theta \in [0,2\pi]$ we can use

$$x = \sqrt{r} \cos \theta$$

$$y = \sqrt{r} \sin \theta$$

Using that to generate 4 sets of random points we then have to calculate if one of them is in the triangle of the other three points. For this I used the answer to the question determine whether point lies inside triangle which advised using barycentric coordinates

Defining $p$ as the point to check and $p_1$, $p_2$, $p_3$ to points to check against it gave the following formula.

$$\alpha = \frac{(p_2.y - p_3.y)\cdot (p.x - p_3.x) + (p_3.x - p_2.x)\cdot (p.y - p_3.y)}{(p_2.y - p_3.y)\cdot (p_1.x - p_3.x) + (p_3.x - p_2.x)\cdot (p_1.y - p_3.y)}$$

$$\beta = \frac{((p_3.y - p_1.y)\cdot (p.x - p_3.x) + (p_1.x - p_3.x)\cdot (p.y - p_3.y))}{((p_2.y - p_3.y)\cdot (p_1.x - p_3.x) + (p_3.x - p_2.x)\cdot (p_1.y - p_3.y))}$$

$$\gamma = 1.0 - \alpha - \beta$$

If $\alpha$, $\beta$ and $\gamma$ are all greater than zero than the point is within the triangle.

You then have to do the same thing for the other 3 points.

I then ran it 200 times and recorded each time whether one of the points was within the triangle of the other three and got an overall average of 32% (Note: See Edit 2 where we run over more iteration using Google Go code and get around 29.5%, also the Go Code uses a rejection sampling method to generate x and y rather than Disk Point Picking)

EDIT:

As my result has been challenged I will add more details as to what I believe the original question is asking, and how I achieved my results.

I actually set it up in an Excel spreadsheet so not only could I calculate things, I could graphically see if the results were correct at the same time.

Below is what the spreadsheet is looks like Excel spreadsheet showing in triangle And this the graph showing the same four points with 4 inside the triangle of points 1 through 3 Graph showing in triangle

Here is what the formulas in the spreadsheet are.

The Radius & Random column both just contain =RAND()

For the Omega Column the first cell contains =C3*2*PI() i.e. $Random*2*\pi$ and this copied down for the other three cells.

For the x column the first cell contains =SQRT(B3)*COS(D3) and again copied down

For the y column the first cell contains =SQRT(B3)*SIN(D3) and again copied down

I then defined the x and y columns with names of p1.x, p1.y, p2.x, p2.y etc. this is so I could easily use the barycentric coordinates formula and update them for each point.

For the alpha

(G3) =((p3.y - p4.y)*(p1.x - p4.x) + (p4.x - P3.x)*(p1.y - p4.y)) / ((p3.y - p4.y)*(P2.x - p4.x) + (p4.x - P3.x)*(p2.y - p4.y))

(G4) =((p3.y - p4.y)*(P2.x - p4.x) + (p4.x - P3.x)*(p2.y - p4.y)) / ((p3.y - p4.y)*(p1.x - p4.x) + (p4.x - P3.x)*(p1.y - p4.y))

(G5) =((p1.y - p4.y)*(P3.x - p4.x) + (p4.x - p1.x)*(p3.y - p4.y)) / ((p1.y - p4.y)*(P2.x - p4.x) + (p4.x - p1.x)*(p2.y - p4.y))

(G6) =((p3.y - p1.y)*(p4.x - p1.x) + (p1.x - P3.x)*(p4.y - p1.y)) / ((p3.y - p1.y)*(P2.x - p1.x) + (p1.x - P3.x)*(p2.y - p1.y))

For beta

(H3) =((p4.y - p2.y)*(p1.x - p4.x) + (P2.x - p4.x)*(p1.y - p4.y)) / ((p3.y - p4.y)*(P2.x - p4.x) + (p4.x - P3.x)*(p2.y - p4.y))

(H4) =((p4.y - p1.y)*(P2.x - p4.x) + (p1.x - p4.x)*(p2.y - p4.y)) / ((p3.y - p4.y)*(p1.x - p4.x) + (p4.x - P3.x)*(p1.y - p4.y))

(H5) =((p4.y - p2.y)*(P3.x - p4.x) + (P2.x - p4.x)*(p3.y - p4.y)) / ((p1.y - p4.y)*(P2.x - p4.x) + (p4.x - p1.x)*(p2.y - p4.y))

(H6) =((p1.y - p2.y)*(p4.x - p1.x) + (P2.x - p1.x)*(p4.y - p1.y)) / ((p3.y - p1.y)*(P2.x - p1.x) + (p1.x - P3.x)*(p2.y - p1.y))

For gamma the first cell contains =1-G3-H3 and copied down

For in triangle the first cell contains =IF(G3<=0,0,IF(H3<=0,0,IF(I3<=0,0,1))) and copied down

For (J7) =SUM(J3:J6)

And if you are wondering about the Plot section, that was just so I could get the graph to draw each line independently making it possible to work out which point is which visually. I also have another section of static data, which is not shown, to draw the circular line.

Here is another example of one of the points being within the other three, in this case point #2

Point 2 numbers Point 2 graphics

And here is an example of no points falling with the triangles.

Not in numbers Not in graphic

Because the RAND() causes the values to change each time, I set up a table with rows 1-10 and columns 1-10 and record the result 0 or 1 in each cell. Then afterwards you can just get an average of them to determine the percentage of ones where one of the points is in the triangle of the other three points. Very manual I know but it allows you to visibly check the results each time.

Please feel free to reproduce this, or if you like I can publish the spreadsheet so you can download it.

EDIT2

And here is the Google GO code altered to actually generate 4 points and test all four points. Note; Running this over 1000 iterations gets closer to 29.5% which is probably more accurate.

EDIT3
Seeded the random number generation, without it you get exactly the same results each time.

Note: The Total probability of hitting a triangle is probably not accurate as it doesn't account for any overlap of any of the triangles (e.g. when one point is inside the triangle of the other three).

package main

import (
    "fmt"
    "math/rand"
    "math"
    "time"
)

var rejected int = 0
var calls int = 0

type point struct {
    x float64
    y float64
}

func rpoint() point {
    var p point
tryagain:
    calls++
    p.x = 2.0*rand.Float64()-1.0;
    p.y = 2.0*rand.Float64()-1.0;
    len := p.x*p.x + p.y*p.y
    if len > 1.0 {
        rejected++
        goto tryagain;
    }
    return p
}

func lensq(p1 point, p2 point) float64 {
    x := p1.x - p2.x
    y := p1.y - p2.y
    l := math.Sqrt(x*x + y*y)
    return l
}

func area(p1 point, p2 point, p3 point) float64 {
    a := lensq(p1, p2)
    b := lensq(p3, p2)
    c := lensq(p3, p1)
    s := (a + b + c)/2.0
    hero := math.Sqrt(s*(s-a)*(s-b)*(s-c))
    return hero
}

func intriangle(p point, p1 point, p2 point, p3 point) int {
 alpha := ((p2.y - p3.y)*(p.x - p3.x) + (p3.x - p2.x)*(p.y - p3.y)) / ((p2.y - p3.y)*(p1.x - p3.x) + (p3.x - p2.x)*(p1.y - p3.y))
 beta := ((p3.y - p1.y)*(p.x - p3.x) + (p1.x - p3.x)*(p.y - p3.y)) /  ((p2.y - p3.y)*(p1.x - p3.x) + (p3.x - p2.x)*(p1.y - p3.y))
 gamma := 1.0 - alpha - beta

 isin := 1

 if (alpha <= 0) {
    isin = 0
 }

 if (beta <= 0) {
    isin = 0
 }

 if (gamma <= 0) {
    isin = 0
 }

 return isin

}

func main() {
    max := 100000 
    total := 0.0 
    total2 := 0.0 // Needed for the other triangles with 4 points
    total3 := 0.0
    total4 := 0.0

    point1intotal := 0
    point2intotal := 0
    point3intotal := 0
    point4intotal := 0

    rand.Seed(time.Now().UTC().UnixNano())

    for test := 0; test < max; test++ {
        p1 := rpoint()
        p2 := rpoint()
        p3 := rpoint()
        p4 := rpoint()
        a := area(p1, p2, p3)
        total += a
        a2 := area(p2, p3, p4)
        total2 += a2
        a3 := area(p2, p4, p1)
        total3 += a3
        a4 := area(p4, p1, p3)
        total4 += a4

        point1intotal += intriangle(p1, p2, p3, p4)
        point2intotal += intriangle(p2, p1, p3, p4)
        point3intotal += intriangle(p3, p1, p2, p4)
        point4intotal += intriangle(p4, p1, p2, p3)
    }
    fmt.Println("average area triangle 1 = ",total/(float64(max)))
    fmt.Println("average area triangle 2 = ",total2/(float64(max)))
    fmt.Println("average area triangle 3 = ",total3/(float64(max)))
    fmt.Println("average area triangle 4 = ",total4/(float64(max)))

    // Lets calcuate the probabilities outside of the Print so we can add them
    probability1 := total/(float64(max)*math.Pi)
    probability2 := total2/(float64(max)*math.Pi)
    probability3 := total3/(float64(max)*math.Pi)
    probability4 := total4/(float64(max)*math.Pi)

    // Add the probabilities & points in triangle
    totalprobability := probability1 + probability2 + probability3 + probability4
    totalintriangle := point1intotal + point2intotal + point3intotal + point4intotal 

    fmt.Println("probability of hitting triangle 1= ",probability1)
    fmt.Println("probability of hitting triangle 2 = ",probability2)
    fmt.Println("probability of hitting triangle 3 = ",probability3)
    fmt.Println("probability of hitting triangle 4 = ",probability4)
    fmt.Println("Total probability of hitting a triangle = ",totalprobability)

    // As a check, see if we get a value close to PI here.
    fmt.Println("rejected = ", rejected, 4.0*float64(calls-rejected)/float64(calls))

    fmt.Println("Point 1 in triangle= ",point1intotal)
    fmt.Println("Point 2 in triangle= ",point2intotal)
    fmt.Println("Point 3 in triangle= ",point3intotal)
    fmt.Println("Point 4 in triangle= ",point4intotal)
    fmt.Println("Total Points in triangle= ",totalintriangle)
    fmt.Println("Total percentage in triangle= ",float64(totalintriangle)/(float64(max)))

}

Results

average area triangle 1 =  0.23174344583609957
average area triangle 2 =  0.23199478541566787
average area triangle 3 =  0.2325415159584758
average area triangle 4 =  0.23231070178729094
probability of hitting triangle 1=  0.07376622986792832
probability of hitting triangle 2 =  0.07384623374089419
probability of hitting triangle 3 =  0.07402026347774858
probability of hitting triangle 4 =  0.07394679304518911
Total probability of hitting a triangle =  0.29557952013176025
rejected =  108797 3.144672629752141
Point 1 in triangle=  7505
Point 2 in triangle=  7361
Point 3 in triangle=  7300
Point 4 in triangle=  7299
Total Points in triangle=  29465
Total percentage in triangle=  0.29465

EDIT 4

Given a triangle in a circle, the chance of a random point landing in the triangle is the area of a triangle divided by the area of a circle.

Area of triangle = $\lvert P1.x*(p2.y-p3.y)+P2.x*(p3.y-P1.y)+P3.x*(P1.y-p2.y) \rvert \over 2$

Area of a circle = $\pi r^2$

So probability = $\lvert P1.x*(p2.y-p3.y)+P2.x*(p3.y-P1.y)+P3.x*(P1.y-p2.y) \rvert \over 2 \pi r^2$

Lets say we have a triangle with

$P_1(x,y)=(-0.5,0)$

$P_2(x,y)=(0.5,0)$

$P_3(x,y)=(0,0.1)$

Then there are four areas the fourth points can land it so that one of the points is in a triangle. The additional areas are those where if you extend the lines of the original triangle so that they intersect the circle. The areas that lie between the point and the circle will also cause a triangle to form with one of the points in it. The blue area for point 1, the yellow for point 2 and the pink for points 3.

Known triangle

This is most clearly shown with point 3 in triangle formed by points 1,2 & 4 Point 3 in triangle

So we have to add those three areas to the triangular area to work out the probability.

However that is rather complicated as you would have to work out the intersections to the circle and work out the average size of pie shaped areas. There is an easier approach for, see my other answer which gives the mathematics.

Share:
1,375

Related videos on Youtube

Doug Couchman
Author by

Doug Couchman

I'm a test-prep teacher (MCAT/LSAT/GMAT/GRE/DAT and so on) whose technical background is, in theory, inadequate to be teaching some of those subjects, but I've picked it up over the years; I love to muse over just about everything, which is why I'm here.

Updated on August 01, 2022

Comments

  • Doug Couchman
    Doug Couchman over 1 year

    Given four points, each randomly chosen with a uniform probability distribution in the interior of a (WLOG unit) circle, what is the probability that (any) one of the points lies within the triangle formed by the other three. This is (meant to be) equivalent to asking what is the probability, given these four random points, that one can form two "layers" of triangles, with for example ABC covered by (though sharing a side with) ABD because C lies in the interior of ABD.

    Ideally, the method of solution would be generalizable to numbers of points greater than four; in other words, given (3+n) points (for n>1), each randomly chosen with a uniform probability within the interior of a circle, what is the probability that one can form n+1 layers. (I'm having trouble stating the generalized problem precisely; I hope it's clear.)

    Edit to add: In case anyone is curious about whence the problem comes: it was inspired by Ingress, an enhanced reality game run by Google wherein players go to and link predesignated geographic points to form "fields", which are simply completed triangles but which are limited by the rule that links can never cross each other. In the game it is often advantageous to form layers of fields, the simplest case of which, for four points, is what I describe in the first paragraph and the most efficient general case (n-2 overlapping fields out of n points) I allude to in the second. I've seen and heard many comments by players about how often such overlapping fields can be formed, but I've never seen anything approaching a definitive answer to it.

    Note that this means the question I really wanted to ask is the same one but for points on the surface of a sphere, not a portion of a flat plane, but almost all fields in the game are quite small relative to the Earth (though not all; on rare occasions, fields with edge lengths of thousands of kilometers are formed; the great majority are tens or hundreds of meters) so the answer to the question I posed will be a very good approximation.

    • Dijkgraaf
      Dijkgraaf almost 9 years
      And also what happens if some of the dots are collinear? As discussed in the answer here math.stackexchange.com/questions/455691/…
    • Dijkgraaf
      Dijkgraaf almost 9 years
      Also you may have to define the method of generating the random points, otherwise you may find you run into something similar to the Bertrand paradox en.wikipedia.org/wiki/Bertrand_paradox_(probability)
    • Gregory J. Puleo
      Gregory J. Puleo almost 9 years
      It's perfectly well-defined to say that you're choosing the points at uniform random within the unit circle. Under that distribution, it seems like the probability of getting 3 collinear points should be 0 no matter how many points you're placing, so it doesn't much matter how you treat collinear points.
    • Suzu Hirose
      Suzu Hirose almost 9 years
      Basically you are calculating the area of a triangle with three uniformly distributed points within a triangle, and dividing that area by $\pi r^2$.
    • Doug Couchman
      Doug Couchman almost 9 years
      I don't think that's quite true; I think that's part of the problem, but not the whole thing. The question isn't "What's the probability a randomly chosen point lies inside a triangle formed by three other randomly chosen points" (with appropriate stipulations about range and distribution), which, you're correct, would be equivalent to the area problem. Because I start with all four points, I think we need to check all four possibilities, and the fact that (say) A doesn't lie in BCD affects the probability that (say) B lies in ACD.
    • joriki
      joriki over 7 years
      For the case of more points, you might be interested in this question.
  • Suzu Hirose
    Suzu Hirose almost 9 years
    Doing it numerically, I get about 0.074 probability that the fourth point is within the triangle. 32% is very counterintuitive and I would guess wrong. We are dividing the circle into seven pieces using the three lines through three points. At least half of the time we are on the smaller half of a line dividing the circle in two, and then we are dividing that in two again, twice. At a wild guess the central triangle will not be occupying 34% of the space on average. You should post the codes you used to compute this value.
  • Suzu Hirose
    Suzu Hirose almost 9 years
    Further, the maximum possible value for the probability is the area of an equilateral triangle inscribed in the circle divided by the area of the circle $= {\sqrt3\times3/2\times1/2\over\pi r^2}\approxeq0.41$ so the 34% figure seems extremely unlikely to me.
  • Dijkgraaf
    Dijkgraaf almost 9 years
    The probability is that ANY of the four points lie withing the triangle of the other three, so that would be 0.074 * 4 = 0.296 So not too far off.
  • Dijkgraaf
    Dijkgraaf almost 9 years
    You might want to re-read the question. "what is the probability that (any) one of the points lies within the triangle formed by the other three" What you are showing there is the chance of the 4th point landing in first three.
  • Doug Couchman
    Doug Couchman almost 9 years
    But won't the answer actually be different from (and probably greater than) four times the ~0.074, because there will be a positive correlation between one point not lying in the other three's triangle, and that point being, for example, farther away? Consider one aspect of it: the "outside" triangle must be composed in part of the longest of the six line segments; if for the initial attempt (say A into BCD) this isn't true (the segment A-something is the greatest), then the initial test fails but a subsequent part of the test is more likely to succeed.
  • Dijkgraaf
    Dijkgraaf almost 9 years
    @DougCouchman Possibly, which is why I didn't start of with Suzu Hirose's method of only looking at a random triangle, calculating it's area and dividing by the area of the circle and getting the average. I actually generated four random points and checked each point against the other three points to see it it was in the triangle of the other three points.
  • mjqxxxx
    mjqxxxx almost 9 years
    @DougCouchman: The four possibilities ($D$ is inside $ABC$, $A$ is inside $BCD$, etc.) are equally likely and mutually exclusive, so the probability that any of them is true is just $4$ times the probability that a particular one of them is true.
  • mjqxxxx
    mjqxxxx almost 9 years
    So it's $35/(12\pi^2)$. Nice. Certainly the probability doesn't depend on the radius of the circle; the problem differs only by an overall scale factor if $r \neq 1$.