Peace to all
If any of your women are guilty of lewdness, Take the evidence of four witnesses from amongst you against them; and if they testify, confine them to houses until death do claim them, or God ordain for them some (other) way. Q[4:15]
If any of you have not the means wherewith to wed free believing women, they may wed believing girls from among those whom your right hands possess: And God has full knowledge about your faith. You are one from another: Wed them with the leave of their owners, and give them their dowers, according to what is reasonable: They should be chaste, not lustful, nor taking paramours: when they are taken in wedlock, if they commit lewdness, their punishment is half that for free women. This is for those among you who fear sin; but it is better for you that you practice self-restraint. And God is Oft-forgiving, Most Merciful. Q[4:25]
In Q[4:15], punishment for lewdness is lifetime prison, and in Q[4:24] half of lifetime prison. How do we know what/how-much is half of lifetime prison when we don't know when a person/woman will die?