離散フーリエ変換、位相幾何学、確立

フーリエ変換をまだ勉強しています。  The Discrete Fourier Transform (DFT) can be written as:
Fj = SUM(k=1:N)(fk*e^(-2pi*i*jk/N)
Fj is the jth Fourier coefficient.
I was wondering how this formula is derived, namely whether it is derived from the continuous Fourier transform or from the Fourier series. Wikipedia cites it as a truncation of the Fourier series.

Topology: I read that one advantage of the integral homology definition is that it differentiates the torus from the Klein bottle. This difference seems to be in the first homology group H1=Z1/B1. I would like to clarify this difference.

Probability: I would like to verify some definite uses of the Martingale, namely E(Xn|X1,X2,...X(n-1)) = X(n-1)