The Thousand and One Nights

Consider the predicaments of Shahrayar and his brother, Shahzaman: How do they discover the truth and ultimately make themselves feel better about it?