A lottery is a game in which numbers are drawn in order to win a…