I'm trying to find a way to identify a unique point in the domain of a function, but I'm having trouble doing this:
My first thought was choosing 0 if the function is defined at 0, if not, the smallest positive number if it's defined at any positive numbers, and if not, the largest negative number. But I quickly realized this doesn't work for all functions, such as 1/x.
My second thought was picking some interval (x,y) in the domain of the function and choosing the midpoint (x+y)/2. But that just leads to the same problem, how do I identify the endpoints of the interval?
After some thought, I came up with the following method of choosing an interval:
- Start with x = the smallest integer such that the function is defined at some number in (x,x+1)
- Look at the intervals (x,x+1/2) and (x+1/2,x+1). Choose the first that contains some number at which the function is defined. Repeat this until the function is defined on the whole interval.
- Pick the midpoint of the chosen interval.
But then I realized there's a problem: step 2 will only ever end if the function is defined on some interval. It won't work for functions that are only defined for rational numbers.
That's easy, I can just pick the rational number with the largest denominator. But what if the function is only defined for some irrational numbers?
Now I'm stuck. How can I do what I want?