Say Ted and Jane are in the later generation. Seven generations ago, they have 128 ancestors each. Maybe fewer, due to inbreeding.
There are $128\times128=16384$ chances of a match. Each chance is 0.0001, and the chance of a miss is 0.9999.
The odds of no match, or all misses, is $0.9999^{16384}=0.194$. Ted and Jane probably have a common ancestor.
Eight generations ago, there are $256$ ancestors each, $256\times256=65536$ and $0.9999^{65536}=0.0014$, so they are almost certainly related.
Six generations ago, $0.9999^{4096}=0.664$, and only one chance in three.
In general, compare the number of ancestors with the square-root of the population size. In a well-mixed city of a million, things become likely around the tenth generation.
I tried to take account of inbreeding, and got the following numbers; as the comments below say, they are probably wrong.
$$\begin{array}{c|c}N&P\\1&0.9996\\2&0.9984\\
3&0.9936\\4&0.9748\\5&0.9030\\6&0.6656\\7&0.1984\\8&0.0017
\end{array}$$
EDIT:
I did a simulation. Marriage has the effect of replacing people with couples. The population starts with 5000 couples rather than 10000 people, but people have half as many ancestors (two couples of grandparents rather than four individual grandparents.) Seven generations ago, the chance of no common ancestor is more like $0.9998^{4096}=0.441$ instead of 0.194, so it is less likely they have a common ancestor. Inbreeding also reduces the chance of common ancestors.