Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

**bobbym****bumpkin**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 109,606

Hi;

This problem came up in another thread.

**3 random points are placed on the ellipse 3x^2 + 4y^2 - 12x -16y = -17. What is the expected value of the area of the triangle these three points create?**

Let's use geogebra to run a simulation.

The first thing I did was translate this from having a center at (2,2) to having a center at the origin. The new equation is

3 x^2 + 4 y^2 - 11=0

1) Enter d: 3x^2+4y^2 = 11 into the input bar.

Adjust your screen until it is the size you like.

2) Create a slider that increments from1 to 1000 with increment of 1. Call it n. Hide the xy axes.

3) Create 3 points by entering in the input bar:

p1=n / n RandomUniform[0, 360]

p2=n / n RandomUniform[0, 360]

p3=n / n RandomUniform[0, 360]

If you have been following this series of tuts you will understand the strange expression.

4) Enter A=(sqrt(11 / 3) cos(p1° ), sqrt(11) / 2 sin(p1° )) in the input bar.

5) Enter B=(sqrt(11 / 3) cos(p2° ), sqrt(11) / 2 sin(p2° )) in the input bar.

6) Enter A=(sqrt(11 / 3) cos(p3° ), sqrt(11) / 2 sin(p3° )) in the input bar.

These are the vertices of the many triangles we intend to draw. Hide the ellipse we will not need it.

7) Hide the labels of A,B and C.

8) Right click on A, B and C and set trace on. Hit F9 repeatedly and you should see the outline of the ellipse being formed on the screen.

Now use the move graphics view button and gently move the sceen and the traced point will disappear.

9) Set the color of points A, B and C to bright red. Oen in View a spreadsheet.

10) Right click poly1 and check record to spreadsheet. Unclick in the box that comes about the label.

11) Now gently move the slider all the way to left you should see the spreadsheet begin to record values and on the screen a red ellipse forming. Go back and forth with the slider until you have about 1000 entries.

12) Highlight the column with the numbers and hit one variable analysis a small box will appear. Click analyze and on the left you will see the mean among other things. I got 1.63 which is not bad as an estimate for the expected area of a random triangle drawn on that ellipse ( using only 1000 points ).

Your drawing on the graphics screen should look like mine.

More to come...

**In mathematics, you don't understand things. You just get used to them.****If it ain't broke, fix it until it is.**** Always satisfy the Prime Directive of getting the right answer above all else.**

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Reposting the J code here:

```
samp=:1000000
k1=:%:(11%3)
k2=:%:(11%4)
'x1 y1'=: (k1&*@:cos;k2&*@:sin) 2p1*?samp$0
'x2 y2'=: (k1&*@:cos;k2&*@:sin) 2p1*?samp$0
'x3 y3'=: (k1&*@:cos;k2&*@:sin) 2p1*?samp$0
d1=:(((x1-x2)^2)+(y1-y2)^2)^%2
d2=:(((x1-x3)^2)+(y1-y3)^2)^%2
d3=:(((x3-x2)^2)+(y3-y2)^2)^%2
s=:(d1+d2+d3)%2
area=: %:(s*(s-d1)*(s-d2)*(s-d3))
(+/%#) area
```

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

What is J?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

I'm not crazy, my mother had me tested.

Offline

**gAr****Member**- Registered: 2011-01-09
- Posts: 3,479

Hi,

It's a programming language, the programs can be very small compared to other languages.

It has a pretty steep learning curve to make good use of its capabilities.

You may get it here: http://jsoftware.com/

"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."

Offline

Pages: **1**