Sadly the 'Cmd+Alt+R+P for three restarts' did not actually fix the problem. Even though for the first few hours it initially appeared to stop the wifi from disconnecting randomly, if I leave the iMac on overnight, when i try to use the internet in the morning it doesn't work. The wifi says it is connected but safari says there is no connection (and no other net traffic works). When this occurs:
1) if I click on the wifi icon, it says 'looking for networks' but it doesn't find any available networks (whereas usually I have more than 10 available) and
2) if I turn off the wifi I cannot then try to turn it back on it does not turn back on.
Once again, the only way to get the wifi connected again is to reboot the mac.
System info says my wifi is Broadcom BCM43xx 1.0 (5.10.131.36.11)
I will get back on the phone to Apple support and keep troubleshooting and keep you updated.