Example 4 Given $n$ points $A_{1}, A_{2}, \cdots, A_{n}(n$ $\geqslant 3)$ in the plane, no three of which are collinear. By selecting $K$ pairs of points, determine $K$ lines (i.e., draw a line through each pair of the $K$ pairs of points), such that these $K$ lines do not form a triangle with all three vertices being given points. Find the maximum value of $K$.

---

The translation maintains the original text's formatting and structure, including the use of mathematical notation and the preservation of line breaks.
Thought analysis: First analyze the point pair $A_{1}, A_{2}$ among the $n$ points, then analyze the point pair $A_{3}, A_{4}$ among the remaining $n-2$ points, and so on, to estimate the upper bound of $K$. Then, through examples, show that the upper bound of $K$ can be achieved, thereby finding the maximum value of $K$.

Solution: Let the line passing through the point pair $A_{1}, A_{2}$ be $L$. Then $A_{1}, A_{2}$ cannot both be connected to any of the remaining $n-2$ points, meaning that the number of lines passing through $A_{1}$ or $A_{2}$ is at most $n-1$ (including $L$). Similarly, for the $n-2$ points $A_{3}, A_{4}, \cdots A_{n}$, the number of lines passing through $A_{3}$ or $A_{4}$ is at most $n-3$, $\cdots \cdots$. Therefore,
$$
K \leqslant(n-1)+(n-3)+\cdots
$$
$=$
$\left\{\begin{array}{l}(n-1)+(n-3)+\cdots+1=\frac{n^{2}}{4}, \text { if } n \text { is even; } \\ (n-1)+(n-3)+\cdots+2=\frac{n^{2}-1}{4}, \text { if } n \text { is odd. }\end{array}\right.$
On the other hand, we can divide the $n$ points into two groups: when $n$ is even, each group has $\frac{n}{2}$ points; when $n$ is odd, one group has $\frac{n-1}{2}$ points, and the other group has $\frac{n+1}{2}$ points. Connect each point in the first group with each point in the second group to form $\frac{n^{2}}{4}$ or $\frac{n^{2}-1}{4}$ lines, such that these lines do not form a triangle with three vertices all being given points.

Therefore, when $n$ is even, the maximum value of $k$ is $\frac{n^{2}}{4}$, and when $n$ is odd, the maximum value of $k$ is $\frac{n^{2}-1}{4}$.