A lottery is a game in which people pay for a ticket to be entered…