With the increasing use of wireless sensor networks (WSNs) in diverse applications where data to be communicated can range from few bytes of raw data to multimedia, the need for designing energy-efficient communication has attained paramount importance to increase the operational lifetime of such WSNs. Related to this issue, it is essential to understand the distribution of runs of 1's and 0's in the data to be transmitted, so that suitable communication techniques can be designed. Such a knowledge would also help in analyzing and comparing the performances of different energy-efficient communication techniques for a specific WSN application. In this paper, we derive a recurrence relation for expressing N k, the total number of occurrences of runs of 1's of length k, 1≤k≤n, in all possible binary strings of length n. Due to symmetry, N k is also the total number of occurrences of runs of 0's of length k, 1≤k≤n. We show that N n = 1, N n-1 = 2 and N n-k = (k + 3)2 k-2, for k≥2.