Spent a couple of days going through that, this is my first j program of some use.]]>

That was my first program for a simulation!

I was thinking that it may be a good choice for simulations: fast to code and execute.

I see you know J! How good are you with it.

]]>Here's a simulation with j

```
samp =: 100000
(+/%#)((((?samp$0)-(?samp$0))^2)+((?samp$0)-(?samp$0))^2)^%2
```

A result I got ≈ 0.520588

]]>]]>

**What is the expected distance between 2 points that are randomly placed in a square that is 1 foot by 1 foot?**

There is an analytical method but let's see what geogebra can do. Or rather, what I can do with geogebra.

For this one we will use some different features of geogebra like the spreadsheet.

1) Open up a spreadsheet and in column A,B,C and D put at the top random(). Pull the 4 columns down till you have 4 columns of 1000 random numbers.

2) Highlight columns A and B and right click and create a list of points.

3) Use the regular polygon tool to draw and click on (0,0) and (1,0) and enter 4 sides.

4) You should see something like the figure below.

5) In column E write Distance[(A1,B1),(C1,D1)] and pull it down until you have 1000 distances.

You should have 5 column of 1000 entries in each.

Enter in column F, Mean[E1:E1000] and see what you get. I got .51349 which is quite close to the exact analytical answer of

]]>