I draw the attached plot drawn with the following code. Each color represents a cell. How can I find the average number of cells that one user (any point within the square) can be in? By average I mean "the user can be anywhere within the whole area". For example, averaging over 10000 random locations of a point within the square area.
ell = t [Function] t^-20.75];500, 2}];
H = RandomVariate[ExponentialDistribution[1], 50];
r = Table[H[[i]] ell[Norm[{x, y} - X[[i]]]], {i, 1, 20}];
s = Table[r[[i]]/( Total[Delete[r, i]] + 30.99), {i, 1, 20}];
Show[Table[
RegionPlot[s[[i]] >= 0.1, {x, -0.7, 0.7}, {y, -0.7, 0.7},
MaxRecursion -> 2, PlotPoints -> 40,
PlotStyle -> {FaceForm[{Opacity[0.5], ColorData[97][i]}]},
BoundaryStyle -> ColorData[97][i]], {i, 1, 20}], Graphics[Point[X]]]
Sum[Area@ImplicitRegion[f >= 0.1, {{x, -0.7, 0.7}, {y, -0.7, 0.7}}],{f, s}]/(2 0.7)^2
? See also the documentation ofArea
for a detailed explanation of the options ofArea
that allow you to control the accuracy of the computation (AccuracyGoal
andPrecisionGoal
). $\endgroup$RegionPlot
. Basically that is whatArea
does: It meshes the domain and sums the triangle areas. $\endgroup$