The opportunity cost = the value of the next best alternative If you bought pizza which is 15, you would have been willing to spend 10 on spaghetti, so the opportunity cost is 10. If you bought spaghetti which is 15, you would have been willing to spend 15 on pizza, so the opportunity cost is 15.