Pick's theorem which expresses the area of a plane triangle whose vertices have integer coordinates in terms of the number vinterior of lattice points (strictly) inside the triangle and the number vboundary of lattice points on the boundary of the triangle. Consider the triangle with the three vertices v1 = (0, 0), v2 = (a, c), v3 = (b, d). Its area is equal to A point inside the triangle can be parametrized as where The Pick formula now implies that there must be a lattice point lying inside the triangle different from the three vertices if (then the area of the triangle is ). The corresponding fraction q1/q2 lies (strictly) between the given (by assumption reduced) fractions and has denominator as Relatedly, if p/q and r/s are reduced fractions on the unit interval such that |ps − rq| = 1 (so that they are adjacent elements of a row of the Farey sequence) then where is Minkowski's question mark function. In fact, mediants commonly occur in the study of continued fractions and in particular, Farey fractions. The nth Farey sequence Fn is defined as the (ordered with respect to magnitude) sequence of reduced fractions a/b (with coprime a, b) such that b ≤ n. If two fractions a/c < b/d are adjacent (neighbouring) fractions in a segment of Fn then the determinant relation mentioned above is generally valid and therefore the mediant is the simplest fraction in the interval (a/c, b/d), in the sense of being the fraction with the smallest denominator. Thus the mediant will then (first) appear in the (c + d)th Farey sequence and is the "next" fraction which is inserted in any Farey sequence between a/c and b/d. This gives the rule how the Farey sequences Fn are successively built up with increasing n. Graphical determination of mediants A positive rational number is one in the form where are positive natural numbers; i.e. . The set of positive rational numbers is, therefore, the Cartesian product of by itself; i.e. . A point with coordinates represents the rational number , and the slope of a segment connecting the origin of coordinates to this point is . Since are not required to be coprime, point represents one and only one rational number, but a rational number is represented by more than one point; e.g. are all representations of the rational number . This is a slight modification