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.
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.
Post Details
- Posted
- 4 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/askmath/com...