0

I know that once I have a graph or decision tree representation of a problem, there are many different ways I can get a computer to solve the problem. They're called search algorithms, and go by names such as Depth-First Search, or Breadth-First Search or A* Search, etc.

However, I have the following game that I would like to input to my computer. The game is simple, you pick ten numbers. If all ten of the numbers are the number 1, then you win.

However, there are an infinite amount of decisions that the computer could take even with picking the first number. It could choose 8, or pi, or -3, etc.

Thus, even if I use something like A* and program in a heuristic such that it's obvious to the computer that choosing 1 is the best option, the computer still wont have enough memory to evaluate the heuristic on other the other options and make an informed decision.

How can computers handle cases like this? What sort of data structures are used when dealing with situations where there is not enough memory to hold all of the data, but there is enough to hold the relevant data at any given time?

(Compressed sparse data structures come to mind, but I'm not exactly sure how they can be used here.)

Pro Q
  • 115
  • 5
  • If your domain of numbers is infinite and you pick numbers according to a uniform distribution, then the probability of choosing 1 (or any one of them, in fact) is exactly zero. Hence, you can only win if you play infinitely many times... – dkaeae Jan 09 '19 at 08:45
  • Also, (real-world) computers only have finite memory, so there is no way of accounting for infinitely many numbers (without risking running out of memory). – dkaeae Jan 09 '19 at 08:47
  • Yes, I’m aware of these issues. Somehow though, human brains are able to understand the concept of an infinite amount of choices while still just paying attention to the ones that are relevant. I think there may be a sort of data structure or object I could create that would do something similar. – Pro Q Jan 10 '19 at 14:09
  • Human brains are also capable of solving the halting problem—TMs (and computers) not. – dkaeae Jan 10 '19 at 14:11
  • We do not know if human brains are also capable of solving the halting problem – Pro Q Jan 10 '19 at 18:50
  • Got me on that one :) Still, human brains arguably do not pick from infinitely many possibilities for numbers. Ask most people and they will only pick natural numbers between 1 and 100. I doubt someone would even pick a negative number, let alone a fraction, a famous real ($e$, $\pi$), or even something bigger than 1000000000. – dkaeae Jan 11 '19 at 07:06
  • Another issue: Even under the assumption people can pick from infinitely many possibilities, how should they input this in the computer? Again we run into the problem of finite memory... $16 GB$ memory can only stand for $2^{16} \cdot 2^{30}$ many values, however you choose those values to be. – dkaeae Jan 11 '19 at 07:10
  • Exactly my question. Is there a datastructure that can help here such that you can represent a very large (potentially infinite) amount of options with only finite memory? My initial thought is that you could have some structure that maybe represents ranges, and then update those ranges. For example, one structure that represents the range [2, inf) and another that represents [1, 1] so that you can keep track of different data for some ranges and treat the numbers in the other ranges exactly the same. – Pro Q Jan 11 '19 at 14:34
  • Well, of course you can respresent infinitely many numbers with finitely many sets of them; however, then you are representing sets of numbers, not the numbers themselves. What the user then does is not input a number (potentially infinitely many possibilities) but, rather, choose a set of numbers from a list of options (finitely many possibilities). – dkaeae Jan 11 '19 at 15:04

0 Answers0