Motivated by applications to sensor, peer-to-peer, and adhoc networks, we study the problem of computing functions of values at the nodes in a network in a totally distributed manner. In particular, we consider separable functions, which can be written as linear combinations of individual variables. The main contribution of this paper is the design of a simple and completely distributed randomized algorithm for computing separable functions based on properties of exponential random variables. Our algorithm computes any separable function of n network nodes within relative error of ǫ ∈ (0, 1) in time O(ǫ−2 (log n + log δ−1 )/Φ(P)) with probability at least 1 − δ, where Φ(P) is conductance of an appropriate stochastic matrix P that is network graph conformant. The second contribution of this paper is a characterization of the information spreading time of the gossip algorithm, in terms of the conductance Φ(P) of an appropriate stochastic matrix P. Specifically, we find ...