Given that M is the mass of a substance deposited during electrolysis and Q is…