The Palace of Heavenly Purity was the residence of the Ming Emperor. The large space was divided into nine rooms on two levels, with 27 beds. For security purposes, every night, the Emperor randomly chose one of these beds.