# how to compare real variables

I want to compare real valued variables, $$V_{i}, V_{j}\in ℝ_{(0,1]}$$ I write a formula like, $$V_{i} - V_{j}=0$$ $$\forall i, \forall j\in {1,2,...,J}, i \neq j$$ but someone said this formula is wrong. He said how you can compare two real numbers exactly. I also try to write as, $$(|V_{i} - V_{j}|-\epsilon)=0,$$ for sufficiently small $\epsilon$. but again the issue is that one need to define $\epsilon$ precisely which is not possible under the define problem.

Any help in defining a simple formula to compare real valued variables is appreciated

Thanks!

• What do you mean by compare? What are you trying to say about the variables? Jan 6, 2017 at 0:13
• To expand on @David's comment, if you are speaking of pure mathematics, you just compare them: $V_i \ne V_j$ You don't need any formula; you just state what you want to say. If you are speaking of computers and you need an algorithm, well, computers cannot store real numbers; they can only store rational numbers, so your assumptions are faulty. Jan 6, 2017 at 0:17
• See here for instance (particularly this answer). You do have to supply the $\epsilon$ yourself. Jan 6, 2017 at 0:23
• Also, you might say that $V_i = V_j$ if $|V_i-V_j| \leq \epsilon$ for sufficiently small $\epsilon > 0$, but you probably wouldn't require equality in that second expression. Jan 6, 2017 at 1:42
• Actually it was part of an optimization problem. I want to optimize a cost function of allocating channels among a set of users under the constraint that if a user get multiple channels it should get the same share on each channel. A part of the optimization problem looks like, $$Maximize f_{0}(V_{1}^{2}+...+V_{J}^{2}) \\ subject to V_{i}-V_{j}=0, \forall i, \forall j\in {1,2,...,J}, i \neq j$$ $$V_{i}, V_{j}\in ℝ_{(0,1]}$$ Jan 7, 2017 at 5:15