S1: All midshipmen are not married , S2: Not all midshipmen are marriedDo these statements say different things? One good way to answer this question is to model them with first-order logic. For S1 we have $$ F_1 := \forall m[ \text{isMid}(m) \Rightarrow \neg \text{isMarried}(m) ] $$ and for S2 we have $$ F_2 := \neg \forall m[ \text{isMid}(m) \Rightarrow \text{isMarried}(m) ]. $$ Asking whether these are different leads to the following ...
Question: How does negation work with forall and exists?
Answer:
$\neg \forall x[ G ] \Longleftrightarrow \exists x[ \neg G ]$,
and
$\neg \exists x[ G ] \Longleftrightarrow \forall x[ \neg G ]$.
ACTIVITY
Note: Just assume strings in L(G) are our domain of discourse in order to simplify things. So, for example:
(6) is equivalent to: $\neg \forall s[ \neg \text{uniquePT}(s) ]$, equivalent to $\exists s[ \neg\neg \text{uniquePT}(s) ]$, equivalent to $\exists s[ \text{uniquePT}(s) ]$.
... so (6) is not a correct restatement of the grammar being ambiguous.Example 1: Let $A$ be the set of cardinal compass directions, i.e. $A = \{N,S,E,W\}$, and let $B$ be the corners of the unit square with lower-left corner at the origin. Here's a one-to-one correspondence: $$ f\text{ maps } N\rightarrow(1,1),N\rightarrow(0,0),N\rightarrow(0,1),N\rightarrow(1,0) $$
Add picture!With this definition, we can define what "finite" sets are and what their size is.
Example 2: $A = \{N,S,E,W\}$ can be put in one-to-one correspondence with $\{0,1,2,3\}$ via the function $0\rightarrow N,1\rightarrow N,2\rightarrow N,3\rightarrow N$, so $A$ is finite of size $4$.
Example 3: The set of (normal) academic periods in the
USNA week (i.e. $\{M1,M2,\ldots,F6\}$) is finite of size 30
via the mapping $f(i)$ given by Python code:
['M','T','W','R','F'][i//6] + str(i%6 + 1)
for $i \in \{0,1,\ldots,29\}$.
Think about it!
So, $\mathbb{N}$ itself is infinite. So what "size" do we say it has? We say it has size $\aleph_0$ (read "aleph null"), and any set it can be put into one-to-one correspondence with also has this size, though we often say that such sets are "countably infinite".
Example 4: The odd natural numbers are countably infinite, despite being a strict subset of $\mathbb{N}$! Why? Because $f(i) = 2i+1$ is a one-to-one mapping from $\mathbb{N}$ to the add natural numbers.
Example 5: The integers (aka $\mathbb{Z}$) are countably infinite, despite being a strict superset of $\mathbb{N}$! Here's the mapping: $$ f(i) = \left\{ \begin{array}{cl} 0 & \text{ if } i = 0\\ (i+1)/2 & \text{ if $i$ is odd}\\ -(i/2) & \text{ if $i$ is even} \end{array} \right. $$
Well ... actually it is possible. Infinity is weird like that.
The image to the right shows the beginning of a one-to-one mapping. The top-left dot corresponds to $i=0$ and $f(i) = (0,0)$. As you travel the twisting path, with each successive you increment $i$: so at $i=1$ we get $f(i) = (0,1)$ - note that I'm using (col,row) coordinate system here, which (I guess) is the reverse of what we've commonly done for grids. Sorry! The function $f:\mathbb{N}\rightarrow\mathbb{G}$ that I used for the image defined in the python code below.Of course, we should prove that this function $f$ has the desired properties - i.e. that each element of $\mathbb{G}$ is paired with one and only one element of $\mathbb{N}$ and vice versa. But you'll have to take my word for it ... or put together your own inductive proof.
| $\alpha = 0$ | . | $\overline{d}_{1,1}$/span> | $\overline{d}_{2,2}$/span> | $\overline{d}_{3,3}$/span> | $\overline{d}_{4,4}$/span> | $\overline{d}_{5,5}$/span> | $\overline{d}_{6,6}$/span> | $\overline{d}_{7,7}$/span> | $\overline{d}_{8,8}$/span> | $\overline{d}_{9,9}$/span> | $\ldots$ |
| $f(1) = \cdots$ | . | $d_{1,1}$/span> | $d_{1,2}$ | $d_{1,3}$ | $d_{1,4}$ | $d_{1,5}$ | $d_{1,6}$ | $d_{1,7}$ | $d_{1,8}$ | $d_{1,9}$ | $\ldots$ |
| $f(2) = \cdots$ | . | $d_{2,1}$ | $d_{2,2}$/span> | $d_{2,3}$ | $d_{2,4}$ | $d_{2,5}$ | $d_{2,6}$ | $d_{2,7}$ | $d_{2,8}$ | $d_{2,9}$ | $\ldots$ |
| $f(3) = \cdots$ | . | $d_{3,1}$ | $d_{3,2}$ | $d_{3,3}$/span> | $d_{3,4}$ | $d_{3,5}$ | $d_{3,6}$ | $d_{3,7}$ | $d_{3,8}$ | $d_{3,9}$ | $\ldots$ |
| $f(4) = \cdots$ | . | $d_{4,1}$ | $d_{4,2}$ | $d_{4,3}$ | $d_{4,4}$/span> | $d_{4,5}$ | $d_{4,6}$ | $d_{4,7}$ | $d_{4,8}$ | $d_{4,9}$ | $\ldots$ |
| $f(5) = \cdots$ | . | $d_{5,1}$ | $d_{5,2}$ | $d_{5,3}$ | $d_{5,4}$ | $d_{5,5}$/span> | $d_{5,6}$ | $d_{5,7}$ | $d_{5,8}$ | $d_{5,9}$ | $\ldots$ |
| $f(6) = \cdots$ | . | $d_{6,1}$ | $d_{6,2}$ | $d_{6,3}$ | $d_{6,4}$ | $d_{6,5}$ | $d_{6,6}$/span> | $d_{6,7}$ | $d_{6,8}$ | $d_{6,9}$ | $\ldots$ |
| $f(7) = \cdots$ | . | $d_{7,1}$ | $d_{7,2}$ | $d_{7,3}$ | $d_{7,4}$ | $d_{7,5}$ | $d_{7,6}$ | $d_{7,7}$/span> | $d_{7,8}$ | $d_{7,9}$ | $\ldots$ |
| $f(8) = \cdots$ | . | $d_{8,1}$ | $d_{8,2}$ | $d_{8,3}$ | $d_{8,4}$ | $d_{8,5}$ | $d_{8,6}$ | $d_{8,7}$ | $d_{8,8}$/span> | $d_{8,9}$ | $\ldots$ |
| $f(9) = \cdots$ | . | $d_{9,1}$ | $d_{9,2}$ | $d_{9,3}$ | $d_{9,4}$ | $d_{9,5}$ | $d_{9,6}$ | $d_{9,7}$ | $d_{9,8}$ | $d_{9,9}$/span> | $\ldots$ |
| $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ | $\ddots$ |