DFS and top-down/bottom-up closure equivalence.

main
Joshua Potter 2024-10-23 18:08:21 -06:00
parent 5d949759f7
commit 22c6429e32
13 changed files with 563 additions and 23 deletions

View File

@ -214,7 +214,8 @@
"b-tree-split-node.png", "b-tree-split-node.png",
"b-tree-initial.png", "b-tree-initial.png",
"b-tree-inserted-b.png", "b-tree-inserted-b.png",
"b-tree-inserted-q.png" "b-tree-inserted-q.png",
"dfs.gif"
], ],
"File Hashes": { "File Hashes": {
"algorithms/index.md": "3ac071354e55242919cc574eb43de6f8", "algorithms/index.md": "3ac071354e55242919cc574eb43de6f8",
@ -301,7 +302,7 @@
"_journal/2024-02/2024-02-14.md": "aa009f9569e175a8104b0537ebcc5520", "_journal/2024-02/2024-02-14.md": "aa009f9569e175a8104b0537ebcc5520",
"_journal/2024-02-16.md": "5cc129254afd553829be3364facd23db", "_journal/2024-02-16.md": "5cc129254afd553829be3364facd23db",
"_journal/2024-02/2024-02-15.md": "16cb7563d404cb543719b7bb5037aeed", "_journal/2024-02/2024-02-15.md": "16cb7563d404cb543719b7bb5037aeed",
"algebra/floor-ceiling.md": "a22efe853ad1234b2d3e0d7cc7e6fc47", "algebra/floor-ceiling.md": "78496445da3054dd720f00a485fc433a",
"algebra/index.md": "90b842eb694938d87c7c68779a5cacd1", "algebra/index.md": "90b842eb694938d87c7c68779a5cacd1",
"algorithms/binary-search.md": "8533a05ea372e007ab4e8a36fd2772a9", "algorithms/binary-search.md": "8533a05ea372e007ab4e8a36fd2772a9",
"_journal/2024-02-17.md": "7c37cb10515ed3d2f5388eaf02a67048", "_journal/2024-02-17.md": "7c37cb10515ed3d2f5388eaf02a67048",
@ -394,7 +395,7 @@
"_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f", "_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f",
"_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b", "_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b",
"set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53", "set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53",
"set/index.md": "05a73d62902e3eecec7ce7b902027590", "set/index.md": "14daeda39c344ea1d4b8c8eac9fb99b0",
"set/graphs.md": "a56f867f51e69cb7438bbdf6215fca36", "set/graphs.md": "a56f867f51e69cb7438bbdf6215fca36",
"_journal/2024-03-19.md": "a0807691819725bf44c0262405e97cbb", "_journal/2024-03-19.md": "a0807691819725bf44c0262405e97cbb",
"_journal/2024-03/2024-03-18.md": "2c711c50247a9880f7ed0d33b16e1101", "_journal/2024-03/2024-03-18.md": "2c711c50247a9880f7ed0d33b16e1101",
@ -606,7 +607,7 @@
"_journal/2024-06/2024-06-12.md": "f82dfa74d0def8c3179d3d076f94558e", "_journal/2024-06/2024-06-12.md": "f82dfa74d0def8c3179d3d076f94558e",
"_journal/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307", "_journal/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307",
"_journal/2024-06/2024-06-13.md": "e2722a00585d94794a089e8035e05728", "_journal/2024-06/2024-06-13.md": "e2722a00585d94794a089e8035e05728",
"set/functions.md": "3d08bbd3fb31eba419058264ed804e22", "set/functions.md": "979e5fcf8cda2ab0bbabe67c589c6a5c",
"_journal/2024-06-15.md": "92cb8dc5c98e10832fb70c0e3ab3cec4", "_journal/2024-06-15.md": "92cb8dc5c98e10832fb70c0e3ab3cec4",
"_journal/2024-06/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307", "_journal/2024-06/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307",
"lambda-calculus/beta-reduction.md": "0935987f2bac0e6298735f2b26fd5885", "lambda-calculus/beta-reduction.md": "0935987f2bac0e6298735f2b26fd5885",
@ -698,7 +699,7 @@
"formal-system/proof-system/equiv-trans.md": "72d96306d5bc818e67b5a6aa777b7036", "formal-system/proof-system/equiv-trans.md": "72d96306d5bc818e67b5a6aa777b7036",
"formal-system/logical-system/index.md": "708bb1547e7343c236068c18da3f5dc0", "formal-system/logical-system/index.md": "708bb1547e7343c236068c18da3f5dc0",
"formal-system/logical-system/pred-logic.md": "4559020fde708b9d0184d9fd56559c98", "formal-system/logical-system/pred-logic.md": "4559020fde708b9d0184d9fd56559c98",
"formal-system/logical-system/prop-logic.md": "b61ce051795d5a951c763b928ec5cea8", "formal-system/logical-system/prop-logic.md": "e486b55b20298d41fddce0d1ec53f391",
"formal-system/index.md": "28b596a8ffa7dca05e8c0b890be43aec", "formal-system/index.md": "28b596a8ffa7dca05e8c0b890be43aec",
"programming/short-circuit.md": "c256ced42dc3b493aff5a356e5383b6e", "programming/short-circuit.md": "c256ced42dc3b493aff5a356e5383b6e",
"formal-system/abstract-rewriting.md": "8424314a627851c5b94be6163f64ba30", "formal-system/abstract-rewriting.md": "8424314a627851c5b94be6163f64ba30",
@ -791,7 +792,7 @@
"c17/enums.md": "9414fb67aa256a0a11b7240534c67bf6", "c17/enums.md": "9414fb67aa256a0a11b7240534c67bf6",
"c17/derived-types.md": "6fb8f23a2423f05d5bdccb6672a32e38", "c17/derived-types.md": "6fb8f23a2423f05d5bdccb6672a32e38",
"c17/basic-types.md": "7c6653bf6dc24c2f2aa72fc95c4f7875", "c17/basic-types.md": "7c6653bf6dc24c2f2aa72fc95c4f7875",
"c17/types/simple.md": "48e455d1cb6a631fe74e419e52e0a695", "c17/types/simple.md": "b53fd365671848f09e6a0cd46e17c1bf",
"c17/types/enumerated.md": "e1f70a30677c776b7b44ac3e0ff4e76d", "c17/types/enumerated.md": "e1f70a30677c776b7b44ac3e0ff4e76d",
"c17/types/derived.md": "cd77112313bd0f9cf99b0f224a364179", "c17/types/derived.md": "cd77112313bd0f9cf99b0f224a364179",
"c17/types/basic.md": "5064e21e683c0218890058882e06b6f3", "c17/types/basic.md": "5064e21e683c0218890058882e06b6f3",
@ -843,7 +844,7 @@
"_journal/2024-09/2024-09-20.md": "69cf79bb0cb8c116a9c0f671671fdc44", "_journal/2024-09/2024-09-20.md": "69cf79bb0cb8c116a9c0f671671fdc44",
"_journal/2024-09-22.md": "2d00b00b4eb9964465f30210187603cf", "_journal/2024-09-22.md": "2d00b00b4eb9964465f30210187603cf",
"_journal/2024-09/2024-09-21.md": "2e6425f4db0187082947c3e0cb24f754", "_journal/2024-09/2024-09-21.md": "2e6425f4db0187082947c3e0cb24f754",
"algorithms/bfs.md": "bc322d510fe25389b3996344b126e497", "algorithms/bfs.md": "082644a948180337a0065bb11d28aff9",
"_journal/2024-09-23.md": "c0a87ca092a36e2761e844f34296f2f7", "_journal/2024-09-23.md": "c0a87ca092a36e2761e844f34296f2f7",
"_journal/2024-09/2024-09-22.md": "c27835ce1d82d10c906b40b420145d0c", "_journal/2024-09/2024-09-22.md": "c27835ce1d82d10c906b40b420145d0c",
"_journal/2024-09-25.md": "4527ac5c132aaf5adc6e624c5e4aca5e", "_journal/2024-09-25.md": "4527ac5c132aaf5adc6e624c5e4aca5e",
@ -874,7 +875,7 @@
"_journal/2024-10/2024-10-06.md": "65a8e538144f59ee9e7296110cc9aa14", "_journal/2024-10/2024-10-06.md": "65a8e538144f59ee9e7296110cc9aa14",
"_journal/2024-10-09.md": "66acb6c8abbf0c860966223f3299c2bc", "_journal/2024-10-09.md": "66acb6c8abbf0c860966223f3299c2bc",
"_journal/2024-10/2024-10-08.md": "2f737d8198b12bf635808964c4887ae1", "_journal/2024-10/2024-10-08.md": "2f737d8198b12bf635808964c4887ae1",
"x86-64/procedures.md": "c36268b99c0681bfca245e0538a302e0", "x86-64/procedures.md": "b7b8233deb29727b53938a78e1a797f4",
"_journal/2024-10-10.md": "29e4be2c164c63f8b7aab56bddee3dd6", "_journal/2024-10-10.md": "29e4be2c164c63f8b7aab56bddee3dd6",
"_journal/2024-10/2024-10-09.md": "b718c6f4cfe3069fcc0faf07ec414f73", "_journal/2024-10/2024-10-09.md": "b718c6f4cfe3069fcc0faf07ec414f73",
"_journal/2024-10-15.md": "6e696a8d16ba257ed89e8564b771d290", "_journal/2024-10-15.md": "6e696a8d16ba257ed89e8564b771d290",
@ -882,7 +883,19 @@
"_journal/2024-10/2024-10-13.md": "8882c01060a4a909fd890180db356e73", "_journal/2024-10/2024-10-13.md": "8882c01060a4a909fd890180db356e73",
"_journal/2024-10/2024-10-12.md": "1c299384b7f1fffa4e9f50fa5a1c05c2", "_journal/2024-10/2024-10-12.md": "1c299384b7f1fffa4e9f50fa5a1c05c2",
"_journal/2024-10/2024-10-11.md": "6c98c6541efcb92854c1de68a2881d89", "_journal/2024-10/2024-10-11.md": "6c98c6541efcb92854c1de68a2881d89",
"_journal/2024-10/2024-10-10.md": "b7c386d47a9f1e860effaa36001404ba" "_journal/2024-10/2024-10-10.md": "b7c386d47a9f1e860effaa36001404ba",
"_journal/2024-10-21.md": "de1a0861e87df29aeff11a291f8fbd45",
"_journal/2024-10/2024-10-20.md": "cae8694ffce3aed71a29446d8444c7a3",
"_journal/2024-10/2024-10-19.md": "2b221729d097a67c8d8f68a416889fe8",
"_journal/2024-10/2024-10-18.md": "b44458dad4be715a62b21d0621209e36",
"_journal/2024-10/2024-10-17.md": "6e1e71cac789280fd228591afac83e55",
"_journal/2024-10/2024-10-16.md": "cd778e1be2737462d885ae038c7b9744",
"_journal/2024-10/2024-10-15.md": "c21679bd2c3b29f5a86d56a1fd23b18f",
"_journal/2024-10-22.md": "4af65962007cfecdb2c679b44b56d25f",
"algorithms/dfs.md": "5fe40544db71b5cc79f4f8149478fc8e",
"_journal/2024-10/2024-10-21.md": "de1a0861e87df29aeff11a291f8fbd45",
"_journal/2024-10-23.md": "51b2ca6edf23b6a64fd7d3638a0b54cb",
"_journal/2024-10/2024-10-22.md": "5ff4eb7eba58e77c4fb65b7162a485e6"
}, },
"fields_dict": { "fields_dict": {
"Basic": [ "Basic": [

View File

@ -0,0 +1,11 @@
---
title: "2024-10-23"
---
- [ ] Anki Flashcards
- [x] KoL
- [ ] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* Notes on closures and proof bottom-up and top-down are equal.

View File

@ -2,7 +2,7 @@
title: "2024-10-20" title: "2024-10-20"
--- ---
- [ ] Anki Flashcards - [x] Anki Flashcards
- [x] KoL - [x] KoL
- [ ] OGS - [ ] OGS
- [ ] Sheet Music (10 min.) - [ ] Sheet Music (10 min.)

View File

@ -0,0 +1,11 @@
---
title: "2024-10-21"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* More notes on the third integral argument for x86-64 procedures.

View File

@ -0,0 +1,12 @@
---
title: "2024-10-22"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* Added notes on [[dfs|DFS]].
* Proof on isomorphism between Peano systems and $\langle \omega, \sigma, 0 \rangle$.

View File

@ -44,7 +44,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
When does $\lfloor x / 2 \rfloor = \lceil x / 2 \rceil$? Given integer $x$, when does $\lfloor x / 2 \rfloor = \lceil x / 2 \rceil$?
Back: When $x$ is even. Back: When $x$ is even.
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708110779668--> <!--ID: 1708110779668-->
@ -52,7 +52,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
When does $\lfloor x / 2 \rfloor \neq \lceil x / 2 \rceil$? Given integer $x$, when does $\lfloor x / 2 \rfloor \neq \lceil x / 2 \rceil$?
Back: When $x$ is odd. Back: When $x$ is odd.
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708110779674--> <!--ID: 1708110779674-->

View File

@ -9,7 +9,7 @@ tags:
## Overview ## Overview
Bread-first search operates on a graph $G = \langle V, E \rangle$ and a **source** vertex $s$. It works by distinguishing between discovered and undiscovered nodes, incrementally marking nodes adjacent to discovered nodes from undiscovered to discovered. Bread-first search operates on a graph $G = \langle V, E \rangle$ and a **source** vertex $s$.
![[bfs.gif]] ![[bfs.gif]]
@ -167,7 +167,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
*Why* is BFS of an adjacency-list representation $O(\lvert V \rvert + \lvert E \rvert)$? *Why* is BFS of an adjacency-list representation $O(\lvert V \rvert + \lvert E \rvert)$?
Back: For each vertex being analyzed, we only examine its immediately adjacent vertices. Back: For each vertex being analyzed, we examine all of its adjacent vertices.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022). Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1727044184060--> <!--ID: 1727044184060-->
END%% END%%

129
notes/algorithms/dfs.md Normal file
View File

@ -0,0 +1,129 @@
---
title: Depth-First Search
TARGET DECK: Obsidian::STEM
FILE TAGS: algorithm data_structure::graph
tags:
- dfs
- graph
---
## Overview
Depth-first search operates on a graph $G = \langle V, E \rangle$ and a **source** vertex $s$.
![[dfs.gif]]
%%ANKI
Basic
What is DFS an acronym for?
Back: **D**epth-**f**irst **s**earch.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729224-->
END%%
%%ANKI
Cloze
Depth-first search is characterized by a graph and a {source vertex}.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729228-->
END%%
%%ANKI
Basic
Which of undirected and directed graphs is DFS applicable to?
Back: Both.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729231-->
END%%
%%ANKI
Basic
With respect to depth-first trees, what does the predecessor of a node $N$ refer to?
Back: The node from which $N$ was discovered.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729235-->
END%%
%%ANKI
Basic
What ADT is typically used to manage the set of most recently discovered DFS vertices?
Back: A stack.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729238-->
END%%
%%ANKI
Cloze
A {1:queue} is to {2:BFS} whereas a {2:stack} is to {1:DFS}.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729242-->
END%%
%%ANKI
Basic
Which vertices are not discovered during a graph DFS?
Back: Those not reachable from the source vertex.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729245-->
END%%
%%ANKI
Basic
What basic graph algorithm is the following a demonstration of?
![[dfs.gif]]
Back: Depth-first search.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729249-->
END%%
%%ANKI
Basic
Which standard graph representation has worst-case DFS running time of $O(\lvert V \rvert + \lvert E \rvert)$?
Back: The adjacency-list representation.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729252-->
END%%
%%ANKI
Basic
Given graph $\langle V, E \rangle$ with adjacency-list representation, what is the worst-case run time of DFS?
Back: $O(\lvert V \rvert + \lvert E \rvert)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729256-->
END%%
%%ANKI
Basic
Which standard graph representation has worst-case DFS running time of $O(\lvert V \rvert^2)$?
Back: The adjacency-matrix representation.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729260-->
END%%
%%ANKI
Basic
Given graph $\langle V, E \rangle$ with adjacency-matrix representation, what is the worst-case run time of DFS?
Back: $O(\lvert V \rvert^2)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729264-->
END%%
%%ANKI
Basic
*Why* is DFS of an adjacency-list representation $O(\lvert V \rvert + \lvert E \rvert)$?
Back: For each vertex being analyzed, we examine all of its adjacent vertices.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729268-->
END%%
%%ANKI
Basic
*Why* is DFS of an adjacency-matrix representation $O(\lvert V \rvert^2)$?
Back: For each vertex being analyzed, we must examine $\lvert V \rvert$ entries for adjacent vertices.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1729641729272-->
END%%
## Bibliography
* Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).

View File

@ -1211,7 +1211,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
Suppose `uintN_t` exists. What is its precision? Suppose `uintN_t` exists. What is its precision?
Back: `N` Back: `N` bits.
Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020). Reference: Jens Gustedt, _Modern C_ (Shelter Island, NY: Manning Publications Co, 2020).
<!--ID: 1727551341574--> <!--ID: 1727551341574-->
END%% END%%

View File

@ -34,14 +34,6 @@ Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n
<!--ID: 1708199272076--> <!--ID: 1708199272076-->
END%% END%%
%%ANKI
Basic
What two categories do propositions fall within?
Back: Atomic and molecular propositions.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708199272083-->
END%%
%%ANKI %%ANKI
Basic Basic
What is an atomic proposition? What is an atomic proposition?

View File

@ -1708,6 +1708,164 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1726363070015--> <!--ID: 1726363070015-->
END%% END%%
Let $f$ be a function from $B$ into $B$ and assume $A \subseteq B$. There are two possible methods for constructing the **closure** $C$ of $A$ under $f$. The top-down approach defines $C^*$ to be the intersection of all closed supersets of $A$: $$C^* = \bigcap\, \{X \mid A \subseteq X \subseteq B \land f[\![X]\!] \subseteq X \}$$
The bottom-up approach defines $C_*$ to be $$C_* = \bigcup_{i \in \omega} h(i)$$
where $h \colon \omega \rightarrow \mathscr{P}(B)$ is recursively defined as: $$\begin{align*} h(0) & = A, \\ h(n^+) &= h(n) \cup f[\![h(n)]\!]. \end{align*}$$
Note that the [[natural-numbers#Recursion Theorem|recursion theorem]] proves $h$ is indeed a function.
%%ANKI
Basic
Let $f \colon B \rightarrow B$ and $A \subseteq B$. How is the top-down closure $C^*$ of $A$ under $f$ defined?
Back: $\bigcap\, \{ X \mid A \subseteq X \subseteq B \land f[\![X]\!] \subseteq X \}$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379328-->
END%%
%%ANKI
Basic
Let $f \colon B \rightarrow B$ and $A \subseteq B$. What is the smallest set the closure $C^*$ of $A$ under $f$ can be?
Back: $A$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379332-->
END%%
%%ANKI
Basic
Let $f \colon B \rightarrow B$ and $A \subseteq B$. What is the largest set the closure $C^*$ of $A$ under $f$ can be?
Back: $B$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379336-->
END%%
%%ANKI
Basic
Let $f \colon B \rightarrow B$ and $A \subseteq B$. How is the bottom-up closure $C_*$ of $A$ under $f$ defined assuming appropriate $h \colon \omega \rightarrow \mathscr{P}(B)$?
Back: $\bigcup \mathop{\text{ran}} h$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379339-->
END%%
%%ANKI
Basic
Let $f \colon B \rightarrow B$ and $A \subseteq B$. What is the smallest set the closure $C_*$ of $A$ under $f$ can be?
Back: $A$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379342-->
END%%
%%ANKI
Basic
Let $f \colon B \rightarrow B$ and $A \subseteq B$. What is the largest set the closure $C_*$ of $A$ under $f$ can be?
Back: $B$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379345-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. What kind of mathematical entity is $A$?
Back: A set.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379348-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. What kind of mathematical entity is $f$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379352-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. What kind of mathematical entity is $C$?
Back: A set.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379355-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. What two ways can $C$ be defined?
Back: Bottom-up or top-down.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379358-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. How is the top-down closure denoted?
Back: As $C^*$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379361-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. How is the bottom-up closure denoted?
Back: As $C_*$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379364-->
END%%
%%ANKI
Basic
Let $C$ be the closure of $A$ under $f$. What is the "signature" of $f$?
Back: $f \colon B \rightarrow B$ for some $B \supseteq A$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379367-->
END%%
%%ANKI
Basic
Let $C_*$ be the closure of $A$ under $f$ defined in terms of function $h$. What is $h$'s domain?
Back: $\omega$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379370-->
END%%
%%ANKI
Basic
Let $C_*$ be the closure of $A$ under $f$ defined in terms of function $h$. What is $h$'s codomain?
Back: Assume $f$ maps $B$ into $B$, Then $h$'s codomain is $B$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379373-->
END%%
%%ANKI
Basic
Let $C_*$ be the closure of $A$ under $f$ defined in terms of function $h$. What does $h(0)$ evaluate to?
Back: $A$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379378-->
END%%
%%ANKI
Basic
Let $C_*$ be the closure of $A$ under $f$ defined in terms of function $h$. What does $h(n^+)$ evaluate to?
Back: $h(n) \cup f[\![h(n)]\!]$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379385-->
END%%
%%ANKI
Basic
Let $C_*$ be the closure of $A$ under $f$ defined in terms of function $h$. What theorem proves $h$'s existence?
Back: The recursion theorem.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379392-->
END%%
%%ANKI
Cloze
The top-down closure $C^*$ of $A$ under $f$ is the {intersection} of all {closed supersets} of $A$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684379398-->
END%%
## Kernels ## Kernels
Let $F \colon A \rightarrow B$. Define [[relations#Equivalence Relations|equivalence relation]] $\sim$ as $$x \sim y \Leftrightarrow f(x) = f(y)$$ Let $F \colon A \rightarrow B$. Define [[relations#Equivalence Relations|equivalence relation]] $\sim$ as $$x \sim y \Leftrightarrow f(x) = f(y)$$

View File

@ -735,6 +735,13 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1716397645564--> <!--ID: 1716397645564-->
END%% END%%
%%ANKI
Cloze
Let $A$ be a set and $C = \bigcup\, \{ x \mid \_\_\_ \}$. Then $C$ {$\supseteq$} $A$ if $A$ satisfies the {entrance requirement}.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684927439-->
END%%
## Power Set Axiom ## Power Set Axiom
For any set $a$, there is a set whose members are exactly the subsets of $a$: $$\forall a, \exists B, \forall x, (x \in B \Leftrightarrow x \subseteq a)$$ For any set $a$, there is a set whose members are exactly the subsets of $a$: $$\forall a, \exists B, \forall x, (x \in B \Leftrightarrow x \subseteq a)$$
@ -988,6 +995,13 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1716309007881--> <!--ID: 1716309007881-->
END%% END%%
%%ANKI
Cloze
Let $A$ be a set and $C = \bigcap\, \{ x \mid \_\_\_ \}$. Then $C$ {$\subseteq$} $A$ if $A$ satisfies the {entrance requirement}.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1729684927446-->
END%%
%%ANKI %%ANKI
Basic Basic
What set operation is shaded green in the following venn diagram? What set operation is shaded green in the following venn diagram?

View File

@ -401,6 +401,206 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1728559336879--> <!--ID: 1728559336879-->
END%% END%%
%%ANKI
Basic
How many bytes make up the `%rdx` register?
Back: $8$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668317-->
END%%
%%ANKI
Basic
How many bytes make up the `%dx` register?
Back: $2$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668324-->
END%%
%%ANKI
Basic
How many bytes make up the `%dl` register?
Back: $1$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668328-->
END%%
%%ANKI
Basic
How many bytes make up the `%edx` register?
Back: $4$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668334-->
END%%
%%ANKI
Cloze
By convention, register {`%rdx`} is used for {the third integral argument}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668338-->
END%%
%%ANKI
Cloze
{1:Words} are to {2:`%dx`} whereas {2:double words} are to {1:`%edx`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668341-->
END%%
%%ANKI
Cloze
{1:Bytes} are to {2:`%dl`} whereas {2:quad words} are to {1:`%rdx`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668345-->
END%%
%%ANKI
Basic
How do you access the low-order 2 bytes of `%rdx`?
Back: By using `%dx`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729174-->
END%%
%%ANKI
Basic
How do you access the low-order 4 bytes of `%rdx`?
Back: By using `%edx`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668349-->
END%%
%%ANKI
Basic
How do you access the low-order byte of `%rdx`?
Back: By using `%dl`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668352-->
END%%
%%ANKI
Basic
Which register should the third integral argument of a procedure be placed in?
Back: `%rdx`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668358-->
END%%
%%ANKI
Basic
From smallest to largest, list the four "third integral argument" registers.
Back: `%dl`, `%dx`, `%edx`, and `%rdx`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729533668361-->
END%%
%%ANKI
Cloze
{1:`%dil`} is to the {2:first} integral argument whereas {2:`%dl`} is to the {1:third} integral argument.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729612004982-->
END%%
%%ANKI
Basic
How many bytes make up the `%rcx` register?
Back: $8$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729180-->
END%%
%%ANKI
Basic
How many bytes make up the `%ecx` register?
Back: $4$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729183-->
END%%
%%ANKI
Basic
How many bytes make up the `%cx` register?
Back: $2$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729186-->
END%%
%%ANKI
Basic
How many bytes make up the `%cl` register?
Back: $1$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729189-->
END%%
%%ANKI
Cloze
By convention, register {`%rcx`} is used for {the fourth integral argument}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729193-->
END%%
%%ANKI
Cloze
{1:Words} are to {2:`%cx`} whereas {2:quad words} are to {1:`%rcx`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729196-->
END%%
%%ANKI
Cloze
{1:Bytes} are to {2:`%cl`} whereas {2:double words} are to {1:`%ecx`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729200-->
END%%
%%ANKI
Basic
How do you access the low-order 2 bytes of `%rcx`?
Back: By using `%cx`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729203-->
END%%
%%ANKI
Basic
How do you access the low-order 4 bytes of `%rcx`?
Back: By using `%ecx`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729207-->
END%%
%%ANKI
Basic
How do you access the low-order byte of `%rcx`?
Back: By using `%cl`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729210-->
END%%
%%ANKI
Basic
Which register should the fourth integral argument of a procedure be placed in?
Back: `%rcx`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729214-->
END%%
%%ANKI
Basic
From smallest to largest, list the four "fourth integral argument" registers.
Back: `%cl`, `%cx`, `%ecx`, and `%rcx`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729217-->
END%%
%%ANKI
Cloze
{1:`%di`} is to the {2:first} integral argument whereas {2:`%cx`} is to the {1:fourth} integral argument.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1729641729221-->
END%%
## Bibliography ## Bibliography
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. * Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.