:for mediant in music, see mediant. "mediant" should not be confused with median. in mathematics, the mediant of two fractions : \frac {a} {c} \text{ and } \frac {b} {d} is : \frac {a + b} {c + d}. that is to say, the numerator and denominator of the mediant are the sums of the numerators and denominators of the given fractions, respectively. it is sometimes called the freshman sum, as it is a very common mistake in the usual addition of fractions. in general, this is an operation on fractions rather than on rational numbers. that is to say, for two rational numbers q1, q2, the value of the mediant depends on how the rational numbers are expressed using integer pairs. for example, the mediant of 1/1 and 1/2 is 2/3, but the mediant of 2/2 and 1/2 is 3/4. a way around this, where required, is to specify that both rationals are to be represented as fractions in their lowest terms (with c > 0, d > 0). with such a restriction, mediant becomes a well-defined binary operation on rationals. the stern-brocot tree provides an enumeration of all positive rational numbers, in lowest terms, obtained purely by iterative computation of the mediant according to a simple algorithm. ==properties== * the mediant inequality: an important property (also explaining its name) of the mediant is that it lies strictly between the two fractions of which it is the mediant: if a/c < b/d and a,b,c,d\geq 0, then ::\frac a c < \frac{a+b}{c+d} < \frac b d. :this property follows from the two relations ::\frac{a+b}{c+d}-\frac a c={{bc-ad}\over{c(c+d)}} ={d\over{c+d}}\left( \frac{b}{d}-\frac a c \right) :and ::\frac b d-\frac{a+b}{c+d}={{bc-ad}\over{d(c+d)}} ={c\over{c+d}}\left( \frac{b}{d}-\frac a c \right). * assume that the pair of fractions a/c and b/d satisfies the determinant relation bc-ad=1. then the mediant has the property that it is the simplest fraction in the interval (a/c, b/d), in the sense of being the fraction with the smallest denominator. more precisely, if the fraction a'/c' with positive denominator c' lies (strictly) between a/c and b/d, then its numerator resp. denominator can be written as \,a'=\lambda_1 a+\lambda_2 b and \,c'=\lambda_1 c+\lambda_2 d with two positive real (in fact rational) numbers \lambda_1,\,\lambda_2 . to see why the \lambda_i must be positive note that ::\frac{\lambda_1 a+\lambda_2 b}{\lambda_1 c+\lambda_2 d }-\frac a c=\lambda_2 {{bc-ad}\over{c(\lambda_1 c+\lambda_2 d)}} :and ::\frac b d-\frac{\lambda_1 a+\lambda_2 b}{\lambda_1 c+\lambda_2 d }=\lambda_1 {{bc-ad}\over{d(\lambda_1 c+\lambda_2 d )}} :must be positive. the determinant relation ::bc-ad=1 \, :then implies that both \lambda_1,\,\lambda_2 must be integers, solving the system of linear equations ::\, a'=\lambda_1 a+\lambda_2 b ::\, c'=\lambda_1 c+\l
Binary_operations Elementary_arithmetic Fractions_(mathematics)