1
$\begingroup$

Suppose I have an Excel (or a csv) file with 2 columns: $a$ and $b$.

For each row I would like to forbid the following: $a\neq b$.

So for instance in row 1 I cannot have $a=3$ and $b=3$. However, the question is not how to implement it in Excel. The question is how to use the correct math notation to express this constraint.

Let's suppose the type of a and b are integers.

I don't understand how to formulate such a restriction using predicate logic math notation.

Here are all possible permutations assuming $a\neq b \leftrightarrow b\neq a$:

$\forall a\thinspace\exists b\,\left(a\neq b\right)$

$\forall b\thinspace\exists a\,\left(a\neq b\right)$

$\exists a\thinspace\forall b\,\left(a\neq b\right)$

$\exists b\thinspace\forall a\,\left(a\neq b\right)$

$\exists a\thinspace\exists b\,\left(a\neq b\right)$

$\forall a\thinspace\forall b\,\left(a\neq b\right)$

I have the feeling only the 2 following proposition are correct. Am I right?

$\forall a\thinspace\exists b\,\left(a\neq b\right)$

$\forall b\thinspace\exists a\,\left(a\neq b\right)$

$\endgroup$
  • 1
    $\begingroup$ What you've got doesn't make much sense, as $a$ and $b$ don't make any reference to the row they are in, which is critical here. $\endgroup$ – vadim123 Jan 10 '17 at 1:03
  • $\begingroup$ I think the relevant question here is : why do you want to do that? It might give you the answer you really want. $\endgroup$ – Patrick Da Silva Jan 10 '17 at 1:06
  • $\begingroup$ @vadim123 In my notation I assume that $a$ and $b$ are supposed to be in the same row. If my assumption is wrong, how how can I express my problem? $\endgroup$ – S12000 Jan 10 '17 at 1:09
  • $\begingroup$ @PatrickDaSilva for two reasons: 1 for a homework. 2 getting an answer to that question should help me to increase my understanding of predicate-logic. $\endgroup$ – S12000 Jan 10 '17 at 1:11
  • $\begingroup$ Why are you presupposing that there should be quantifiers on either/both $a$ and $b$? And what thing are you trying to express? If you want to say "the value in A3 and the value in B3 are distinct," and the names of these are $a$ and $b$, you write $a \ne b$. It's silly to write "for all $a$ and for some $b$, $a \ne b$, because you have actual single values for each of $a$ and $b$. Perhaps you can tell us the homework problem, rather than asking us to help you go down the wrong path in solving it. $\endgroup$ – John Hughes Jan 10 '17 at 1:24
3
$\begingroup$

The correct way is not to quantify over $A$ or $B$. The columns $A$ and $B$ are fixed; they are not varying over a domain. What is varying is the row, so we need to quantify over the rows. Let $N$ denote the set of rows. Then what you are trying to express is $$\forall n\in N, An\neq Bn$$

$\endgroup$
  • $\begingroup$ Presumably though the 'n's are meant to be subscripts. $\endgroup$ – timbo Jan 10 '17 at 2:13
  • $\begingroup$ @timbo in excel, you refer to (for example) the element in the 3rd row of column A as "A3" (no subscript). Since the original question is asking about something in excel, I presume this is why the answer writes "$An$" instead of "$A_n$." $\endgroup$ – Stahl Jan 10 '17 at 2:22
  • $\begingroup$ Ah, I see. I didn't have my Excel hat on. I thought it might be confused with multiplication (though that is unlikely I know). $\endgroup$ – timbo Jan 10 '17 at 2:25
  • $\begingroup$ @vadim123, thanks for the answer. Just a question. Would it be possible to declare $A$ and $B$ before the constraint $A_n \neq B_n$ ? $\endgroup$ – S12000 Jan 10 '17 at 12:19
  • $\begingroup$ I have also created an extension of this post : math.stackexchange.com/questions/2091838/… $\endgroup$ – S12000 Jan 10 '17 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.