1
$\begingroup$

Good day to everybody.

I have an algorithm that returns a tuple of two values, the tuple can be either (True, A) or (False, B). So, for example, a tuple cannot be (True, B).

In my proposition I have the following statement:

Algorithm X returns (True, A) if and only if the condition Y is satisfied.

Unfortunately, I think that the statement is not very clear, because, if we take its inverse (which should be equivalent), it will look like this:

Algorithm X does not return (True, A) if and only if the condition Y is not satisfied.

So, what does does not return (True, A) mean here? It could mean that it returns (False, B), (False, A), or (True, B) (or why even not (True, C) given that we do not really know what the negation of A means?).

To ameliorate the issue, I thought of rewriting the statement as follows:

Algorithm X returns (True, A) if and only if the condition Y is satisfied (and (False,B) otherwise).

However, my statement then literally translates to the following two statements:

If Algorithm X returns (True, A), then the condition Y is satisfied (and (False,B) otherwise).

and

Algorithm X returns (True, A) if the condition Y is satisfied (and (False,B) otherwise).

Only the second of the sentences makes sense, and I could probably go with:

Algorithm X returns (True, A) if the condition Y is satisfied, and (False,B) otherwise.

However, I would like to keep the iff part and also keep the otherwise part in parentheses, to save me some necessary space (because I use the sentence a lot and I will only use the parentheses the first time to specify what the negation of (True, A) is).

So, should I go with:

Algorithm X returns (True, A) if and only if the condition Y is satisfied (and (False,B) otherwise).

Or is there any better more clear way I can write my statement and keep it compact for replication?

Thank you.

  • 0
    Isn't a ‘tuple’ commonly called a pair?2017-02-13
  • 0
    yes, but I prefer this more generic term2017-02-13

1 Answers 1

3

If the condition Y is satisfied, then Algorithm X returns (True,A). Otherwise, it returns (False,B).

Attempts to use "if and only if" with this complicated idea are bound to cause confusion.

  • 0
    It seems that there is no way around it, so I will use: Algorithm X returns (True,A) if the condition Y is satisfied, and (False,B) otherwise.2017-02-13