0

On one hand, an empty string doesn't contain any alphabet and number, which looks violate the condition 'contain alphabet and number', on other hand, the opposite of the condition is 'contain non-alphabet and non-numeric characters', which an empty string doesn't contain any, and should fulfill the condition. Does the empty fulfill the condition?

Gstestso
  • 103
  • 1
    The correct statement is that every entry in the string is an alphabetic or numeric character. This is vacuously true for the empty string, which has no entries at all. – Lee Mosher Aug 08 '16 at 02:14
  • In math "contains only x" does not in any way implies "contains ", so an empty string certainly does "contain only x". "contains only x" means "contains nothing but x" or "if it contains anything at all it contains x". But it does not imply it contains anything. On the other hand "contains x" although it means it must contain x it doesn't actually contains only x. It's fair (but misleading) to say "Z contains the even even integers" that is true. It also contains the odd integers. .... tbc... – fleablood Aug 08 '16 at 04:23
  • $\emptyset $ contains only even integers is true. $\emptyset $ contains even integers is false. $\emptyset$ contains even integers and only even integers is false. $\mathbb Z $ contains even integers is true. $\mathbb Z $ contains only even integers is false. $\mathbb Z$ contains and only contains even integers is false. 2Z contains only integers is true. 2Z contains even integers is true. 2Z contains and only contains even integers is true. – fleablood Aug 08 '16 at 04:29

1 Answers1

2

It depends exactly how you phrase the condition.

The empty string does satisfy the condition, "Contains nothing other than numbers and letters."

However, it does not satisfy the condition, "Contains numbers and/or letters, and nothing but numbers and letters."

The latter condition has a positive component, while the former does not.

This becomes a problem in natural language, because some people would interpret "contains only numbers and letters" as as meaning that the string does have to contain something; however, I think this is the minority view. Bottom line, though, this is why we need to be careful to state all conditions clearly.

Noah Schweber
  • 245,398