A lottery is a game in which numbers are drawn to determine the winner of…