Outside the north gate of Hangzhou's city wall was a house that was reputed to be haunted. As a consequence, nobody dared live there and so the house remained vacant and firmly sealed.
One day a scholar by the name of Cai came by and expressed his wish to purchase the house. The locals tried to dissuade him, saying he would be risking his life if he tried to live in such a place. But Cai paid them no heed and proceeded with the purchase, signing all the necessary documents. His family refused to take up residence, however, so Cai moved in by himself.
On his first night in the house he sat up with a candle to keep watch. At midnight a woman with a red sash dangling from her neck quietly entered his room. She curtsied and the two exchanged greetings. Then the woman tied a rope to the roof beam and pulled the noose over her head. Throughout this performance Cai remained unruffled. Next, she tied another rope and beckoned to Cai to join her. Cai accepted her invitation but drew the noose over his foot.
The woman said, "My dear sir, that's the wrong way."
Cai laughed. "I'm certainly not wrong. You're the one who's doing it the wrong way and that's why you ended up where you are today."
At this, the ghost fell to her knees weeping, and after bowing to Cai several times she left. From this time on, the house was free of supernatural occurrences. Cai, moreover, was successful in his examinations. Some say he may be the local magistrate, Cai Binghou.