Cameron Campbell writes to me:
There was indeed betting on the outcomes of the examinations, at least in Guangdong province in the 19th century. At least one form of betting was on the surnames that would be represented in the pool of successful candidates. Such betting was quite widespread, so for example, there were publications dedicated to providing punters with background on exam takers.
It also seems that a Professor Haifeng Liu at Xiamen University last year gave a talk titled 闈姓賭博：清代廣東與澳門的科舉習俗, or “Examination hall surname gambling: Qing Guangdong and Macao examination customs.” (Cowen’s Second Law, though perhaps he still needs to write it up)
Here is my previous post on this topic. Here is Campbell’s blog. Campbell is still trying to find out whether the telegraph story cited in my earlier post can be verified, I thank him for his efforts, Robin Hanson will be happy.