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

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.

• $1/10^\infty$ is not a real number. – coffeemath Jan 22 '15 at 9:44
• In C#, the set does have a maximum (1-FLT_EPSILON/2 in the float data type). – TonyK Jan 22 '15 at 10:41
• @TonyK: and that's what I'd consider the "right" interview answer, unless it was presented as being a mathematics question. I guess since the interviewers said there wasn't a max, they didn't mean it to be a C# question, but personally I'd be reasonably well impressed by a candidate who made it one. – Steve Jessop Jan 22 '15 at 12:11
• There is no '=' sign in '$\tfrac{1}{10^\infty} > \tfrac{1}{2\cdot10^\infty}$' so it is an inequality, not an equation. – CiaPan Jan 22 '15 at 13:20
• $\infty$ is not a real number. Neither is $\frac1{10^\infty}$. (Before you ask, they're not complex numbers either…) – Akiva Weinberger Jan 22 '15 at 16:28

## 8 Answers

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$.

• And of course we could use the geometric mean instead of the arithmetic mean, since for $m ∈ (0,1) \space m<\sqrt m<1$ – PM 2Ring Jan 22 '15 at 9:42
• @PM2Ring Or the logarithmic mean $\frac{m-1}{\ln m}$. – user2345215 Jan 22 '15 at 9:55
• Ok, although it's not so easy to see that the logarithmic mean fits the criteria. :) – PM 2Ring Jan 22 '15 at 10:01

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.

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).$

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

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)$.

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.

• In interviews, as on the job, it's often in your best interest to answer a question with a question. For example: 1) Do you want a pure mathematics answer or a computer science answer? 2) Are we more concerned with rounding error or something else? 3) Can you give me a little context? What are we trying to do? Any of these would give you insight into what they really want. – Jim Strieter Jan 22 '15 at 14:39

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!

• There's a maximum because in computer/hardware world, everything is finite and discrete – nperson325681 Jan 22 '15 at 10:57
• Assuming digital logic - and not analog. – Ramrod Jan 22 '15 at 11:00

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$.