Let $S$ be a finite set of points in the plane, no three of which are collinear. Each point in $S$ is colored either blue or red. Suppose that every triangle whose three vertices are blue contains at least one red point, and every triangle whose three vertices are red contains at least one blue point.

Determine the largest possible value of $|S|$.
The answer is 8. We will in fact show that there are at most 4 blue points and at most 4 red points. Suppose there are at least 5 blue points. By performing a rotation if necessary, we can assume that the points have distinct x-coordinates. We denote $\mathcal{B}$ as the set of 5 blue points with the smallest x-coordinates.

If the convex hull of $\mathcal{B}$ is a pentagon, this pentagon contains no blue points. The pentagon can be divided into 3 triangles, each containing a red point. These three red points form a triangle, which contains no blue points, which is impossible.

If the convex hull of $\mathcal{B}$ is a quadrilateral $B_{1} B_{2} B_{3} B_{4}$, let $B_{5}$ be the last point of $\mathcal{B}$. The triangles $B_{5} B_{1} B_{2}, B_{5} B_{2} B_{3}, B_{5} B_{3} B_{4}$, and $B_{5} B_{4} B_{1}$ each contain a red point, so we have 4 red points $R_{1}, R_{2}, R_{3}$, and $R_{4}$ within the convex hull of $\mathcal{B}$, and only one blue point $B_{5}$. This blue point must therefore be inside all triangles formed by $R_{1}, R_{2}, R_{3}$, and $R_{4}$, which is impossible.

Finally, if the convex hull of $\mathcal{B}$ is a triangle $B_{1} B_{2} B_{3}$, we can draw segments connecting the five points of $\mathcal{B}$ to divide the convex hull into 5 triangles, which therefore contain 5 red points. By the pigeonhole principle, we can find 3 of these points on the same side of $\left(B_{4} B_{5}\right)$. These three points form a red triangle that does not contain any blue vertex, which is also impossible.

Therefore, the total number of vertices cannot exceed 8. Finally, $|S|=8$ is achievable, as shown in the figure below.

![](https://cdn.mathpix.com/cropped/2024_05_10_346641170ac76390eef3g-374.jpg?height=457&width=734&top_left_y=1839&top_left_x=661)