
▶
### Problem 7
Suppose \( R \) is the relation on \( \mathbb{Z} \times \mathbb{Z} \) where \( aRb \) means that \( a \) has the same lowest order (right-most) digit as \( b \).
**Example:**
\((a, b) \in R\) when \( a = 1234 \) and \( b = 64 \) because both numbers end in 4.
Determine whether \( R \) is an equivalence relation. Show your reasoning.
---
### Solution
Yes, \( R \) is an equivalence relation.
- **Reflexive:**
\( a \) ends with the same digit as itself, so \((a, a) \in R\).
- **Symmetric:**
If \( a \) ends with the same digit as \( b \), then \( b \) ends with the same digit as \( a \).
Thus, if \((a, b) \in R\), then \((b, a) \in R\).
- **Transitive:**
If \( a \) ends with the same digit as \( b \), and \( b \) ends with the same digit as \( c \), then \( a \) ends with the same digit as \( c \).
Hence, \((a, c) \in R\).
If asked this on the final, you must show proof of all three required properties.
![### 6. Consider the Turing machine
\[
T = (Q, \Lambda, q_0, \delta)
\]
where:
\[
\begin{aligned}
\delta(q_0, 0) &= (1, R, q_1) \\
\delta(q_0, 1) &= (1, R, q_1) \\
\delta(q_1, 0) &= (1, L, q_0) \\
\delta(q_1, 1) &= (0, R, q_0) \\
\delta(q_0, \#) &= (1, R, q_1) \\
\delta(q_1, \#) &= (\#, R, h)
\end{aligned}
\]
For the following tape, determine the final tape when \(T\) halts, assuming that \(T\) begins in state \(q_0\) at the position indicated by the arrow. Show all steps.
... # # 1 1 0 # # ...
起始箭头在第一个 1 上
使用中文解题](https://manimvideo.explanation.fun/video/cover/590382674076979201.png)
▶
### 6. Consider the Turing machine
\[
T = (Q, \Lambda, q_0, \delta)
\]
where:
\[
\begin{aligned}
\delta(q_0, 0) &= (1, R, q_1) \\
\delta(q_0, 1) &= (1, R, q_1) \\
\delta(q_1, 0) &= (1, L, q_0) \\
\delta(q_1, 1) &= (0, R, q_0) \\
\delta(q_0, \#) &= (1, R, q_1) \\
\delta(q_1, \#) &= (\#, R, h)
\end{aligned}
\]
For the following tape, determine the final tape when \(T\) halts, assuming that \(T\) begins in state \(q_0\) at the position indicated by the arrow. Show all steps.
... # # 1 1 0 # # ...
起始箭头在第一个 1 上
使用中文解题

▶
## 2.
Let \( G \) be the context-free grammar with non-terminal symbols
\( V = \{S, A, B\} \), terminal symbols \( \Sigma = \{a, b\} \), start symbol \( S \),
and productions \( P \):
- \( S \to ABb \)
- \( S \to Bb \)
- \( A \to aB \)
- \( A \to b \)
- \( B \to ab \)
- \( B \to \epsilon \)
### Which of these strings can be generated by \( G \)?
(a) ab
(b) bb
(c) baaba
(d) aababb
(e) abb
(f) bbb
---
### Solution
All strings must end in **b**, that eliminates **(c)**.
It isn’t possible to make three consecutive **b**’s, so **(f)** is eliminated.
**(a), (b), (d), and (e)** are all generated by \( G \).