From 3f54cbe3b9d62a914c5562bc235d886a2d7337b8 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Fri, 16 Aug 2024 07:56:37 -0600 Subject: [PATCH] B-trees, preorders, and partial orders. --- .../plugins/obsidian-to-anki-plugin/data.json | 47 +-- notes/_journal/2024-08-16.md | 11 + notes/_journal/{ => 2024-08}/2024-08-12.md | 0 notes/_journal/2024-08/2024-08-13.md | 9 + notes/_journal/2024-08/2024-08-14.md | 9 + notes/_journal/2024-08/2024-08-15.md | 11 + notes/data-structures/b-tree.md | 2 +- .../proof-system/natural-deduction.md | 2 +- notes/set/relations.md | 305 +++++++++++++----- notes/x86-64/instructions/condition-codes.md | 32 +- 10 files changed, 290 insertions(+), 138 deletions(-) create mode 100644 notes/_journal/2024-08-16.md rename notes/_journal/{ => 2024-08}/2024-08-12.md (100%) create mode 100644 notes/_journal/2024-08/2024-08-13.md create mode 100644 notes/_journal/2024-08/2024-08-14.md create mode 100644 notes/_journal/2024-08/2024-08-15.md diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index 7a39e0f..2a07b09 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -163,40 +163,12 @@ ] }, "Added Media": [ - "closed-addressing.png", - "open-addressing.png", - "binary-search-tree.png", - "bst-right-child.png", - "bst-right-child-after.png", - "bst-left-child.png", - "bst-left-child-after.png", - "bst-right-succ.png", - "bst-right-succ-after.png", - "bst-deep-succ.png", - "bst-deep-succ-after.png", - "free-tree.png", - "forest.png", - "cyclic-undirected.png", - "rooted-tree.png", - "ordered-rooted-tree-cmp.png", - "ordered-binary-tree-cmp.png", - "lcrs-nodes.png", - "binary-tree-nodes.png", - "perfect-tree.png", - "complete-tree.png", - "non-complete-tree.png", - "relation-ordering-example.png", - "infinite-cartesian-product.png", "b-tree-full-node.png", "b-tree-split-node.png", "b-tree-initial.png", "b-tree-inserted-b.png", "b-tree-inserted-q.png", - "church-rosser.png", - "normalized-form.png", - "denormalized-form.png", - "infinity.png", - "nan.png" + "relation-ordering-example.png" ], "File Hashes": { "algorithms/index.md": "3ac071354e55242919cc574eb43de6f8", @@ -562,14 +534,14 @@ "_journal/2024-06/2024-06-04.md": "52b28035b9c91c9b14cef1154c1a0fa1", "_journal/2024-06-06.md": "3f9109925dea304e7172df39922cc95a", "_journal/2024-06/2024-06-05.md": "b06a0fa567bd81e3b593f7e1838f9de1", - "set/relations.md": "baf811b946bf2326d8343f126ffc6ef5", + "set/relations.md": "fa91d0d77961f49651f7d9f5d4c392f5", "_journal/2024-06-07.md": "795be41cc3c9c0f27361696d237604a2", "_journal/2024-06/2024-06-06.md": "db3407dcc86fa759b061246ec9fbd381", "_journal/2024-06-08.md": "b20d39dab30b4e12559a831ab8d2f9b8", "_journal/2024-06/2024-06-07.md": "c6bfc4c1e5913d23ea7828a23340e7d3", "lambda-calculus/alpha-conversion.md": "6df655e60976715e5c6fbbe72b628c6d", "lambda-calculus/index.md": "76d58f85c135c7df00081f47df31168e", - "x86-64/instructions/condition-codes.md": "b9430cc0ad207f210a8d5ca6dacccbd5", + "x86-64/instructions/condition-codes.md": "9c05ed99f5c96162e25f0ec4db55c656", "x86-64/instructions/logical.md": "818428b9ef84753920dc61e5c2de9199", "x86-64/instructions/arithmetic.md": "271218d855e7291f119f96e91f582738", "x86-64/instructions/access.md": "c19bc3392cf493fcc9becf46c818cc50", @@ -686,7 +658,7 @@ "formal-system/abstract-rewriting.md": "8424314a627851c5b94be6163f64ba30", "_journal/2024-07-22.md": "d2ca7ce0bbeef76395fee33c9bf36e9d", "_journal/2024-07/2024-07-21.md": "62c2651999371dd9ab10d964dac3d0f8", - "formal-system/proof-system/natural-deduction.md": "87b7b9a78ea7f038f1b4e4fd15039fe8", + "formal-system/proof-system/natural-deduction.md": "88cf72e12f3135312c715497493d21ff", "startups/term-sheet.md": "6b6152af78addb3fe818a7fc9d375fbf", "startups/financing-rounds.md": "00a622fda2b4b442901bde2842309088", "_journal/2024-07-23.md": "35e18a1d9a8dd0a97e1d9898bc1d8f01", @@ -730,7 +702,7 @@ "_journal/2024-08/2024-08-07.md": "119c052f4109a3e098d825b771af89de", "_journal/2024-08-09.md": "2ce3e0c468f51750d8ad86a19bcc3264", "_journal/2024-08/2024-08-08.md": "b8211a4c576ff594217e2e9cae9396c0", - "data-structures/b-tree.md": "ccd4256aaef57e7c793ca72da6de5808", + "data-structures/b-tree.md": "73d87a471173962a21ad059a709c55c4", "data-structures/binary-tree.md": "67b0b5b9688faa205983993fe507079a", "_journal/2024-08-10.md": "08e7ea4a78c46645b93ec51e2372d04f", "_journal/2024-08/2024-08-09.md": "2ce3e0c468f51750d8ad86a19bcc3264", @@ -738,7 +710,14 @@ "_journal/2024-08/2024-08-10.md": "08e7ea4a78c46645b93ec51e2372d04f", "_journal/2024-08-12.md": "8a37a2d1381f9d9e29d83031bad80dd0", "_journal/2024-08/2024-08-11.md": "acc91e07b43590e90846d2c936dcb3d5", - "c17/types.md": "2bca56b2d95cc358553fb798acde6522" + "c17/types.md": "2bca56b2d95cc358553fb798acde6522", + "_journal/2024-08-14.md": "800650b9fa2f4445a174e0a547c2fa95", + "_journal/2024-08/2024-08-13.md": "8b64225b06d1164a91176b123a3513a2", + "_journal/2024-08/2024-08-12.md": "e57b03b929410f3111c894e43e1728ec", + "_journal/2024-08-15.md": "fabf6e09bfd99cd180a4c674f83ebcb9", + "_journal/2024-08/2024-08-14.md": "f7d1dede5ab6e4634ad9de3d3426c6f7", + "_journal/2024-08-16.md": "15fab7ec5b9dc08e4065a1bce88653c7", + "_journal/2024-08/2024-08-15.md": "7c3a96a25643b62b0064bf32cb17d92f" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-08-16.md b/notes/_journal/2024-08-16.md new file mode 100644 index 0000000..abf8b99 --- /dev/null +++ b/notes/_journal/2024-08-16.md @@ -0,0 +1,11 @@ +--- +title: "2024-08-16" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Notes on [[relations#Preorders|preorders]] and [[relations#Partial Orders|partial orders]]. \ No newline at end of file diff --git a/notes/_journal/2024-08-12.md b/notes/_journal/2024-08/2024-08-12.md similarity index 100% rename from notes/_journal/2024-08-12.md rename to notes/_journal/2024-08/2024-08-12.md diff --git a/notes/_journal/2024-08/2024-08-13.md b/notes/_journal/2024-08/2024-08-13.md new file mode 100644 index 0000000..e86000e --- /dev/null +++ b/notes/_journal/2024-08/2024-08-13.md @@ -0,0 +1,9 @@ +--- +title: "2024-08-13" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) \ No newline at end of file diff --git a/notes/_journal/2024-08/2024-08-14.md b/notes/_journal/2024-08/2024-08-14.md new file mode 100644 index 0000000..e3bbfec --- /dev/null +++ b/notes/_journal/2024-08/2024-08-14.md @@ -0,0 +1,9 @@ +--- +title: "2024-08-14" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) \ No newline at end of file diff --git a/notes/_journal/2024-08/2024-08-15.md b/notes/_journal/2024-08/2024-08-15.md new file mode 100644 index 0000000..48d5146 --- /dev/null +++ b/notes/_journal/2024-08/2024-08-15.md @@ -0,0 +1,11 @@ +--- +title: "2024-08-15" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Implemented B+-tree search, insertions, and deletions. \ No newline at end of file diff --git a/notes/data-structures/b-tree.md b/notes/data-structures/b-tree.md index ba683e4..c629851 100644 --- a/notes/data-structures/b-tree.md +++ b/notes/data-structures/b-tree.md @@ -36,7 +36,7 @@ END%% %%ANKI Basic -How is the order of a B-tree typically determined? +How is the order of a B-tree typically decided? Back: By choosing a value that best aligns with the size of a memory block. Reference: Donald Ervin Knuth, _Art of Computer Programming, 3: Sorting and Searching_, 2. ed., 34. (Reading, Mass: Addison-Wesley, 1995). diff --git a/notes/formal-system/proof-system/natural-deduction.md b/notes/formal-system/proof-system/natural-deduction.md index e2ad6a5..4b2c84f 100644 --- a/notes/formal-system/proof-system/natural-deduction.md +++ b/notes/formal-system/proof-system/natural-deduction.md @@ -197,7 +197,7 @@ END%% %%ANKI Basic -Which natural deduction inference rule is used in the following? $$\begin{array}{rc} 1. & P \lor Q \\ 2. & P \Rightarrow R \\ 3. & Q \Rightarrow R \\ \hline & P \end{array}$$ +Which natural deduction inference rule is used in the following? $$\begin{array}{rc} 1. & P \lor Q \\ 2. & P \Rightarrow R \\ 3. & Q \Rightarrow R \\ \hline & R \end{array}$$ Back: $\lor{\text{-}}E$ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. diff --git a/notes/set/relations.md b/notes/set/relations.md index 7832a7e..e765582 100644 --- a/notes/set/relations.md +++ b/notes/set/relations.md @@ -570,8 +570,8 @@ END%% %%ANKI Basic -Is $\{\langle x, y \rangle, \langle x, y, z \rangle\}$ a relation? -Back: Yes. +*Why* isn't $\{\langle x, y \rangle, \langle x, y, z \rangle\}$ a relation? +Back: N/A. It is. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% @@ -654,27 +654,20 @@ END%% %%ANKI Basic -Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, is $R$ reflexive on $\{a\}$? -Back: Yes. +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ reflexive on $\{a\}$? +Back: N/A. It is. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% %%ANKI Basic -Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, is $R$ reflexive on $\{a, b\}$? -Back: No. +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ reflexive on $\{a, b\}$? +Back: Because $\langle b, b \rangle \not\in R$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% -%%ANKI -Basic -Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, is $R$ reflexive on $\{a, b\}$? -Back: No. -Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). -END%% - %%ANKI Basic Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, *why* isn't $R$ reflexive on $\{a, b\}$? @@ -736,23 +729,23 @@ END%% %%ANKI Basic -Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, is $R$ irreflexive on $\{a\}$? -Back: No. +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ irreflexive on $\{a\}$? +Back: Because $\langle a, a \rangle \in R$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% %%ANKI Basic -Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, is $R$ irreflexive on $\{b\}$? -Back: Yes. +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ irreflexive on $\{b\}$? +Back: N/A. It is. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% %%ANKI Basic -Given $R = \{\langle a, a \rangle, \langle b, c \rangle\}$, *why* isn't $R$ irreflexive on $\{a, b\}$? +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ irreflexive on $\{a, b\}$? Back: Because $\langle a, a \rangle \in R$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). @@ -819,8 +812,8 @@ END%% %%ANKI Basic -Given $R = \{\langle a, b \rangle, \langle b, c \rangle\}$, is $R$ symmetric? -Back: No. +*Why* isn't $R = \{\langle a, b \rangle, \langle b, c \rangle\}$ symmetric? +Back: Because $aRb$ and $bRc$ but $\neg bRa$ and $\neg cRb$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% @@ -863,28 +856,20 @@ END%% %%ANKI Basic -Is $R = \{\langle a, a \rangle, \langle a, b \rangle, \langle b, a \rangle, \langle b, c \rangle\}$ antisymmetric? -Back: No. +*Why* isn't $R = \{\langle a, a \rangle, \langle a, b \rangle, \langle b, a \rangle, \langle b, c \rangle\}$ antisymmetric? +Back: Because $aRb$ and $bRa$. Reference: “Antisymmetric Relation,” in _Wikipedia_, January 24, 2024, [https://en.wikipedia.org/w/index.php?title=Antisymmetric_relation](https://en.wikipedia.org/w/index.php?title=Antisymmetric_relation&oldid=1198625107). END%% %%ANKI Basic -Is $R = \{\langle a, a \rangle, \langle b, b \rangle, \langle b, c \rangle\}$ antisymmetric? -Back: Yes. +*Why* isn't $R = \{\langle a, a \rangle, \langle b, b \rangle, \langle b, c \rangle\}$ antisymmetric? +Back: N/A. It is. Reference: “Antisymmetric Relation,” in _Wikipedia_, January 24, 2024, [https://en.wikipedia.org/w/index.php?title=Antisymmetric_relation](https://en.wikipedia.org/w/index.php?title=Antisymmetric_relation&oldid=1198625107). END%% -%%ANKI -Basic -*Why* isn't $R = \{\langle a, a \rangle, \langle a, b \rangle, \langle b, a \rangle, \langle b, c \rangle\}$ antisymmetric? -Back: Because $aRb$ and $bRa$. -Reference: “Antisymmetric Relation,” in _Wikipedia_, January 24, 2024, [https://en.wikipedia.org/w/index.php?title=Antisymmetric_relation](https://en.wikipedia.org/w/index.php?title=Antisymmetric_relation&oldid=1198625107). - -END%% - %%ANKI Basic Can a nonempty relation be both reflexive and antisymmetric on the same set? @@ -970,7 +955,7 @@ END%% %%ANKI Basic -What distinguishes the antecedent of antisymmetry's and asymmetric's FOL definition? +What distinguishes the antecedent of antisymmetry's and asymmetry's FOL definition? Back: The former only considers *distinct* pairs of elements. Reference: “Asymmetric Relation,” in _Wikipedia_, February 21, 2024, [https://en.wikipedia.org/w/index.php?title=Asymmetric_relation](https://en.wikipedia.org/w/index.php?title=Asymmetric_relation&oldid=1209290822). @@ -1122,20 +1107,12 @@ END%% %%ANKI Basic -Given $R = \{\langle a, b \rangle, \langle b, c \rangle\}$, is $R$ transitive? -Back: No. +*Why* isn't $R = \{\langle a, b \rangle, \langle b, c \rangle\}$ transitive? +Back: Because $\langle a, c \rangle \not\in R$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% -%%ANKI -Basic -Given $R = \{\langle a, b \rangle, \langle b, c \rangle\}$, what additional member(s) must be added to make $R$ transitive? -Back: Just $\langle a, c \rangle$. -Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). - -END%% - %%ANKI Basic Which of symmetric relations and transitive relations is more general? @@ -1166,16 +1143,16 @@ END%% %%ANKI Basic -Is $R = \{\langle a, b \rangle\}$ connected on set $\{a, b\}$? -Back: Yes. +*Why* isn't $R = \{\langle a, b \rangle\}$ connected on set $\{a, b\}$? +Back: N/A. It is. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% %%ANKI Basic -Is $R = \{\langle a, a \rangle\}$ connected on set $\{a, b\}$? -Back: No. +*Why* isn't $R = \{\langle a, a \rangle\}$ connected on set $\{a, b\}$? +Back: Because $\langle a, b \rangle \not\in R$ and $\langle b, a \rangle \not\in R$. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% @@ -1212,14 +1189,6 @@ Reference: “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en. END%% -%%ANKI -Basic -Is $R = \{\langle a, b \rangle\}$ strongly connected on set $\{a, b\}$? -Back: No. -Reference: “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en.wikipedia.org/w/index.php?title=Connected_relation](https://en.wikipedia.org/w/index.php?title=Connected_relation&oldid=1234415201). - -END%% - %%ANKI Basic *Why* isn't $R = \{\langle a, b \rangle\}$ strongly connected on set $\{a, b\}$? @@ -1281,20 +1250,12 @@ END%% %%ANKI Basic -Is $R = \{\langle 2, 3 \rangle, \langle 2, 5 \rangle, \langle 3, 5 \rangle\}$ trichotomous on $\{2, 3, 5\}$? -Back: Yes. +*Why* isn't $R = \{\langle 2, 3 \rangle, \langle 2, 5 \rangle, \langle 3, 5 \rangle\}$ trichotomous on $\{2, 3, 5\}$? +Back: N/A. It is. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% -%%ANKI -Basic -Is $R = \{\langle 2, 3 \rangle, \langle 3, 5 \rangle\}$ trichotomous on $\{2, 3, 5\}$? -Back: No. -Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). - -END%% - %%ANKI Basic *Why* isn't $R = \{\langle 2, 3 \rangle, \langle 3, 5 \rangle\}$ trichotomous on $\{2, 3, 5\}$? @@ -1303,14 +1264,6 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre END%% -%%ANKI -Basic -Is $R = \{\langle 2, 2 \rangle\}$ trichotomous on $\{2\}$? -Back: No. -Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). - -END%% - %%ANKI Basic *Why* isn't $R = \{\langle a, a \rangle\}$ trichotomous on $\{a\}$? @@ -1398,9 +1351,180 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre END%% +## Preorders + +$R$ is a **preorder on $A$** iff $R$ is a binary relation that is reflexive on set $A$ and transitive. + +%%ANKI +Basic +What is a preorder on $A$? +Back: A binary relation reflexive on $A$ and transitive. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +Which of preorders or equivalence relations are the more general concept? +Back: Preorders. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +*Why* are preorders named the way they are? +Back: The name suggests its almost a partial order. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle\}$ a preorder? +Back: N/A. The question must provide a reference set. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle\}$ a preorder on $\{a\}$? +Back: N/A. It is. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, b \rangle, \langle b, c \rangle, \langle a, c \rangle\}$ a preorder on $\{a, b, c\}$? +Back: Because $R$ isn't reflexive on $\{a, b, c\}$. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle, \langle b, b \rangle \}$ a preorder on $\{a, b\}$? +Back: N/A. It is. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +## Partial Orders + +$R$ is a **partial order on $A$** iff $R$ is a binary relation on set $A$ that is reflexive on $A$, antisymmetric, and transitive. + +In other words, a partial order is an antisymmetric preorder. + +%%ANKI +Basic +What is a partial order on $A$? +Back: A binary relation on $A$ that is reflexive on $A$, antisymmetric, and transitive. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +Which of preorders and partial orders is the more general concept? +Back: Preorders. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +Which of partial orders and equivalence relations is the more general concept? +Back: N/A. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Cloze +A preorder satisfying {antisymmetry} is a {partial order}. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + +%%ANKI +Basic +What two properties do partial orders and equivalence relations have in common? +Back: Reflexivity and transitivity. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +What property distinguishes partial orders from equivalence relations? +Back: The former is antisymmetric whereas the latter is symmetric. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +*Why* is a partial order named the way it is? +Back: Not every pair of elements needs to be comparable. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +Can a relation be both an equivalence relation and a partial order? +Back: Yes. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +Can a nonempty relation be both an equivalence relation and a partial order? +Back: Yes. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle, \langle b, b \rangle\}$ a partial order? +Back: N/A. The question must provide a reference set. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle, \langle b, b \rangle\}$ a partial order on $\{a, b\}$? +Back: N/A. It is. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ a partial order on $\{a, b\}$? +Back: N/A. It is. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle, \langle c, b \rangle\}$ a partial order on $\{a, b\}$? +Back: It isn't antisymmetric. +Reference: “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). + +END%% + ## Equivalence Relations -Given relation $R$ and set $A$, $R$ is an **equivalence relation on $A$** iff $R$ is a binary relation on $A$ that is reflexive on $A$, symmetric, and transitive. +$R$ is an **equivalence relation on $A$** iff $R$ is a binary relation on set $A$ that is reflexive on $A$, symmetric, and transitive. + +In other words, an equivalence relation is a symmetric preorder. %%ANKI Basic @@ -1418,6 +1542,13 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre END%% +%%ANKI +Cloze +A preorder satisfying {symmetry} is an {equivalence relation}. +Reference: “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). + +END%% + %%ANKI Cloze An equivalence relation on $A$ is a {$2$}-ary relation on $A$. @@ -1427,7 +1558,7 @@ END%% %%ANKI Basic -Is $R = \{\langle a, a \rangle\}$ an equivalence relation? +*Why* isn't $R = \{\langle a, a \rangle\}$ an equivalence relation? Back: N/A. The question must provide a reference set. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). @@ -1435,20 +1566,12 @@ END%% %%ANKI Basic -Is $R = \{\langle a, a \rangle\}$ an equivalence relation on $\{a\}$? -Back: Yes. +*Why* isn't $R = \{\langle a, a \rangle\}$ an equivalence relation on $\{a\}$? +Back: N/A. It is. Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). END%% -%%ANKI -Basic -Is $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ an equivalence relation on $\{a\}$? -Back: No. -Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). - -END%% - %%ANKI Basic *Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ an equivalence relation on $\{a\}$? @@ -1473,6 +1596,14 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre END%% +%%ANKI +Basic +*Why* isn't $R = \{\langle a, a \rangle, \langle b, c \rangle\}$ an equivalence relation on $\{a, b\}$? +Back: It isn't symmetric. +Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). + +END%% + ### Equivalence Classes The set $[x]_R$ is defined by $[x]_R = \{t \mid xRt\}$. If $R$ is an equivalence relation and $x \in \mathop{\text{fld}}R$, then $[x]_R$ is called the **equivalence class of $x$ (modulo $R$)**. @@ -1874,4 +2005,6 @@ END%% * “Connected Relation,” in _Wikipedia_, July 14, 2024, [https://en.wikipedia.org/w/index.php?title=Connected_relation](https://en.wikipedia.org/w/index.php?title=Connected_relation&oldid=1234415201). * “Equivalence Relation,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Equivalence_relation](https://en.wikipedia.org/w/index.php?title=Equivalence_relation&oldid=1235801091). * Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977). -* “Partition of a Set,” in _Wikipedia_, June 18, 2024, [https://en.wikipedia.org/w/index.php?title=Partition_of_a_set](https://en.wikipedia.org/w/index.php?title=Partition_of_a_set&oldid=1229656401). \ No newline at end of file +* “Partially Ordered Set,” in _Wikipedia_, June 22, 2024, [https://en.wikipedia.org/w/index.php?title=Partially_ordered_set](https://en.wikipedia.org/w/index.php?title=Partially_ordered_set&oldid=1230452839). +* “Partition of a Set,” in _Wikipedia_, June 18, 2024, [https://en.wikipedia.org/w/index.php?title=Partition_of_a_set](https://en.wikipedia.org/w/index.php?title=Partition_of_a_set&oldid=1229656401). +* “Preorder,” in _Wikipedia_, July 21, 2024, [https://en.wikipedia.org/w/index.php?title=Preorder](https://en.wikipedia.org/w/index.php?title=Preorder&oldid=1235839474). \ No newline at end of file diff --git a/notes/x86-64/instructions/condition-codes.md b/notes/x86-64/instructions/condition-codes.md index 310080c..99f67af 100644 --- a/notes/x86-64/instructions/condition-codes.md +++ b/notes/x86-64/instructions/condition-codes.md @@ -325,17 +325,17 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program END%% %%ANKI -Basic +Cloze {1:`setl`} is to {2:signed} integers whereas {2:`setb`} is to {1:unsigned} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI -Basic +Cloze {1:`setnae`} is to {2:unsigned} integers whereas {2:`setnge`} is to {1:signed} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI @@ -386,17 +386,17 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program END%% %%ANKI -Basic +Cloze {1:`setle`} is to {2:signed} integers whereas {2:`setbe`} is to {1:unsigned} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI -Basic +Cloze {1:`setna`} is to {2:unsigned} integers whereas {2:`setng`} is to {1:signed} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI @@ -431,17 +431,17 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program END%% %%ANKI -Basic +Cloze {1:`setg`} is to {2:signed} integers whereas {2:`seta`} is to {1:unsigned} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI -Basic +Cloze {1:`setnle`} is to {2:signed} integers whereas {2:`setnbe`} is to {1:unsigned} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI @@ -476,17 +476,17 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program END%% %%ANKI -Basic +Cloze {1:`setge`} is to {2:signed} integers whereas {2:`setae`} is to {1:unsigned} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI -Basic +Cloze {1:`setnb`} is to {2:unsigned} integers whereas {2:`setnl`} is to {1:signed} integers. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. - + END%% %%ANKI