Fisher's exact test — monte carlo version

I've been recently working with 2x2 contingency tables, where majority of researchers in my field use FET to assess significance. I saw, that in R, one can also use the monte carlo variation of this test.

I can't seem to understand what is being sampled in that scenario, or when is this applicable. To employ FET, one simply counts A=x, A=y, B=x,B=y occurences, and uses that for the exact test. Is the counting part, e.g. |A=x| too computationally demanding? What exactly is being approximated, because even for very large datasets, it is nowdays trivial to count occurrences related to observed event (e.g. disease).

Thank you very much.

*edit 1 The A,B,x and y are labels of rows and columns, the two vertical columns are A,B and the two rows x and y. A=x represents the cell count, A column, x row.

• "A=x, A=y, B=x,B=y" I don't understand what you mean by this. Are you referring to the cell frequencies generated under independence? – AdamO Feb 28 '18 at 15:21
• Yes, sorry for being inconsistent. – sdgaw erzswer Feb 28 '18 at 15:49

simulate.p.value