A lottery is a game of chance wherein participants invest small sums of money for…