![Here’s the full markdown version of your provided images:
---
### (a) Adjacency List Representation
**Graph:**
Vertices: a, b, c, d
**Adjacency List:**
| Vertex | Adjacent Vertices |
| :----: | :---------------: |
| a | c |
| b | d |
| c | b, d |
| d | b |
---
### (b) Adjacency Matrix Representation
**Graph:**
Vertices: a, b, c, d
**Adjacency Matrix:**
[
M_b =
\begin{pmatrix}
& a & b & c & d \
a & 0 & 1 & 0 & 1 \
b & 1 & 0 & 1 & 1 \
c & 0 & 1 & 0 & 1 \
d & 1 & 1 & 1 & 0
\end{pmatrix}
]
---
### (c) Adjacency Matrix Representation
**Graph:**
Vertices: a, b, c, d
**Adjacency Matrix:**
[
M_c =
\begin{pmatrix}
& a & b & c & d \
a & 1 & 0 & 1 & 1 \
b & 0 & 1 & 0 & 1 \
c & 1 & 1 & 1 & 0 \
d & 0 & 1 & 0 & 1
\end{pmatrix}
]
---
注意使用 mathtex 显示公式
中文输出](https://manimvideo.explanation.fun/video/cover/578443240306839553.png)
▶
Here’s the full markdown version of your provided images:
---
### (a) Adjacency List Representation
**Graph:**
Vertices: a, b, c, d
**Adjacency List:**
| Vertex | Adjacent Vertices |
| :----: | :---------------: |
| a | c |
| b | d |
| c | b, d |
| d | b |
---
### (b) Adjacency Matrix Representation
**Graph:**
Vertices: a, b, c, d
**Adjacency Matrix:**
[
M_b =
\begin{pmatrix}
& a & b & c & d \
a & 0 & 1 & 0 & 1 \
b & 1 & 0 & 1 & 1 \
c & 0 & 1 & 0 & 1 \
d & 1 & 1 & 1 & 0
\end{pmatrix}
]
---
### (c) Adjacency Matrix Representation
**Graph:**
Vertices: a, b, c, d
**Adjacency Matrix:**
[
M_c =
\begin{pmatrix}
& a & b & c & d \
a & 1 & 0 & 1 & 1 \
b & 0 & 1 & 0 & 1 \
c & 1 & 1 & 1 & 0 \
d & 0 & 1 & 0 & 1
\end{pmatrix}
]
---
注意使用 mathtex 显示公式
中文输出
![### 5. Verify that the following program segment is correct with respect to the initial assertion *T* and the final assertion: [ (x \le y \land \text{max} = y) \lor (x > y \land \text{max} = x) ] ```plaintext if x <= y then max := y else max := x ``` --- **Solution:** Initial assertion *T* means this segment will always run and everything is always correct at the beginning of the segment. If ( x < y ) initially, *max* is set equal to *y*, so the left side of the final assertion ∨: ((x \le y \land \text{max} = y)) is true. If ( x = y ) initially, *max* is set equal to *y*, so ((x \le y \land \text{max} = y)) is again true. If ( x > y ), *max* is set equal to *x*, so the right side of the final assertion ∨: ((x > y \land \text{max} = x)) is true. Since ∨ is true whenever one or the other or both sides are true, the final assertion is always true and the program segment is correct. 注意使用 mathtex 显示公式
中文解题](https://manimvideo.explanation.fun/video/cover/578435076945432577.png)
▶
### 5. Verify that the following program segment is correct with respect to the initial assertion *T* and the final assertion: [ (x \le y \land \text{max} = y) \lor (x > y \land \text{max} = x) ] ```plaintext if x <= y then max := y else max := x ``` --- **Solution:** Initial assertion *T* means this segment will always run and everything is always correct at the beginning of the segment. If ( x < y ) initially, *max* is set equal to *y*, so the left side of the final assertion ∨: ((x \le y \land \text{max} = y)) is true. If ( x = y ) initially, *max* is set equal to *y*, so ((x \le y \land \text{max} = y)) is again true. If ( x > y ), *max* is set equal to *x*, so the right side of the final assertion ∨: ((x > y \land \text{max} = x)) is true. Since ∨ is true whenever one or the other or both sides are true, the final assertion is always true and the program segment is correct. 注意使用 mathtex 显示公式
中文解题
![### 5. Verify that the following program segment is correct with respect to the initial assertion *T* and the final assertion:
[
(x \le y \land \text{max} = y) \lor (x > y \land \text{max} = x)
]
```plaintext
if x <= y then
max := y
else
max := x
```
---
**Solution:**
Initial assertion *T* means this segment will always run and everything is always correct at the beginning of the segment.
If ( x < y ) initially, *max* is set equal to *y*, so the left side of the final assertion ∨:
((x \le y \land \text{max} = y)) is true.
If ( x = y ) initially, *max* is set equal to *y*, so ((x \le y \land \text{max} = y)) is again true.
If ( x > y ), *max* is set equal to *x*, so the right side of the final assertion ∨:
((x > y \land \text{max} = x)) is true.
Since ∨ is true whenever one or the other or both sides are true, the final assertion is always true and the program segment is correct.
注意使用 mathtex 显示公式](https://manimvideo.explanation.fun/video/cover/578434488337780737.png)
▶
### 5. Verify that the following program segment is correct with respect to the initial assertion *T* and the final assertion:
[
(x \le y \land \text{max} = y) \lor (x > y \land \text{max} = x)
]
```plaintext
if x <= y then
max := y
else
max := x
```
---
**Solution:**
Initial assertion *T* means this segment will always run and everything is always correct at the beginning of the segment.
If ( x < y ) initially, *max* is set equal to *y*, so the left side of the final assertion ∨:
((x \le y \land \text{max} = y)) is true.
If ( x = y ) initially, *max* is set equal to *y*, so ((x \le y \land \text{max} = y)) is again true.
If ( x > y ), *max* is set equal to *x*, so the right side of the final assertion ∨:
((x > y \land \text{max} = x)) is true.
Since ∨ is true whenever one or the other or both sides are true, the final assertion is always true and the program segment is correct.
注意使用 mathtex 显示公式