How is the formula for calculating probability derived? Why does the probability  = the number of favorable outcomes divided by the total number of outcomes? It is a really dumb question but it has been stuck in my head for days now.
 A: The formula is incorrect.
The probability of an event is able to be said to be equal to the total number of favorable outcomes divided by the total number of outcomes only in the case that it is known that the outcomes are equally likely to occur.  If it is unknown that the outcomes are equally likely to occur, then we may not use this as a method of calculation.
Why does it work in such a case?  Because the outcomes are equally likely to occur!
If our sample space is $\Omega = \{\omega_1,\omega_2,\omega_3,\dots,\omega_n\}$ then we have $\Pr(\{\omega_i\})=\Pr(\{\omega_j\})$ for each $i,j$ by our hypothesis that each outcome is equally likely to occur.
We see then that since $\Pr(\Omega)=1$ by definition and that $\Pr(\Omega)=\Pr(\{\omega_1,\omega_2,\dots,\omega_n\})=\Pr(\{\omega_1\})+\Pr(\{\omega_2\})+\dots+\Pr(\{\omega_n\})=n\cdot \Pr(\{\omega_1\})$ that we have as a result $\Pr(\{\omega_i\})=\frac{1}{n}$ for each $i$.
Finally, given that an event $A = \{\omega_1,\omega_2,\dots,\omega_k\}$ we have $\Pr(A)=\Pr(\{\omega_1\})+\dots+\Pr(\{\omega_k\})=k\cdot\frac{1}{n} = \frac{k}{n}$, the aforementioned formula.  This all, of course, still being predicated on the hypothesis that the outcomes were equally likely to occur.  Without that, we could not have come to this conclusion.

As an example of a case where the formula does not work... there are only two outcomes when playing the lottery.  You either win or you lose.  However, you don't win the lottery with probability $\frac{1}{2}$ despite winning the lottery being one of the two possible outcomes.
