Midpoint method applied to the calculation of geodesics On this document (page 2) the midpoint method to iteratively find geodesic paths is described, and the following theorem is proven:

Theorem 2.2. Let $\gamma$ be a path defined by a finite series of points in $\mathbb R^2$ that has endpoints $p$ and $q.$ Performing the midpoint method on this path will produce a series of points defining the straight line connecting $p$ and $q.$
Proof. Without loss of generality consider the path defined by the finite
set of points $p_1, \dots, p_n$ where $p_i = (x_i, y_i)$ and in particular $p_1 = (0, 0)$ and $p_n = (a, 0).$ The path resulting from $m$ iterations of the midpoint method is made up of the points $(x_i, y′_i)$ where

$$y′_i =\frac{\sum_{j=0}^{\min(m,n-i)}y_{i+j}\binom{m}{j}}{2^m}$$
Can I get an explanation of this last formula? Where does the binomial come from?
 A: One can make the midpoint procedure systematic by applying it to the doubly infinite sequence of points
$$
...,p,p,p=p_1,p_2,p_3,...,p_n=q,q,q,q,...
$$
Then computing midpoints of neighboring pairs results in the sequence
$$
...,p,p,\frac{p_1+p_2}2,\frac{p_2+p_3}2,...,\frac{p_{n-1}+p_n}2,q,q,...
$$
which corresponds, after contracting the constant tails to one point, exactly to the description of the method in the paper, "Compute the midpoints of each segment, and connect them to get a new path. Place $p_1$ at the beginning of this path and $p_n$ at the end of it."
Again computing the midpoints of the infinite sequence gives
$$
...,p,\frac{3p_1+p_2}4,\frac{p_1+2p_2+p_3}4,...,\frac{p_{n-2}+2p_{n-1}+p_n}4,\frac{p_{n-1}+3p_n}4,q,...
$$
where you can see the start of Pascal's triangle in the coefficients.
While the general idea is correct, the sum formula is deficient. It is only correct for the middle elements, and then only after an index shift. It should be 
$$
p'_i=2^{-m}\sum_{j=0}^m\binom{m}{j}p_{i-j},\qquad i=1,2,...,n+m,
$$
where again the infinite continuation with $p_k=p$ for $k\le0$ and $p_k=q$ for $k\ge n$ is used.
