The lottery is a game where numbers are drawn to determine a prize. It is…