Expectation of the number of points inside a foursquare of a rectangle Consider a rectangle (black one) in the following image. Lets take four random points uniformly on each border then connecting the points one after another (red lines) to get a foursquare  inside the rectangle.

If we put a set of random points ($n$ points) uniformly  inside the rectangle , I would like to know what is the mathematical expectation of the number of points that are inside the red area?
Since the position of red points are random, I really can't solve this problem.
The probability that each point falls in the red area, is the area of red_line divided by area of rectangle. Since the area it self is a random process, so we need to calculate the expectation of the area of the red line.
Thanks in advance.
 A: One way of doing it:

Let the vertices of the rectangle be $(0,0),(w, 0),(0, h),(w, h)$.
Then the $4$ red points are $(0, r_1h),(w, r_2h), (r_3w,0), (r_4w,h)$ where $r_n$ are uniformly distributed random numbers between $0$ and $1$.
The area of a particular quadrilateral is
$$\textrm{Area of rectangle} - \textrm{Area of 4 triangles}=hw\left(1-\frac{1}{2}(r_1r_3+r_2(1-r_3)+(1-r_1)r_4+(1-r_4)(1-r_2))\right)$$
$$=hw\left(1-\frac{1}{2}(r_1r_3+r_2-r_2r_3+r_4-r_1r_4+1-r_2-r_4+r_2r_4)\right)$$
$$=hw\left(\frac{1}{2}-\frac{1}{2}(r_1r_3-r_2r_3-r_1r_4+r_2r_4)\right)$$
$$=hw\left(\frac{1}{2}(1-(r_1-r_2)(r_3-r_4))\right)$$
The expected number of points inside a particular quadrilateral is $n\left(\frac{\textrm{Area of quadrilateral}}{\textrm{Area of rectangle}}\right)$
We then want to integrate between $0$ and $1$ for each $r_n$ to find the final expectation which gives us:
$$E(\textrm{Number of Points})=\int^1_0\int^1_0\int^1_0\int^1_0{n\left(\frac{\textrm{Area of quadrilateral}}{\textrm{Area of rectangle}}\right)\,\,\,dr_1dr_2dr_3dr_4}$$
$$=\frac{n}{2}-\frac{n}{2}\int^1_0\int^1_0\int^1_0\int^1_0{(r_1-r_2)(r_3-r_4)\,\,\,dr_1dr_2dr_3dr_4}$$
$$=\frac{n}{2}-\frac{n}{2}\int^1_0\int^1_0\left(\int^1_0r_1\,\,\,dr_1-\int^1_0r_2\,\,\,dr_2\right)(r_3-r_4)\,\,\,dr_3dr_4$$
$$=\frac{n}{2}$$
A: WLOG, I am solving for a unit square.
Let the four vertices be at coordinates $x,x',y,y'$ on the respective sides. The area of the quadrilateral is $1$ minus the areas of the four corners,
$$A=1-\frac{xy+(1-x)y'+x'(1-y)+(1-x')(1-y')}2=\frac{1-(x-x')(y-y')}2.$$
As $x,x',y,y'$ are uniform independent random variables, their pairwise differences follow independent triangular distributions centered on $0$, and the expectation of the product is the product of the expectations.
Hence, $$E(A)=\frac12.$$
