A lottery is a game in which people can win prizes based on random chance.…