Linear equations with random variables