Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
Finding a mathematical solution to a recipe puzzle?
Post Flair (click to view more posts with a particular flair)
Post Body

So, I'm playing around with a puzzle in a game where I have to figure out the correct quantities of ingredients to go into a recipe, and I'm trying to figure out the most efficient way to search the space of possible quantities given a few conditions:

  • Recipes can have any number of ingredients from 1 to 12, they always contain at least 1 of each ingredient, and the quantities are all natural numbers (1, 2, 3, etc.)

  • There's a condition for "closeness" - if you're within X total units away, you get some feedback that you're close. This range is about 4 total units, I think.

  • "Closeness" depends on the sum of the absolute values of differences between the recipe and the guess - one being 1 unit too high and one being 2 units too low counts as being 3 units away total.

So for example, if I have a recipe that is (2, 3, 4, 5) and I guess (2, 2, 5, 5), then I'm 2 units away and therefore I get told I'm "close".

I'm trying to figure out a way to basically sample the space of possible recipes so if I have one with N ingredients, I can just systematically test as few recipes as possible until I find something that's "close". I'm not sure how to formalize this and come up with a solution though - it feels like something that could be mapped out with N-dimensional taxicab distance, treating each ingredient as a dimension, and basically covering the space with N-dimensional "balls" with a radius equal to the "closeness" condition to generate guesses, but I don't know how to actually work with that. I'd love some ideas on how else I could visualize this puzzle and how I could build up an algorithm for generating guesses efficiently.

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
33,423
Link Karma
5,119
Comment Karma
28,279
Profile updated: 3 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 months ago