Four points are chosen at random inside a square. Each point is chosen by choosing a random x-coordinate and a random y-coordinate.
A convex quadrilateral is drawn with the the four random points as the vertices.
Determine the probability that the center of the square is inside this quadrilateral.
(In reply to
re: Sanity check on classification -- last part got cut off by Charlie)
This was placed in the various spots of classification:
outgrid=repmat('.',60,100);
y1=round((y+1)*30)+1; x1=round((x+1)*50)+1;
for i=1:4
outgrid(y1(i),x1(i))='*';
end
outgrid(30,50:51)='xx';
outgrid(31,50:51)='xx';
disp(outgrid)
disp(' ')
The + 1's were to prevent index of zero, which is not allowed in Matlab, so this is another aspect of the coarseness of the grid and rounding error.
|
Posted by Charlie
on 2023-01-13 08:35:34 |