I'm wondering why we get the median of an arithmetic series by getting the average. Example:
$2 , 4 , 6 , 8$
The median is $5$⇒ $\frac{4+6}2$. Meanwhile, the average is also $5$⇒ $\frac{2+4+6+8}4$
A visual proof will be more than appreciated :)
On
(Just riffing off the top of my head.)
Start two pointers at the start (low pointer) and end (high pointer). Each "move" consists of moving the low pointer up one item and moving the high pointer down one item. They meet when either they are at the same item(in which case they are at the median) or the low item is one before the high item (in which case they surround the median).
If there are $n$ items, the pointers are initially $n-1$ items apart and each move reduces the spacing by $2$. If there an odd number of items, say $2m+1$, they are $2m$ apart and, after $m$ moves, they is $0$ apart. So they are at the median. The low one is at $a+md$ and the high one is at $a+2md-md=a+md$. So they are at the same one.
If there an even number of items, say $2m$, they are $2m-1$ apart and, after $m-1$ moves, the low one is at position $m$ and the high one is at position $2m-(m-1)=m+1$. So they are adjacent, so they surround the median. The low one is at $a+(m-1)d$ and the high one is at $a+(2m-1)d-(m-1)d=a+md$. So they surround the median.
This moving pointers is a way to visualize finding the median. This allows the actual median to be computed for an arithmetic sequence.
Hope this helps.
Let's say the sequence is $a,...,a+nd$ with common difference d. There are $n+1$ terms. The mean is $\frac{n+1}{n+1}a + \frac{(1+...+n)}{n+1}d = a + \frac n2 d$, using $1+...+n = \frac{n(n+1)}2$ (If you haven't seen this before, there are visual proofs of this which you may like). For the median, we must consider two cases, one where $n$ is even and one where $n$ is odd.
If $n=2k$, then there are an odd $2k+1$ terms in the sequence, meaning that the median is exactly the middle term $a+kd = a+\frac n2 d$.
If $n=2k+1$, then there are an even $2k+2$ terms in the sequence, meaning that the median is the average of the two terms in the middle, $a+kd$ and $a+(k+1)d$. The average of these is $a+\frac{2k+1}2d = a+\frac n2d$.
In both cases, the median is equal to the mean.