For a discrete function $fleft( xright) $ on a discrete set, the finite difference can be either forward and backward. However, we observe that if $ fleft( xright) $ is a sum of two functions $fleft( xright) =f_{1}left( xright) +f_{2}left( xright) $ defined on the discrete set, the first order difference of $Delta fleft( xright) $ is equivocal for we may have $ Delta ^{f}f_{1}left( xright) +Delta ^{b}f_{2}left( xright) $ where $ Delta ^{f}$ and $Delta ^{b}$ denotes the forward and backward difference respectively. Thus, the first order variation equation for this function $ fleft( xright) $ gives many solutions which include both true and false one. A proper formalism of the discrete calculus of variations is proposed to single out the true one by examination of the second order variations, and is capable of yielding the exact form of the distributions for Boltzmann, Bose and Fermi system without requiring the numbers of particle to be infinitely large. The advantage and peculiarity of our formalism are explicitly illustrated by the derivation of the Bose distribution.