There is a Sm"a (I think) somewhere which talks about what to do in a situation when a chacham is not available to answer one's question - namely, to get advice from an Am Haaretz, and then do the opposite. Does anyone know where this is?
There is a well-known expression in the world of the yeshivot:
דעת בעלי בתים היא היפך דעת תורה
The view of laymen is the opposite of the view of the Torah.
This is often sourced to a statement of Mahari Weil quoted in Sma (3:13):
ואם תשמע לעצתי לא תשב אצל הקהל בשום דין דידעת שפסקי הבעלי בתים ופסקי הלומדים הם שני הפכים
If you will take my advice, do not sit with the general public in any judgement, because you know that the decisions of laymen and the decisions of the learned are two opposites.
As far using this aphorism to arrive at a decision by consulting laymen and doing the opposite, this seems to have its roots in a legend concerning the author and publicist R. Moshe Sheinfeld and the Brisker Rav (recounted, for instance, here or here).
Apparently, the Brisker Rav marveled at the fact that R. Sheinfeld in his articles always arrived at the correct, da'at torah-compliant position. R. Sheinfeld explained that his method was simple: he would consult with the general public about an issue, and then write the precise opposite of whatever he heard from them. In this way, he was guaranteed that what he wrote would represent da'at torah.