In reply to Ajit de Silva.

This is my take on the problem in R. http://www.econinfo.de/2016/03/12/so-i-finally-understood-monty-hall/

Without counting the lines, I think it is much cleaner than either SAS or Python, as you don't need to set up anything.