A lottery is a form of gambling that involves buying numbered tickets and winning prizes…