Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Random Triangle Problem
Replies: 57   Last Post: Aug 17, 1997 10:51 PM

 Messages: [ Previous | Next ]
 Robert Hill Posts: 529 Registered: 12/8/04
Re: Random Triangle Problem
Posted: Aug 4, 1997 8:31 AM

In article <33E254FD.7B33@virginia.edu>, "Charles H. Giffen" <chg4k@virginia.edu> writes:
> Bill Taylor wrote:
> >
> > eclrh@sun.leeds.ac.uk (Robert Hill) writes of some fascinating simulation data!
> >
> > |> I generated 1 million pseudo-random triangles
> >
> > |> (1) vertices independent uniform inside a square:
> > |> obtuse at first vertex at second at third all acute
> > |> 241781 241998 241802 274419
> > |>
> > |> (2) vertices independent uniform inside a circle:
> > |> 248534 248198 248619 254649
> > |>
> > |> (3) vertices independent uniform inside an equilateral triangle:
> > |> 249377 249031 249279 252313
> >
> > These are all *hugely* away from 3/4 to 1/4. The best has a chi-square
> > of about 20 for 1 df. MADLY significant.
> >

>
> [snip]
>
> Hm! Out of 10 million triangles, I got
>
> 7483180 obtuse inside an equilateral triangle
> 7250536 obtuse inside a square
> 7196418 obtuse inside a circle
> 9079940 obtuse inside a rectangle (1 x 4, I believe).
>
> (vertices independent inside the region in question).
>
> How good is your random number generator (mine generates random
> 32 bit integers and then rescales -- and the algorithm is one
> recommended by Knoth).

Don't blame the subtleties of my random number generator
(NAG Fortran Library G05CAF with 64-bit IEEE reals on Sun and SGI machines),
blame my gross programming mistake!

Your figures for a square and an equilateral triangle seem reasonably
close to mine. If I remember rightly we should expect differences of a few
times sigma = sqrt(npq) = about 430 on samples of 1 million.

My program for a circle contained a stupid error. I was trying
to generate uniform points in a square and reject those outside the inscribed
unit circle, but I forgot to first transform from the square [0,1]x[0,1] to
[-1,1]x[-1,1], so those figures are actually for a quadrant.
Correcting the bug, I get 720578 obtuse out of a million,
or 7200949 out of 10 million, reasonably close both to your figures
and to the theoretical .7187 that has now been posted by Keith Ramsay.

This makes the results for a square intermediate between those for a
triangle and those for a circle, destroying of a surprising observation

--
Robert Hill

University Computing Service, Leeds University, England

"Though all my wares be trash, the heart is true."
- John Dowland, Fine Knacks for Ladies (1600)

Date Subject Author
7/16/97 Mike Housky
7/21/97 Bill Taylor
7/22/97 tony richards
7/24/97 Brian M. Scott
7/23/97 tony richards
7/23/97 T. Sheridan
7/24/97 Bill Taylor
7/24/97 Bill Taylor
7/25/97 Ilias Kastanas
7/23/97 Robert Hill
7/23/97 tony richards
7/27/97 Bill Taylor
7/24/97 Robert Hill
7/28/97 tony richards
7/30/97 Bill Taylor
7/30/97 tony richards
8/1/97 Bill Taylor
7/24/97 Robert Hill
7/24/97 Robert Hill
7/24/97 Robert Hill
7/25/97 Robert Hill
7/30/97 Bill Taylor
8/1/97 Charles H. Giffen
8/1/97 John Rickard
8/1/97 Chris Thompson
8/1/97 John Rickard
8/4/97 Bill Taylor
8/5/97 John Rickard
7/25/97 Charles H. Giffen
7/25/97 Charles H. Giffen
7/28/97 Hauke Reddmann
7/28/97 Robert Hill
7/28/97 Robert Hill
7/28/97 Robert Hill
7/29/97 tony richards
7/30/97 Keith Ramsay
7/30/97 tony richards
8/2/97 Keith Ramsay
7/29/97 tony richards
8/4/97 Bill Taylor
8/5/97 Charles H. Giffen
8/6/97 Terry Moore
8/7/97 Terry Moore
8/16/97 Kevin Brown
8/17/97 Kevin Brown
7/30/97 Robert Hill
7/31/97 tony richards
8/6/97 Terry Moore
7/31/97 John Rickard
7/30/97 Robert Hill
7/31/97 Robert Hill
7/31/97 Robert Hill
8/1/97 R J Morris
8/4/97 Robert Hill
8/4/97 Robert Hill
8/5/97 Charles H. Giffen
8/6/97 Robert Hill