Let Fq be the finite field of q elements and a 1 , a 2 , . . . , a k , b ∈ Fq. We investigate N Fq (a 1 , a 2 , . . . , a k ; b), the number of ordered solutions (x 1 , x 2 , . . . , x k ) ∈ F k q of the linear equationwith all x i distinct. We obtain an explicit formula for N Fq (a 1 , a 2 , . . . , a k ; b) involving combinatorial numbers depending on a i 's. In particular, we obtain closed formulas for two special cases. One is that a i , 1 ≤ i ≤ k take at most three distinct values and the other is that k i=1 a i = 0 and i∈I a i = 0 for any I [k].The same technique works when Fq is replaced by Zn, the ring of integers modulo n. In particular, we give a new proof for the main result given by Bibak, Kapron and Srinivasan ([2]), which generalizes a theorem of Schönemann via a graph theoretic method.