null
/nŭl/
adjective
- Having no legal force; invalid. render a contract null and void.
- Of no consequence, effect, or value; insignificant.
- Amounting to nothing; absent or nonexistent. a null result.
How do you define a null set?
What is a null set example?
What is a null set called?
Videos
The distinction between the empty set and the number
is similar to that between
NULL and ZERO. For example, the set of real solutions (or informally "the solution") to is
, but the solution to
is
.
In my mind there is no need for a concept like NULL in mathematics if you think of NULL as in NULL-pointers.
NULL in this sense is a technical necessity because you cannot un-define a variable: Once a variable has been assigned a value, a certain bit of memory is reserved for this variable and this memory is marked as re-usable only if the variable goes out of scope (simplified speaking).
You cannot say "The variable with this name doesn't exist anymore." without letting it go out of scope, because that would make language interpretation much more complicated without many benefits. Therefore, to indicate that the value of the variable has no meaning, one uses NULL.
What NULL stands for in the end depends upon the programming language: In some it is a special keyword, but in some it is also just a different name for the integer .
You can assign an arbitrary value to NULL in mathematics as mentioned in the other replies (,
, etc.) but as mathematics has nothing to do with memory allocation there is really no need for such a thing as
NULL.
Perhaps what you find confusing is the use of set-builder notation to define $P, Q, R$: Included in between { ... } are the condition(s) that any "candidate" element must satisfy in order to be included in the set, and a set defined by set-builder notation contains all, and only, those elements satisfying all the conditions given.
In each of $P,\; Q, \;R$, set-builder notation is used to provide the conditions for inclusion in each set, respectively. Note: unless otherwise stipulated, you can take conditions separated by a comma to be a conjunction of conditions; that is: $$X = \{x : \text{(condition 1), (condition 2), ...., (condition n)}\}$$ means $X$ is the set of all x such that x satisfies (condition 1) AND x satisfies (condition 2) AND ... AND x satisfies (condition n).
$$P = \{x: x^2 = 4, x \text{ is odd}\}$$
The only solution to $x^2 = 4$ are $x = -2$ or $x = 2$, neither of which is odd. Hence there are $no$ elements in $P$; that is, $\;P = \varnothing$.
$$Q= \{x: x^2 = 9, x \text{ is even}\}$$
The only solutions to $x^2 = 9$ are $x = -3$ or $x = 3$, neither of which is even. Hence, there are no elements in $Q$; that is, $\;Q = \varnothing$.
$$R = \{x: x^2 = 9, 2x =4\}$$
$x = 2$ is the only solution to $2x = 4$, but $x = 2$ is not a solution to $x^2 = 9$, (and neither $x = 3$ nor $x = -3$ is a solution to $2x = 4$). Hence, there are no elements in $R$; that is, $\;R = \varnothing$.
NOTE: As an aside, regarding notation - sometimes instead of a colon :preceding the defining characteristics of a given element, you'll see | in place of the colon. E.g., $$P = \{x: x^2 = 4, x \text{ is odd}\}\iff \{x\mid x^2 = 4, x \text{ is odd}\}$$
A Null Set is a set with no elements. While the author of your book uses the notation $\emptyset$, I prefer to use $\{\},$ to emphasize, that the set contains nothing. The example sets $P,\ Q$ and $R$ are all null sets, because there is no $x$, that can satisfy the condition of being included in the set.
Null: The Billion Dollar Mistake. Tony Hoare:
I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. In recent years, a number of program analysers like PREfix and PREfast in Microsoft have been used to check references, and give warnings if there is a risk they may be non-null. More recent programming languages like Spec# have introduced declarations for non-null references. This is the solution, which I rejected in 1965.
null is a sentinel value that is not an integer, not a string, not a boolean - not anything really, except something to hold and be a "not there" value. Don't treat it as or expect it to be a 0, or an empty string or an empty list. Those are all valid values and can be geniunely valid values in many circumstances - the idea of a null instead means there is no value there.
Perhaps it's a little bit like a function throwing an exception instead of returning a value. Except instead of manufacturing and returning an ordinary value with a special meaning, it returns a special value that already has a special meaning. If a language expects you to work with null, then you can't really ignore it.