Is there a maximum value between open $(0,1)$ set?

5.4k Views Asked by At

This question came up in my interview for a job application(you won't believe it but it was a C# programmer job application).

Let's say we have a open set $(0,1)$.

Can we say that there is a maximum value between $(0,1)$ or it is considered as undefined?

I answered that there is and it is

$$ 1 - \frac{1}{10^\infty} $$

But they said there isn't any max value. I still think my answer is correct.

Edit:

In some answers, it is basically said that:

$$ \frac{1}{10^\infty} > \frac{1}{2\cdot10^\infty} $$

Is this equation valid since there are infinite values in each side? I thought $$ 2\cdot\infty = \infty $$ and $$ \frac{\infty}{2} = \infty $$ So it doesn't matter how much you multiply or divide infinity, it is still infinity?

Sorry if the question is silly but I am a computer programmer, not mathematician.

8

There are 8 best solutions below

3
On BEST ANSWER

Your answer doesn't make much sense. It's equal to $1$ if anything (see Is it true that $0.999999999\ldots = 1$?).

You have to look at the definition: $m$ is the maximum if $m\in(0,1)$ and $\forall x\in(0,1),\ x\le m$. Clearly, this fails for any element $m\in(0,1)$ because $m<(m+1)/2<1$.

0
On

A maximum must be in the set. In the case of $(0,1)$ if $a \in (0,1)$ then the point $(1+a)/2$ is larger than $a$ and still in the set $(0,1).$ So there can be no max. There is a sup, namely $1,$ of the set $(0,1).$

0
On

For every $x\in(0,1)$ we can find an $y\in(0,1)$ (e.g. $y=\frac12+\frac12 x$) such that $x<y$. So no $x\in(0,1)$ is maximal in $(0,1)$.

0
On

That's a very creative answer, but infinity is tricky. If $$ 1 - \frac{1}{10^\infty} < 1 $$ would you not have to admit that $$ 1 - \frac{1}{10^\infty} < 1 - \frac{1}{2} \cdot \frac{1}{10^\infty} < 1 $$ as well? This would contradict your assertion that $1 - \frac{1}{10^\infty}$ was the maximum value of $(0,1)$.

You are right that this seems fishy, and this is the whole problem with treating infinity like a number. The only reasonable real number value of $\frac{1}{10^\infty}$ would be zero, so your number is $1$, and $1$ is not in the set.

2
On

On the surface, it would appear that there is a maximum.

However an open set is just that - open. No matter how close you get to the upper limit (which is 1) you can never touch it - but you can get a teeny bit closer each time.

Now, in (your) practice, there is a maximum. The maximum would be whatever data type the decimal was cast as. It would be impractical in a program to allow for any size of number - as you can see a repeating decimal would quickly lock up a cpu!

1
On

Mostly likely, the response they were looking for was a computer science answer, not a mathematician answer. As usual in interviews, they were probably more interested in the way you handled the question than your actual answer. I would have handled it something like this:

"Let's suppose we're storing 1.000... in a floating point variable. Now, we want to decrease that amount by the smallest amount we can. So the mantissa is going to go from all 0's to all 1's, and the exponent will increase by 1. How many bits is the mantissa? [say 10 for now] Okay good. The upper limit to the range (0, 1) is 1-2^-11. The leading 1 in the mantissa is implied but not physically stored, which is why the exponent is -11 instead of -10."

Next time an interviewer asks you any question that is difficult or open-ended, remember that they're more interested in the insight you demonstrate, your knowledge of the complexities, and your ability to view the problem from several different angles.

0
On

The set has a supremum (equal to 1), but not a maximum.

0
On

The mathematical side of the question has been dealt with in detail. But since you were applying for a job as a C# programmer, maybe they were (also) looking for a programming solution?

Floating point numbers have limited precision, i.e. they can only represent a finite number of different values. Therefore, the open interval $(0,1)$ does have a maximum: The next smallest number before the supremum $1$.

In C#, you can use the following trick to find this number (see https://stackoverflow.com/a/15332024/469708):

double supremum = 1;
long bitsOfSupremum = System.BitConverter.DoubleToInt64Bits(supremum);
double max = System.BitConverter.Int64BitsToDouble(bitsOfSupremum - 1);

On my machine the result is $0.99999999999999989$.