How to calculate coins mined per day? Sorry for the noob question I'm pretty new to crypto coins and all this stuff. :)

I wonder why the formula &lt;your hashrate&gt; / &lt;coin difficulty&gt; gives the mined coins as a result...Formula mentioned on xmg.minerclaim.comQuote:


  "XMG/Day" is calculated by the current Hashrate/Difficulty. Due to the
  fact that difficulty is constantly changing, this is only a rough
  estimate.




Example (from altcoin Coin Magi):

If I have a hashrate of 3.211 MH/s and the coins difficulty is 2.599 (approximately) then my earnings per second (because it's H/s) should be  


  3,211,000 / 2.599 = ~1235.47 coins per second


and


  1235.47 * ( 60 * 60 *24 ) = 106744608 coins per day


How can this be? The 'fastest' miner (highest hashrate) has 3.211 MH/s and is 'only' earning 32.892 XMG per day?

Did I do something wrong? Is minerclaim wrong? And what's a good formula to calculate mined coins per day?

Thanks in advance!
Average coins/day for a miner can be estimated by comparing the miner's hashrate with the hashrate of the network.  



where,

Cm is total coins for the miner
subsidy is the number of coins/block a miner gets as a reward
blocktime is the average time per block
Hm is the miner's hashrate (Hash/sec)
Hn is the total network hashpower (Hash/sec)
1440 is minutes per day

Bitcoin

Since the total network hashpower is unknown, it must be estimated based on the current difficulty. This can be done by noting that Difficulty D



Because

difficulty = hashrate / (2^256 / max_target / intended_time_per_block) 
           = hashrate / (2^256 / (2^208*65535) / 600)
           = hashrate / (2^48 / 65535 / 600) 
           = hashrate / 7158388.055


see Relationship Between Hashrate and Difficulty

So, for bitcoin given a current difficulty of 5,949,437,371,610 an Antminer S9 with a hashrate of about 14TH/s:





Note: This is an average value, so with a large enough pool and enough days, your earnings will average to this formula (this does not account for the difficulty and network hashpower changing, of course).