Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MAJOR problem in mathematical logic #12

Open
amterp opened this issue Apr 16, 2016 · 0 comments
Open

Fix MAJOR problem in mathematical logic #12

amterp opened this issue Apr 16, 2016 · 0 comments

Comments

@amterp
Copy link
Owner

amterp commented Apr 16, 2016

Painfully obvious in hindsight. Imagine these two options where the user has entered that they can buy melons and wheat:

Option 1 (Current algorithm behavior):

  • Start on day 1 of summer with 160 gold.
  • Buy 2 melons (80 gold each) due to melons having a higher net gold income per day
  • On day 13, after they're fully grown, sell each melon for 250 gold.
  • Wealth on day 13: (2 * 250) = 500 gold

Option 2 (Proposed algorithm behavior):

  • Start on day 1 of summer with 160 gold.
  • Buy 16 wheat (10 gold each).
  • On day 5, after they're fully grown, sell each wheat for 25 gold.
  • Wealth on day 5: (16 * 25) = 400 gold
  • Buy 40 wheat (10 gold each).
  • On day 9, after they're fully grown, sell each wheat for 25 gold.
  • Wealth on day 9: (40 * 25) = 1000 gold
  • Buy 100 wheat (10 gold each).
  • On day 5, after they're fully grown, sell each wheat for 25 gold.
  • Wealth on day 13: (100 * 25) = 2500 gold

Explanation for why the current algorithm is not working is that, while melons DO have the highest net gold income per day (14.17 gold), and wheat have a mere 3.75 gold NGI/D, those values are per crop. In other words, in this scenario, if we just consider up until day 5 (for simplicity's sake), the total NGI/D for option 1 is (14.17 * 2 = 28.34 NGI/D) while for option 2 it is (3.75 * 16 = 60 NGI/D). That is a huge difference. Additionally, what accentuates the day 13 wealths between the two options is that option 2 experiences exponential growth, as you are able to buy more wheat several times in the time it takes for the two melons to fully grow. This is what creates the 500 to 2500 gold difference, and it's a tremendous problem that needs to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant