We analyze average-based distributed algorithms relying on simple and pairwise random interactions among a large and unknown number of anonymous agents. This allows the characterization of global properties emerging from these local interactions. Agents start with an initial integer value, and at each interaction keep the average integer part of both values as their new value. The convergence occurs when, with high probability, all the agents possess the same value, which means that they all know a property of the global system. Using a well-chosen stochastic coupling, we improve upon existing results by providing explicit and tight bounds on the convergence time. We apply these general results to both the proportion problem and the system size problem.