Consider a rectangle (black one) in the following image. Lets take three points uniformly on its borders, two on two borders and one on the intersection of two borders, then connecting the points one after another (red lines) to get a triangle 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 (triangle at the center)?
and also what is the expectation of number of points inside each triangles at the corners?

Let your rectangle be $h$ high by $w$ wide. Let the point on the right side be $y$ up from the bottom and the point on the top be $x$ toward the right. The total area of the three outside triangles is $\frac 12hx+\frac 12wy+\frac 12(h-y)(w-x)=\frac 12(hw+xy)$. The expectation for this is $\frac 58$ of the rectangle, so $\frac 38$ of the points should be inside the inside triangle. The two outside triangles touching the corner average $\frac 14$ of the rectangle and the third averages $\frac 18$