A lottery is a game of chance in which participants pay a small amount for…