number of miners = ( total network hashpower ) / hash power per miner
number of miners * price per miner = $$$$$$
If you rent them, i guess it could be significantly cheaper.
Nicehash offers 1PH/s on the bitcoin chain for ~ 0.0168BTC
Bitcoin sees ~ 120 exahash. https://www.blockchain.com/charts/hash-rate
= 120000 pentahash (?)
120000*0.168 = ~141.120.000 $ (For, lets say - a month?) to get 51% hashing power (this doesn't seem that expensive.)
Although they obviously don't have that much mining power for rent (I see nicehash only has ~ 180 PH).
Purely theorethically speaking (if we forget about the practicalities of renting 120 ph worth of hashing equipment/however many hashes/s a chain has, (let alone buying it, in which case i highly doubt it would be profitable.)) i could see a number of scenario's where it could definitely be profitable to do a 51% attack.
Well if you buy the miners you have many other costs too like, space where u put them, cooling, electricy wires check that all are running...