Skulle behöva hjälp med den här uppgiften mha mathematica.
http://www.ladda-upp.se/bilder/dfwmynavhfduw/
Jag gör såhär:
RandomReal[{-1, 1}, 2]
punkter = RandomReal[{-1, 1}, {100000, 2}];
First[punkter]
test[{x_, y_}] := x^4 + y^4 + 40 x^2 y^2 <= 1;
test[{0.5, 0.5}]
test[{0.5, 0.5}]
iCirkel = Select[punkter, test];
ejICirkel = Complement[punkter, iCirkel];
p1 = ContourPlot[
x^4 + y^4 + 40 x^2*y^2 == 1, {x, -1, 1}, {y, -1, 1}];
p2 = ListPlot[{iCirkel, ejICirkel}, PlotStyle -> {Green, Blue}];
Show[p1, p2]
Antal = Length[iCirkel]
Area = N[(Antal*4)/100000]
n = 100000;
dim = 2;
Antal = Sum[Boole[test[RandomReal[{-1, 1}, dim]]], {i, 1, n}];
Areaa = Antal*2^dim/n // N
RandomReal[{-1, 1}, dim]
test[%]
Boole[%]
Då ser det ut såhär
http://www.ladda-upp.se/bilder/jszsnnflcreu/ output 0. Area 0? lol..