A lottery is a system in which participants pay a small amount for the chance…