In the presence of gametic phase disequilibrium and inbreeding, multiple locus genotype frequencies cannot be written solely in terms of identity by descent (IBD) probabilities. Following Cockerham & Weir (1973) we introduce the concept of 'equivalence by descent' (EBD), an extension of the concept of IBD to include non-allelic genes. Two genes are said to be EBD if they derive ultimately from the same founding gamete of a pedigree. Allelic genes that are EBD are also IBD. For two loci 11 EBD probabilities, the 'J-coefficients' are required and for three loci 117 J-coefficients are required to write genotype probabilities. It is show how the 117 J-coefficients for three loci call be reduced to a basic set of 37. Computer programs, written in the algebraic programming language, MAPLE (TM), are described which are capable of calculating the two- and three-locus J-coefficients for any pedigree, subject only to size limitations. The MAPLE (TM) packages are available from the author upon request.