A lottery is an arrangement for distributing prizes among those who buy tickets. The prize…