Two different definitions of a median I read from the book "Introduction to the Practice of Statistics", The International Seventh Edition, page 31 that "The $\textbf{median $M$}$ is the midpoint of a distribution. Half the observations are smaller than the median and the other half are larger than the median."
But I also read from the book "Statistical Inference", second edition, international student edition, page 78 problem 2.17 that "A $\textit{median}$ of a distribution $X$ is a value $m$ such that $P(X\leq m)\geq 1/2$ and $P(X\geq m)\geq 1/2$."
Are there differences between those definitions? 
For example, is the median of a given distribution necessarily a unique number in the latter definition? 
Have I understood correctly that if we have a distribution with only two values, $0$ and $1$ with equal probabilities, then the median of this distribution is $\frac{1}{2}$ by the first definition and an arbitrary real number $x\in [0,1]$ in the second definition?
 A: Note that the first definition refers to the median, while the second refers to a median.  This is not a minor distinction.  According to some uses of the term "median" you can have more than one -- a median is any value that satisfies certain requirements (typically either dividing the set in half, or minimizing some distance/loss function based on absolute distances between points) and so in your example, any real number in [0,1] is indeed a median, while convention dictates that we refer to 1/2 as the median.  The distinctions between the various common definitions (averaging "middle" values, finding any point that divides the set, or finding points that minimize the distance according to the L1 norm) won't actually make a difference in most circumstances, and so most commonly people will refer to the median and ignore the others.  Think of it analogously to how people will often casually refer to 2 as the square root of 4, even though -2 is also a square root of 4.  The less commonly encountered cases are simply ignored.
A: The Wikipedia page has a good definition of "median". Regarding the first reference, "midpoint" should be defined more precisely. Your second reference gives more precise, formal definition, though leaves out some aspects. m is only included in the discrete distribution of the number of elements in the distribution is odd. "If there is an even number of observations, then there is no single middle value; the median is then usually defined to be the mean of the two middle values". Thus, in the case you described with discrete distribution of only two values -- 0 and 1, with equal probability -- then the median is 1/2.  However, the majority of situations where median is used as a descriptive statistic of central tendency, there are many more than two values in the support.
