Infinite Cartesian products and AoC.

c-declarations
Joshua Potter 2024-07-14 08:00:05 -06:00
parent cd8d44a55e
commit 4921298a57
17 changed files with 1392 additions and 270 deletions

View File

@ -142,7 +142,8 @@
"function-injective.png",
"function-surjective.png",
"function-general.png",
"church-rosser.png"
"church-rosser.png",
"infinite-cartesian-product.png"
],
"File Hashes": {
"algorithms/index.md": "3ac071354e55242919cc574eb43de6f8",
@ -322,7 +323,7 @@
"_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f",
"_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b",
"set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53",
"set/index.md": "9444d7f3660f1b308d268d5833997737",
"set/index.md": "40bb8c75770a626486bf40b68f2c8f3b",
"set/graphs.md": "55298be7241906cb6b61673cf0a2e709",
"_journal/2024-03-19.md": "a0807691819725bf44c0262405e97cbb",
"_journal/2024-03/2024-03-18.md": "63c3c843fc6cfc2cd289ac8b7b108391",
@ -343,7 +344,7 @@
"x86-64/declarations.md": "75bc7857cf2207a40cd7f0ee056af2f2",
"x86-64/instructions.md": "06b7fbe1a7a9568b80239310eb72e87a",
"git/refs.md": "e20c2c9b14ba6c2bd235416017c5c474",
"set/trees.md": "909c612878c863abe48c5d7b545923c8",
"set/trees.md": "ea3818b3750838b2d273e01874cf300f",
"_journal/2024-03-24.md": "1974cdb9fc42c3a8bebb8ac76d4b1fd6",
"_journal/2024-03/2024-03-23.md": "ad4e92cc2bf37f174a0758a0753bf69b",
"_journal/2024-03/2024-03-22.md": "a509066c9cd2df692549e89f241d7bd9",
@ -460,7 +461,7 @@
"_journal/2024-05/2024-05-16.md": "9fdfadc3f9ea6a4418fd0e7066d6b10c",
"_journal/2024-05-18.md": "c0b58b28f84b31cea91404f43b0ee40c",
"hashing/direct-addressing.md": "f75cc22e74ae974fe4f568a2ee9f951f",
"hashing/index.md": "e90b8e0eb7b93fda713c364027da71c2",
"hashing/index.md": "b643f6823777e4974e8d2c27255d975f",
"set/classes.md": "6776b4dc415021e0ef60b323b5c2d436",
"_journal/2024-05-19.md": "fddd90fae08fab9bd83b0ef5d362c93a",
"_journal/2024-05/2024-05-18.md": "c0b58b28f84b31cea91404f43b0ee40c",
@ -483,7 +484,7 @@
"_journal/2024-05/2024-05-25.md": "3e8a0061fa58a6e5c48d12800d1ab869",
"_journal/2024-05-27.md": "b36636d10eab34380f17f288868df3ae",
"_journal/2024-05/2024-05-26.md": "abe84b5beae74baa25501c818e64fc95",
"algebra/set.md": "204dba5e6da6257c01440758c17d305c",
"algebra/set.md": "e88847f21b467e7d243ac3d5941a75a0",
"algebra/boolean.md": "ee41e624f4d3d3aca00020d9a9ae42c8",
"git/merge-conflicts.md": "761ad6137ec51d3877f7d5b3615ca5cb",
"_journal/2024-05-28.md": "0f6aeb5ec126560acdc2d8c5c6570337",
@ -515,7 +516,7 @@
"_journal/2024-06/2024-06-07.md": "c6bfc4c1e5913d23ea7828a23340e7d3",
"lambda-calculus/alpha-conversion.md": "c9b7d60602e13e8a60d8784a859d4655",
"lambda-calculus/index.md": "64efe9e4f6036d3f5b4ec0dc8cd3e7b9",
"x86-64/instructions/condition-codes.md": "56ad6eb395153609a1ec51835925e8c9",
"x86-64/instructions/condition-codes.md": "f9ecc79ce8777d7ff17846eaf11a721c",
"x86-64/instructions/logical.md": "818428b9ef84753920dc61e5c2de9199",
"x86-64/instructions/arithmetic.md": "271218d855e7291f119f96e91f582738",
"x86-64/instructions/access.md": "c19bc3392cf493fcc9becf46c818cc50",
@ -529,12 +530,12 @@
"_journal/2024-06-12.md": "8cc810c0f594093768117f57461e2e9e",
"_journal/2024-06/2024-06-11.md": "764ccba25646673fdf7bb6a5f090394d",
"hashing/open-addressing.md": "a5129362af1cbc5f831abcdab1aa737f",
"hashing/closed-addressing.md": "970c1b6c77e20c5a4d70bfec32171e61",
"hashing/closed-addressing.md": "67bfb72c5ba911ecbd1fe3fe3028a7fa",
"_journal/2024-06-13.md": "dec86b3a3e43eca306c3cf9a46b260ed",
"_journal/2024-06/2024-06-12.md": "f82dfa74d0def8c3179d3d076f94558e",
"_journal/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307",
"_journal/2024-06/2024-06-13.md": "e2722a00585d94794a089e8035e05728",
"set/functions.md": "4fd3388fb21c77e96c6cfb703f3ed153",
"set/functions.md": "cd38f47de7e4ecf3a55434865efa6877",
"_journal/2024-06-15.md": "92cb8dc5c98e10832fb70c0e3ab3cec4",
"_journal/2024-06/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307",
"lambda-calculus/beta-reduction.md": "e233c8352a8180d19f7b717946c379d1",
@ -590,9 +591,18 @@
"_journal/2024-07/2024-07-08.md": "03ed5604e680ac9742ee99ae4b1eee8b",
"_journal/2024-07-10.md": "2bb3db1f506f4ec7726cb5f2ed2daf24",
"_journal/2024-07/2024-07-09.md": "00c357e9cfac6de17825b02fdbd00c80",
"_journal/2024-07-12.md": "247909b64d6b0dd7702d6a4482165c4d",
"_journal/2024-07-12.md": "7d1802d25d3c67880e75b14273cae331",
"_journal/2024-07/2024-07-11.md": "298cc3688675ee669b5a51d545fd61b5",
"_journal/2024-07/2024-07-10.md": "a0fe22d8be519bf435a5949999eeb4de"
"_journal/2024-07/2024-07-10.md": "a0fe22d8be519bf435a5949999eeb4de",
"_journal/2024-07-13.md": "13b5101306b5542b8a1381a6477378ca",
"_journal/2024-07/2024-07-12.md": "6603ed8a3f9a9e87bf40e81b03e96356",
"hashing/static.md": "3ec6eaee73fb9b599700f5a56b300b83",
"hashing/addressing.md": "a78c0cbea13bc9deeadb2fc643c122ce",
"ontology/index.md": "c523aa6652b285a0f1c053cb77be6f85",
"ontology/permissivism.md": "5b66dd065aa66d5a2624eda032d75b94",
"ontology/properties.md": "d417db0cecf11b1ed2e17f165d879fa5",
"_journal/2024-07-14.md": "d790f7f6b13285b91cd972d927c20f96",
"_journal/2024-07/2024-07-13.md": "60e8eb09812660a2f2bf86ffafab5714"
},
"fields_dict": {
"Basic": [

View File

@ -0,0 +1,11 @@
---
title: "2024-07-14"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* Notes on infinite Cartesian products and their relation to the axiom of choice.

View File

@ -9,3 +9,5 @@ title: "2024-07-12"
- [ ] Korean (Read 1 Story)
* Notes on [[set#Index Sets|index sets]] and [[set#Function Sets|function sets]].
* Notes on a few of the [[condition-codes#SET|set]] instructions.
* Small collection of notes on [[hashing/index#Static Hashing|static hashing]].

View File

@ -0,0 +1,12 @@
---
title: "2024-07-13"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* More notes on [[hashing/index#Static Hashing|static hashing]].
* Introductory notes on [[permissivism]].

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -106,6 +106,129 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1717679397860-->
END%%
We can also form (something like) the Cartesian product of infinitely many sets, provided that the sets are suitably indexed. Let $I$ be an index set and $H$ a function whose domain includes $I$. Define $$\bigtimes_{i \in I} H(i) = \{f \mid f \text{ is a function with domain } I \text{ and } \forall i \in I, f(i) \in H(i)\}$$
%%ANKI
Basic
What kind of mathematical object is $I$ in $\bigtimes_{i \in I} H(i)$?
Back: A set.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209655-->
END%%
%%ANKI
Basic
What kind of mathematical object is $H$ in $\bigtimes_{i \in I} H(i)$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209661-->
END%%
%%ANKI
Basic
What is the domain of $H$ in $\bigtimes_{i \in I} H(i)$?
Back: Some superset of $I$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209666-->
END%%
%%ANKI
Basic
What is the range of $H$ in $\bigtimes_{i \in I} H(i)$?
Back: Some superset of $\{H(i) \mid i \in I\}$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209672-->
END%%
%%ANKI
Basic
Let $I$ be an index set and $H$ a function $I \subseteq \mathop{\text{dom}}H$. How is $\bigtimes_{i \in I} H(i)$ defined?
Back: $\bigtimes_{i \in I} H(i) = \{ f \mid f \text{ is a function with domain } I \text { and } \forall i \in I, f(i) \in H(i) \}$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209677-->
END%%
%%ANKI
Basic
What kind of mathematical object is $h \in \bigtimes_{i \in I} H(i)$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209682-->
END%%
%%ANKI
Basic
Let $f \in \bigtimes_{i \in I} H(i)$. What is the domain of $f$?
Back: $I$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209686-->
END%%
%%ANKI
Basic
Let $f \in \bigtimes_{i \in I} H(i)$. What is the codomain of $f$?
Back: $\bigcup_{i \in I} H(i)$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209690-->
END%%
%%ANKI
Basic
Given arbitrary sets $A$ and $B$, what index set $I$ and function $H$ satisfies $A \times B = \bigtimes_{i \in I} H(i)$?
Back: N/A.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209694-->
END%%
%%ANKI
Basic
*Why* can't $A \times B$ be rewritten with $\bigtimes_{i \in I} H(i)$ assuming suitable $I$ and $H$?
Back: The former is a set of ordered pairs. The latter is a set of functions.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209698-->
END%%
%%ANKI
Basic
Assume AoC and $H(j) = \varnothing$ for some $j \in I$. What does $\bigtimes_{i \in I} H(i)$ evaluate to?
Back: $\varnothing$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209702-->
END%%
%%ANKI
Basic
When does $\bigtimes_{i \in I} H(i) = \varnothing$?
Back: When there exists some $i \in I$ such that $H(i) = \varnothing$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209705-->
END%%
%%ANKI
Basic
Assume AoC and $H(j) \neq \varnothing$ for all $j \in I$. What does $\bigtimes_{i \in I} H(i)$ evaluate to?
Back: A non-empty set.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209709-->
END%%
%%ANKI
Basic
The following is likely a diagram of what?
![[infinite-cartesian-product.png]]
Back: A member of $\bigtimes_{i \in \omega} H(i)$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209713-->
END%%
%%ANKI
Basic
Suppose $H(i) \neq \varnothing$ for all $i \in I$. When is $\bigtimes_{i \in I} H(i) \neq \varnothing$?
Back: When AoC is included in our formal system.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209716-->
END%%
## Laws
The algebra of sets obey laws reminiscent (but not exactly) of the algebra of real numbers.
@ -817,7 +940,7 @@ END%%
%%ANKI
Basic
What kind of mathematic object is $I$ in expression $\bigcup_{i \in I} F(i)$?
What kind of mathematical object is $I$ in expression $\bigcup_{i \in I} F(i)$?
Back: A set.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720782492690-->
@ -825,7 +948,7 @@ END%%
%%ANKI
Basic
What kind of mathematic object is $F$ in expression $\bigcup_{i \in I} F(i)$?
What kind of mathematical object is $F$ in expression $\bigcup_{i \in I} F(i)$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720782492693-->
@ -841,7 +964,7 @@ END%%
%%ANKI
Basic
What kind of mathematic object is $F$ in expression $\bigcup_{i \in I} F_i$?
What kind of mathematical object is $F$ in expression $\bigcup_{i \in I} F_i$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720782592281-->
@ -881,7 +1004,7 @@ END%%
%%ANKI
Basic
What kind of mathematic object is $F$ in expression $\bigcap_{i \in I} F(i)$?
What kind of mathematical object is $F$ in expression $\bigcap_{i \in I} F(i)$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720782492709-->
@ -937,7 +1060,7 @@ END%%
%%ANKI
Basic
What kind of mathematic object is $F$ in expression $\bigcap_{i \in I} F_i$?
What kind of mathematical object is $F$ in expression $\bigcap_{i \in I} F_i$?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720782592288-->

View File

@ -1,13 +1,155 @@
---
title: Closed Addressing
title: Addressing
TARGET DECK: Obsidian::STEM
FILE TAGS: hashing::closed
FILE TAGS: hashing::addressing
tags:
- addressing
- hashing
---
## Overview
## Direct
Given a universe of keys $U = \{0, 1, \ldots, m - 1\}$, a **direct-address table** has $m$ **slots**. Each slot corresponds to a key in universe $U$.
%%ANKI
Basic
Given universe $U$, how many slots must a direct-address table have?
Back: $|U|$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153762-->
END%%
%%ANKI
Basic
What name is given to each position in a direct-address table?
Back: A slot.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153766-->
END%%
%%ANKI
Basic
Given a direct-address table, the element at slot $k$ has what key?
Back: $k$.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153770-->
END%%
%%ANKI
Basic
Given a direct-address table, an element with key $k$ is placed in what slot?
Back: The $k$th slot.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153775-->
END%%
%%ANKI
Basic
Write pseudocode to test membership of $x$ in direct-address table `T[0:m-1]`.
Back:
```c
bool membership(T, x) {
return T[x.key] != NIL;
}
```
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153781-->
END%%
%%ANKI
Basic
What is the worst-cast runtime complexity of direct-address table searches?
Back: $O(1)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180982-->
END%%
%%ANKI
Basic
Write pseudocode to insert $x$ into direct-address table `T[0:m-1]`.
Back:
```c
void insert(T, x) {
T[x.key] = x;
}
```
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153785-->
END%%
%%ANKI
Basic
What is the worst-case runtime complexity of direct-address table insertions?
Back: $O(1)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180983-->
END%%
%%ANKI
Basic
Write pseudocode to delete $x$ from direct-address table `T[0:m-1]`.
Back:
```c
void delete(T, x) {
T[x.key] = NIL;
}
```
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153789-->
END%%
%%ANKI
Basic
What is the worst-cast runtime complexity of direct-address table deletions?
Back: $O(1)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180984-->
END%%
%%ANKI
Basic
In what situation does direct addressing waste space?
Back: When the number of keys used is less than the size of the universe.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180986-->
END%%
%%ANKI
Basic
In what situation is direct addressing impossible?
Back: When the size of the universe is too large to hold in memory.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180987-->
END%%
%%ANKI
Basic
What distinguishes direct addressing from closed and open addressing?
Back: Direct addressing isn't concerned with conflicting keys.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718199205862-->
END%%
%%ANKI
Basic
Direct addressing sits between what other addressing types?
Back: Open and closed addressing.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718199205872-->
END%%
%%ANKI
Basic
What is the theoretical maximum load factor in direct addressing?
Back: $1$
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718759188227-->
END%%
## Closed
In **closed addressing**, a key is always stored in the bucket it's hashed to. Collisions are dealt with using separate data structures on a per-bucket basis.
%%ANKI
@ -89,7 +231,7 @@ Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (
<!--ID: 1718759188245-->
END%%
## Chaining
### Chaining
The most common form of closed addressing is **chaining**. In this scheme, each slot $j$ is a (nullable) pointer to the head of a linked list containing all the elements with hash value $j$.
@ -158,7 +300,7 @@ END%%
%%ANKI
Basic
What is the load factor of a hash table in which all $n$ keys hash to one of $m$ slots?
Back: $n / m$ (the load factor is a property of the table, not the distribution of keys)
Back: $n / m$ (the load factor is a property of the table, not the distribution of keys).
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1719174576860-->
END%%
@ -219,6 +361,89 @@ Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (
<!--ID: 1719176797760-->
END%%
## Open
In **open addressing**, keys always reside in the hash table. Collisions are dealt with by searching for other empty buckets within the hash table.
%%ANKI
Basic
What does "closed" refer to in term "closed hashing"?
Back: A key must reside in the hash table.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717434-->
END%%
%%ANKI
Basic
What does "open" refer to in term "open addressing"?
Back: A key is not necessarily stored in the slot it hashes to.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717447-->
END%%
%%ANKI
Cloze
{Open} addressing is also known as {closed} hashing.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717455-->
END%%
%%ANKI
Cloze
The following is an example of {closed} hashing.
![[open-addressing.png]]
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717464-->
END%%
%%ANKI
Cloze
The following is an example of {open} addressing.
![[open-addressing.png]]
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198755486-->
END%%
%%ANKI
Basic
What is the theoretical maximum load factor in open addressing?
Back: $1$
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718759188171-->
END%%
%%ANKI
Basic
*Why* is the theoretical maximum load factor of open addressing bounded?
Back: An open addressing hash table can only store as many entries as slots.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718759188176-->
END%%
%%ANKI
Basic
When is the load factor of an open addressing hash table $0$?
Back: When no entries are stored in the table.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718759188179-->
END%%
%%ANKI
Basic
When is the load factor of a open addressing hash table $1$?
Back: When there exist the same number of total entries as slots.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718759188182-->
END%%
%%ANKI
Basic
When is the load factor of an open addressing hash table $> 1$?
Back: N/A
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718759188186-->
END%%
## Bibliography
* “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).

View File

@ -1,151 +0,0 @@
---
title: Direct Addressing
TARGET DECK: Obsidian::STEM
FILE TAGS: hashing::direct
tags:
- hashing
---
## Overview
Given a universe of keys $U = \{0, 1, \ldots, m - 1\}$, a **direct-address table** has $m$ **slots**. Each slot corresponds to a key in universe $U$.
%%ANKI
Basic
Given universe $U$, how many slots must a direct-address table have?
Back: $|U|$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153762-->
END%%
%%ANKI
Basic
What name is given to each position in a direct-address table?
Back: A slot.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153766-->
END%%
%%ANKI
Basic
Given a direct-address table, the element at slot $k$ has what key?
Back: $k$.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153770-->
END%%
%%ANKI
Basic
Given a direct-address table, an element with key $k$ is placed in what slot?
Back: The $k$th slot.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153775-->
END%%
%%ANKI
Basic
Write pseudocode to test membership of $x$ in direct-address table `T[0:m-1]`.
Back:
```c
bool membership(T, x) {
return T[x.key] != NIL;
}
```
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153781-->
END%%
%%ANKI
Basic
What is the worst-cast runtime complexity of direct-address table searches?
Back: $O(1)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180982-->
END%%
%%ANKI
Basic
Write pseudocode to insert $x$ into direct-address table `T[0:m-1]`.
Back:
```c
void insert(T, x) {
T[x.key] = x;
}
```
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153785-->
END%%
%%ANKI
Basic
What is the worst-case runtime complexity of direct-address table insertions?
Back: $O(1)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180983-->
END%%
%%ANKI
Basic
Write pseudocode to delete $x$ from direct-address table `T[0:m-1]`.
Back:
```c
void delete(T, x) {
T[x.key] = NIL;
}
```
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716046153789-->
END%%
%%ANKI
Basic
What is the worst-cast runtime complexity of direct-address table deletions?
Back: $O(1)$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180984-->
END%%
%%ANKI
Basic
In what situation does direct addressing waste space?
Back: When the number of keys used is less than the size of the universe.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180986-->
END%%
%%ANKI
Basic
In what situation is direct addressing impossible?
Back: When the size of the universe is too large to hold in memory.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1716307180987-->
END%%
%%ANKI
Basic
What distinguishes direct addressing from closed and open addressing?
Back: Direct addressing isn't concerned with conflicting keys.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718199205862-->
END%%
%%ANKI
Basic
Direct addressing sits between what other addressing types?
Back: Open and closed addressing.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718199205872-->
END%%
%%ANKI
Basic
What is the theoretical maximum load factor in direct addressing?
Back: $1$
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718759188227-->
END%%
## Bibliography
* “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
* Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).

View File

@ -207,8 +207,8 @@ Independent uniform hashing is **universal**, meaning the chance of any two dist
%%ANKI
Basic
What is considered the ideal (though only theoretical) hash function?
Back: The independent uniform hash function.
What is considered an ideal (though theoretical) hash function?
Back: An independent uniform hash function.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718197741507-->
END%%
@ -248,7 +248,7 @@ END%%
%%ANKI
Basic
What is uniform hashing?
Back: Any given element is equally likely to hash into any slot.
Back: Hasing in which an input key is equally likely to hash into any slot.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1719174576842-->
END%%
@ -261,6 +261,307 @@ Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (
<!--ID: 1719174576848-->
END%%
%%ANKI
Basic
In practice, hash functions are designed to handle keys of what two types?
Back: A fixed-width nonnegative integer or a vector of them.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720821498614-->
END%%
%%ANKI
Basic
How does Cormen et al. define a "good" hash function?
Back: It satisfies (approximately) the assumption of independent uniform hashing.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720821498625-->
END%%
## Static Hashing
Static hashing refers to providing a single fixed hash function intended to work well on *any* data. Generally speaking, this should not be favored over random hashing.
%%ANKI
Basic
What does static hashing refer to?
Back: Providing a single hash function intended to work well on *any* data.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498619-->
END%%
%%ANKI
Cloze
{Static} hashing provides a {single hash function} intended to work well on any data.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498622-->
END%%
%%ANKI
Basic
What does it mean for static hashing to be independent?
Back: Where a key hashes to is independent of where other keys hash to.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498628-->
END%%
%%ANKI
Basic
What about independent static hashing is a bit of a misnomer?
Back: N/A.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498631-->
END%%
%%ANKI
Basic
What does it mean for static hashing to be uniform?
Back: Each key has an equal likelihood of hashing to any slot.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498634-->
END%%
%%ANKI
Basic
What about uniform static hashing is a bit of a misnomer?
Back: Where keys hash to depend on the input keys' probability distribution.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498637-->
END%%
%%ANKI
Basic
In static hashing, *why* is uniformity generally impossible?
Back: Because we use a fixed hash function for *all* data.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498640-->
END%%
%%ANKI
Basic
Assuming $m$ slots, why is static hashing function $h(k) = \lfloor km \rfloor$ not generally "good"?
Back: The probability distribution from which keys were drawn may not be uniform.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498644-->
END%%
%%ANKI
Basic
What property must an ideal static hashing function exhibit?
Back: It must derive hash values independently of any patterns that may exist in the keys.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720821498648-->
END%%
%%ANKI
Basic
What randomization is available to static hashing?
Back: The distribution of input keys.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385376-->
END%%
### Division Method
The **division method** for creating hash functions maps a key $k$ into one of $m$ slots by taking the remainder of $k$ divided by $m$. That is, $h(k) = k \bmod{m}$.
%%ANKI
Basic
The division method is used to produce what?
Back: A hash function.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385404-->
END%%
%%ANKI
Basic
What hyperparameter(s) does the division method require?
Back: The number of slots in the hash table.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385409-->
END%%
%%ANKI
Basic
Given $m$ slots, the division method produces what hash function?
Back: $h(k) = k \bmod{m}$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385414-->
END%%
%%ANKI
Basic
Let $h$ be a division method hash function. What does $h(10)$ evaluate to?
Back: $10 \bmod{m}$ where $m$ is the number of slots in the hash table.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385419-->
END%%
%%ANKI
Basic
Consider hash function $h(k) = k \bmod{m}$. What does $m$ likely represent?
Back: The number of slots in the hash table.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385424-->
END%%
%%ANKI
Basic
Let $m$ be some number of slots. What $m$'s does the division method typically work best on?
Back: A prime not too close to an exact power of $2$.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720889385429-->
END%%
%%ANKI
Basic
Consider hash function $h(k) = k \bmod{m}$. What method was likely used to produce this?
Back: The division method.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800562-->
END%%
%%ANKI
Basic
Is the division method an example of static or random hashing?
Back: Static.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720891800592-->
END%%
### Multiplication Method
The **multiplication method** for creating hash functions first multiples a key $k$ by a constant $0 < A < 1$ and extracts the fractional part of $kA$. Then it multiplies this value by $m$ and takes the floor of the result. That is, $h(k) = \lfloor m(kA \bmod{1}) \rfloor$.
%%ANKI
Basic
The multiplication method is used to produce what?
Back: A hash function.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800597-->
END%%
%%ANKI
Basic
What hyperparameter(s) does the multiplication method require?
Back: Slot count $m$ and some constant $0 < A < 1$.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800602-->
END%%
%%ANKI
Basic
Given $m$ slots and constant $A$, the multiplication method produces what hash function?
Back: $h(k) = \lfloor m (kA \bmod{1}) \rfloor$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800607-->
END%%
%%ANKI
Basic
What range does the constant $A$ found in the multiplication method take on?
Back: $0 < A < 1$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800612-->
END%%
%%ANKI
Basic
Consider hash function $h(k) = \lfloor m (kA \bmod{1}) \rfloor$. What does $m$ likely represent?
Back: The number of slots in the hash table.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800617-->
END%%
%%ANKI
Basic
Consider hash function $h(k) = \lfloor m (kA \bmod{1}) \rfloor$. What does $A$ likely represent?
Back: Some constant $0 < A < 1$.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800622-->
END%%
%%ANKI
Basic
Consider constant $A$ used in the multiplication method. *Why* shouldn't $A = 0$?
Back: Then the produced hash function is constant.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800628-->
END%%
%%ANKI
Basic
Consider constant $A$ used in the multiplication method. *Why* shouldn't $A = 1$?
Back: Then the produced hash function is constant.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800634-->
END%%
%%ANKI
Basic
Consider hash function $h(k) = \lfloor m (kA \bmod{1}) \rfloor$. What method was likely used to produce this?
Back: The multiplication method.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
Tags: hashing::static
<!--ID: 1720891800655-->
END%%
%%ANKI
Basic
Is the multiplication method an example of static or random hashing?
Back: Static.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720891800661-->
END%%
%%ANKI
Basic
For $x \in \mathbb{R}^+$, what does $x \bmod{1}$ represent?
Back: The fractional part of $x$.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720891800639-->
END%%
%%ANKI
Basic
For $x \in \mathbb{R}^+$, what expression does $x \bmod{1}$ evaluate to?
Back: $x - \lfloor x \rfloor$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720891800644-->
END%%
%%ANKI
Basic
For $x \in \mathbb{Z}^+$, what expression does $x \bmod{1}$ evaluate to?
Back: $0$
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1720891800649-->
END%%
## Bibliography
* Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).

View File

@ -1,95 +0,0 @@
---
title: Open Addressing
TARGET DECK: Obsidian::STEM
FILE TAGS: hashing::open
tags:
- hashing
---
## Overview
In **open addressing**, keys always reside in the hash table. Collisions are dealt with by searching for other empty buckets within the hash table.
%%ANKI
Basic
What does "closed" refer to in term "closed hashing"?
Back: A key must reside in the hash table.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717434-->
END%%
%%ANKI
Basic
What does "open" refer to in term "open addressing"?
Back: A key is not necessarily stored in the slot it hashes to.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717447-->
END%%
%%ANKI
Cloze
{Open} addressing is also known as {closed} hashing.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717455-->
END%%
%%ANKI
Cloze
The following is an example of {closed} hashing.
![[open-addressing.png]]
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198717464-->
END%%
%%ANKI
Cloze
The following is an example of {open} addressing.
![[open-addressing.png]]
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718198755486-->
END%%
%%ANKI
Basic
What is the theoretical maximum load factor in open addressing?
Back: $1$
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718759188171-->
END%%
%%ANKI
Basic
*Why* is the theoretical maximum load factor of open addressing bounded?
Back: An open addressing hash table can only store as many entries as slots.
Reference: “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
<!--ID: 1718759188176-->
END%%
%%ANKI
Basic
When is the load factor of an open addressing hash table $0$?
Back: When no entries are stored in the table.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718759188179-->
END%%
%%ANKI
Basic
When is the load factor of a open addressing hash table $1$?
Back: When there exist the same number of total entries as slots.
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718759188182-->
END%%
%%ANKI
Basic
When is the load factor of an open addressing hash table $> 1$?
Back: N/A
Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).
<!--ID: 1718759188186-->
END%%
## Bibliography
* “Hash Tables: Open vs Closed Addressing | Programming.Guide,” accessed June 12, 2024, [https://programming.guide/hash-tables-open-vs-closed-addressing.html](https://programming.guide/hash-tables-open-vs-closed-addressing.html).
* Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).

116
notes/ontology/index.md Normal file
View File

@ -0,0 +1,116 @@
---
title: Ontology
TARGET DECK: Obsidian::H&SS
FILE TAGS: ontology
tags:
- ontology
---
## Overview
Ontology is the philosophical study of being. Generally *things* are split into two broad categories: **abstract** and **concrete** things. These words are "terms of art" and their definition is not standardized in any way.
%%ANKI
Basic
What did Quine declare as *the* ontological question?
Back: "What is there?"
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720912238054-->
END%%
%%ANKI
Basic
Who is attributed *the* ontological question?
Back: Quine.
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720912259767-->
END%%
%%ANKI
Cloze
{Ontology} is the {philosophical study of being}.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238058-->
END%%
%%ANKI
Cloze
{Epistemology} is the {philosophical study of knowledge}.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238062-->
END%%
%%ANKI
Cloze
{Taxonomy} is the {branch of science concerned with categorization}.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238066-->
END%%
%%ANKI
Basic
What does Effingham mean when saying "concreta" and "abstracta" are terms of art?
Back: They are terms defined freely by a person to mean whatever one wants.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782942-->
END%%
%%ANKI
Cloze
In general, ontologists often categorize things as either {concreta} or {abstracta}.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782951-->
END%%
%%ANKI
Basic
Generally speaking, what does someone *probably* mean by "concrete" things?
Back: Things that exists in space and/or time.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782957-->
END%%
%%ANKI
Basic
Generally speaking, what does someone *probably* mean by "abstract" things?
Back: Things that exist in neither space nor time.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782965-->
END%%
%%ANKI
Basic
Is a material object considered concreta?
Back: Usually.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782971-->
END%%
%%ANKI
Basic
Is an immaterial object considered concreta?
Back: Possibly.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782978-->
END%%
%%ANKI
Basic
Is a material object considered abstracta?
Back: Not usually.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782984-->
END%%
%%ANKI
Basic
Is an immaterial object considered abstracta?
Back: Possibly.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720894782989-->
END%%
## Bibliography
* Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
* Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).

View File

@ -0,0 +1,106 @@
---
title: Permissivism
TARGET DECK: Obsidian::H&SS
FILE TAGS: ontology::permissivism
tags:
- ontology
- permissivism
---
## Overview
Roughly speaking, permissivism refers to the stance that everything that can be described without (at least obvious) contradiction exists. Generally speaking, permissivists tend to think the question of whether or not things exist is trivial to answer.
%%ANKI
Basic
What is permissivism?
Back: The view that everything describable (without obvious) contradiction exists.
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720912238010-->
END%%
%%ANKI
Basic
What metaontological view proposes answering customary existence questions in the affirmative?
Back: Permissivism.
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720912238016-->
END%%
%%ANKI
Basic
What triviality is usually associated with permissivists?
Back: Permissivists tend to think most existence questions admit purely trivial answers.
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720965569467-->
END%%
%%ANKI
Basic
In permissivism, what is the antecedent to consequent "$X$ exists"?
Back: "$X$ can be described without contradiction."
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720912238023-->
END%%
%%ANKI
Basic
In permissivism, what is the conseqent to antecedent "$X$ can be described without contradiction"?
Back: "$X$ exists."
Reference: Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).
<!--ID: 1720912238027-->
END%%
%%ANKI
Basic
How would a permissivist answer the question, "What is there?"
Back: "Everything describable without contradiction."
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238031-->
END%%
%%ANKI
Basic
How does a permissivist interpret English statement "There is an $X$"?
Back: As "$X$ exists".
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238035-->
END%%
%%ANKI
Basic
*Can* a permissivist commit to the existence of square circles?
Back: Yes.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238038-->
END%%
%%ANKI
Basic
*Need* a permissivist commit to the existence of square circles?
Back: No.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238042-->
END%%
%%ANKI
Basic
What general strategy is used as an argument against permissivism?
Back: Individually acceptable committments lead to contradictions when accepted jointly.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238045-->
END%%
%%ANKI
Basic
What Russell-like paradox is typically used to argue against permissivism?
Back: The paradox of non-self-instantiation.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238049-->
END%%
## Bibliography
* Francesco Orilia and Michele Paolini Paoletti, “Properties,” in _The Stanford Encyclopedia of Philosophy_, ed. Edward N. Zalta, Spring 2022 (Metaphysics Research Lab, Stanford University, 2022), [https://plato.stanford.edu/archives/spr2022/entries/properties/](https://plato.stanford.edu/archives/spr2022/entries/properties/).
* Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
* Simon Hewitt, “A Cardinal Worry for Permissive Metaontology,” _Metaphysica_ 16, no. 2 (September 18, 2015): 15965, [https://doi.org/10.1515/mp-2015-0009](https://doi.org/10.1515/mp-2015-0009).

View File

@ -0,0 +1,100 @@
---
title: Properties
TARGET DECK: Obsidian::H&SS
FILE TAGS: ontology::property
tags:
- ontology
- property
---
## Overview
A **property** is an entity that can be predicated of things or, in other words, attributed to them.
%%ANKI
Basic
What is a property?
Back: An entity that can be predicated or attributed to things.
Reference: Francesco Orilia and Michele Paolini Paoletti, “Properties,” in _The Stanford Encyclopedia of Philosophy_, ed. Edward N. Zalta, Spring 2022 (Metaphysics Research Lab, Stanford University, 2022), [https://plato.stanford.edu/archives/spr2022/entries/properties/](https://plato.stanford.edu/archives/spr2022/entries/properties/).
<!--ID: 1720912237900-->
END%%
## Instantiation
An entity is said to **instantiate** a property if said entity bears a connection to the property. For example, a human instantiates the property of *being human* and a man instantiates the properties of *being human* and *being a man*.
%%ANKI
Basic
What is instantiation?
Back: A relation held between an entity and the properties that describe the entity.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912237951-->
END%%
%%ANKI
Cloze
A man is said to {instantiate} the property of *being a man*.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912237960-->
END%%
%%ANKI
Basic
What is self-instantiation?
Back: The instantiation of a property by itself.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912237967-->
END%%
%%ANKI
Basic
What is non-self-instantiation?
Back: The non-instantiation of a property by itself.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912237974-->
END%%
%%ANKI
Basic
Suppose all properties are self-instantiating? What must be said about *being honest*?
Back: The property *being honest* is honest.
Reference: Francesco Orilia and Michele Paolini Paoletti, “Properties,” in _The Stanford Encyclopedia of Philosophy_, ed. Edward N. Zalta, Spring 2022 (Metaphysics Research Lab, Stanford University, 2022), [https://plato.stanford.edu/archives/spr2022/entries/properties/](https://plato.stanford.edu/archives/spr2022/entries/properties/).
<!--ID: 1720912237980-->
END%%
%%ANKI
Basic
Suppose properties are abstracta. What self-instantiation is thus formed?
Back: The property of abstractness is abstract.
Reference: Francesco Orilia and Michele Paolini Paoletti, “Properties,” in _The Stanford Encyclopedia of Philosophy_, ed. Edward N. Zalta, Spring 2022 (Metaphysics Research Lab, Stanford University, 2022), [https://plato.stanford.edu/archives/spr2022/entries/properties/](https://plato.stanford.edu/archives/spr2022/entries/properties/).
<!--ID: 1720912237986-->
END%%
%%ANKI
Basic
What is the paradox of non-self-instantiation?
Back: The property *non-self-instantiation* is non-self-instantiating iff it is self-instantiating.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912237992-->
END%%
%%ANKI
Basic
Let $P$ be the property *is non-self-instantiating*. What happens if $P$ is non-self-instantiating?
Back: Then $P$ must be self-instantiating.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912237998-->
END%%
%%ANKI
Basic
Let $P$ be the property *is non-self-instantiating*. What happens if $P$ is self-instantiating?
Back: Then $P$ must be non-self-instantiating.
Reference: Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).
<!--ID: 1720912238004-->
END%%
## Bibliography
* Francesco Orilia and Michele Paolini Paoletti, “Properties,” in _The Stanford Encyclopedia of Philosophy_, ed. Edward N. Zalta, Spring 2022 (Metaphysics Research Lab, Stanford University, 2022), [https://plato.stanford.edu/archives/spr2022/entries/properties/](https://plato.stanford.edu/archives/spr2022/entries/properties/).
* Nikk Effingham, _An Introduction to Ontology_ (Cambridge: Polity Press, 2013).

View File

@ -130,6 +130,54 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1719681913529-->
END%%
%%ANKI
Basic
Let $F$, $G$ be functions such that $F \subseteq G$. How does $\mathop{\text{dom}}F$ relate to $\mathop{\text{dom}}G$?
Back: $\mathop{\text{dom}}F \subseteq \mathop{\text{dom}}G$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786472245-->
END%%
%%ANKI
Basic
Let $F$, $G$ be functions such that $F \subseteq G$. How does $\mathop{\text{ran}}F$ relate to $\mathop{\text{ran}}G$?
Back: $\mathop{\text{ran}}F \subseteq \mathop{\text{ran}}G$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786472251-->
END%%
%%ANKI
Basic
Let $F$, $G$ be functions. Is $F \cap G$ a function?
Back: Yes.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786472254-->
END%%
%%ANKI
Basic
Let $F$, $G$ be functions. When is $F \cap G$ a function?
Back: Always.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786472262-->
END%%
%%ANKI
Basic
Let $F$, $G$ be functions. Is $F \cup G$ a function?
Back: Not necessarily.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786472258-->
END%%
%%ANKI
Basic
Let $F$, $G$ be functions. When is $F \cup G$ a function?
Back: Iff $f(x) = g(x)$ for every $x \in \mathop{\text{dom}}F \cap \mathop{\text{dom}}G$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786472266-->
END%%
## Injections
A function is **injective** or **one-to-one** if each element of the codomain is mapped to by at most one element of the domain.
@ -1014,6 +1062,30 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1719398756565-->
END%%
%%ANKI
Basic
If $A$ is single-valued and $B$ is single-valued, is $A \circ B$ single-valued?
Back: Yes.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720787522643-->
END%%
%%ANKI
Basic
If $A$ is single-valued and $B$ is single-rooted, is $A \circ B$ single-valued?
Back: Not necessarily.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720787522658-->
END%%
%%ANKI
Basic
If $A$ is single-rooted and $B$ is single-rooted, is $A \circ B$ single-rooted?
Back: Yes.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720787522662-->
END%%
%%ANKI
Basic
If $F$ is a relation and $G$ is a function, is $F \circ G$ a function?
@ -1038,6 +1110,38 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1719406791413-->
END%%
%%ANKI
Basic
If $F$ is an injection and $G$ is an injection, is $F \circ G$ an injection?
Back: Yes.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786864217-->
END%%
%%ANKI
Basic
If $F$ is an injection and $G$ is a surjection, is $F \circ G$ a bijection?
Back: Not necessarily.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786864223-->
END%%
%%ANKI
Basic
If $F$ is an injection and $G$ is a bijection, is $F \circ G$ a bijection?
Back: Not necessarily.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786864226-->
END%%
%%ANKI
Basic
If $F$ is a bijection and $G$ is a bijection, is $F \circ G$ a bijection?
Back: Yes.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720786864229-->
END%%
%%ANKI
Basic
Let $F$ and $G$ be functions. How is $\mathop{\text{dom}}(F \circ G)$ defined using set-builder notation?
@ -1061,6 +1165,29 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1719666552291-->
END%%
%%ANKI
Basic
Is composition commutative?
Back: No.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720789624275-->
END%%
%%ANKI
Basic
Is composition associative?
Back: Yes.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720789624288-->
END%%
%%ANKI
Cloze
For sets $A$, $B$, and $C$, {$(A \circ B)[\![C]\!]$} $=$ {$A[\![B[\![C]\!]]\!]$}.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720819771083-->
END%%
## Restrictions
Let $F$ and $A$ be arbitrary sets. The **restriction of $F$ to $A$** is the set $$F \restriction A = \{\langle u, v \rangle \mid uFv \land u \in A\}$$
@ -1168,6 +1295,52 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1719103644309-->
END%%
%%ANKI
Cloze
Let $Q$, $A$, and $B$ be sets. Then {$Q \restriction (A \cup B)$} $=$ {$(Q \restriction A) \cup (Q \restriction B)$}.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720885546348-->
END%%
%%ANKI
Cloze
Let $Q$, $A$, and $B$ be sets. Then {$Q \restriction (A \cap B)$} $=$ {$(Q \restriction A) \cap (Q \restriction B)$}.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720885546362-->
END%%
%%ANKI
Basic
Consider sets $A$ and $B$. How is $B \restriction A$ rewritten as a composition?
Back: $B \circ I_A$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720885546354-->
END%%
%%ANKI
Basic
Consider sets $A$ and $B$. How is $A \circ I_B$ rewritten as a restriction?
Back: $A \restriction B$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720885546368-->
END%%
%%ANKI
Basic
Consider sets $A$ and $B$. How is $A \cap B$ be rewritten as a function under some image?
Back: $I_A[\![B]\!]$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720885546358-->
END%%
%%ANKI
Basic
Consider sets $A$ and $B$. How is $I_B[\![A]\!]$ rewritten as a simpler set operation?
Back: $B \cap A$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720885546374-->
END%%
## Images
Let $F$ and $A$ be sets. Then the **image of $F$ under $A$** is $$F[\![A]\!] = \{v \mid \exists u \in A, uFv\}$$
@ -1453,6 +1626,14 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1720665351109-->
END%%
%%ANKI
Basic
Suppose $A \subseteq B$. How does $F[\![A]\!]$ relate to $F[\![B]\!]$?
Back: $F[\![A]\!] \subseteq F[\![B]\!]$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720819771087-->
END%%
## Bibliography
* “Bijection, Injection and Surjection,” in _Wikipedia_, May 2, 2024, [https://en.wikipedia.org/w/index.php?title=Bijection_injection_and_surjection](https://en.wikipedia.org/w/index.php?title=Bijection,_injection_and_surjection&oldid=1221800163).

View File

@ -961,6 +961,40 @@ END%%
## Axiom of Choice
This axiom assumes the existence of some choice function capable of selecting some element from a nonempty set. Note this axiom is controversial because it is non-constructive: there is no procedure we can follow to decide which element was chosen.
%%ANKI
Basic
Why is the Axiom of Choice named the way it is?
Back: It assumes the existence of some choice function.
Reference: “Axiom of Choice,” in _Wikipedia_, July 8, 2024, [https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262](https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262).
<!--ID: 1720964209614-->
END%%
%%ANKI
Basic
In Russell's analogy, why is AoC unnecessary to pick left shoes from an infinite set of shoe pairs?
Back: The choice function can be defined directly, i.e. as "pick left shoe".
Reference: “Axiom of Choice,” in _Wikipedia_, July 8, 2024, [https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262](https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262).
<!--ID: 1720964209620-->
END%%
%%ANKI
Basic
In Russell's analogy, why is AoC necessary to pick socks from an infinite set of sock pairs?
Back: There is no choice function to choose/prefer one sock from/over the other.
Reference: “Axiom of Choice,” in _Wikipedia_, July 8, 2024, [https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262](https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262).
<!--ID: 1720964209624-->
END%%
%%ANKI
Basic
What objects does Russell's analogy use when explaining AoC?
Back: Pairs of shoes vs. pairs of (indistinguishable) socks.
Reference: “Axiom of Choice,” in _Wikipedia_, July 8, 2024, [https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262](https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262).
<!--ID: 1720964209627-->
END%%
### Relation Form
For any relation $R$ there exists a function $F \subseteq R$ with $\mathop{\text{dom}}F = \mathop{\text{dom}}R$.
@ -981,8 +1015,53 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1719681913527-->
END%%
%%ANKI
Basic
AoC (relation form) posits the existence of what mathematical object?
Back: A function.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209631-->
END%%
%%ANKI
Basic
Given relation $R$, AoC implies existence of function $F$. How does $F$ relate to $R$?
Back: $F \subseteq R$ and $\mathop{\text{dom}} F = \mathop{\text{dom}} R$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209636-->
END%%
### Infinite Cartesian Product Form
For any set $I$ and function $H$ with domain $I$, if $H(i) \neq \varnothing$ for all $i \in I$, then $\bigtimes_{i \in I} H(i) \neq \varnothing$.
%%ANKI
Basic
What does the Axiom of Choice (infinite Cartesian product form) state?
Back: For any set $I$ and function $H$ with domain $I$, if $H(i) \neq \varnothing$ for all $i \in I$, then $\bigtimes_{i \in I} H(i) \neq \varnothing$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209640-->
END%%
%%ANKI
Basic
What is the antecedent used in AoC (infinite Cartesian product form)?
Back: $H(i) \neq \varnothing$ for all $i \in I$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209644-->
END%%
%%ANKI
Basic
What is the consequent used in AoC (infinite Cartesian product form)?
Back: $\bigtimes_{i \in I} H(i) \neq \varnothing$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1720964209648-->
END%%
## Bibliography
* “Axiom of Choice,” in _Wikipedia_, July 8, 2024, [https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262](https://en.wikipedia.org/w/index.php?title=Axiom_of_choice&oldid=1233242262).
* Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
* “Russells Paradox,” in *Wikipedia*, April 18, 2024, [https://en.wikipedia.org/w/index.php?title=Russell%27s_paradox&oldid=1219576437](https://en.wikipedia.org/w/index.php?title=Russell%27s_paradox&oldid=1219576437).
* Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).

View File

@ -563,7 +563,7 @@ END%%
%%ANKI
Basic
Which nodes are descendants to $4$ in the following rooted tree?
Which nodes are descendants of $4$ in the following rooted tree?
![[rooted-tree.png]]
Back: $4$, $11$, and $2$.
Reference: Thomas H. Cormen et al., _Introduction to Algorithms_, Fourth edition (Cambridge, Massachusett: The MIT Press, 2022).

View File

@ -92,6 +92,108 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1717941416513-->
END%%
## SET
| Instruction | Synonym | Effect | Description |
| ----------- | ------- | -------- | -------------------- |
| `sete` | `setz` | D <- ZF | Equal / zero |
| `setne` | `setnz` | D <- ~ZF | Not equal / not zero |
| `sets` | | D <- SF | Negative |
| `setns` | | D <- ~SF | Nonnegative |
%%ANKI
Basic
What value does a `SET` instruction assign to a destination?
Back: $0$ or $1$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027105-->
END%%
%%ANKI
Basic
How large is the destination of a `SET` instruction?
Back: A single byte.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027114-->
END%%
%%ANKI
Basic
What is `q` in the `cmpq` instruction short for?
Back: **Q**uad word.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027119-->
END%%
%%ANKI
Basic
What is `e` in the `sete` instruction short for?
Back: **E**qual.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027124-->
END%%
%%ANKI
Basic
What is `e` in the `setz` instruction short for?
Back: **Z**ero.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027129-->
END%%
%%ANKI
Cloze
{`sete`} is a synonym for {`setz`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793064815-->
END%%
%%ANKI
Basic
What is `ne` in the `setne` instruction short for?
Back: **N**ot **e**qual.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027134-->
END%%
%%ANKI
Basic
What is `nz` in the `setnz` instruction short for?
Back: **N**ot **z**ero.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027139-->
END%%
%%ANKI
Cloze
{`setne`} is a synonym for {`setnz`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793064824-->
END%%
%%ANKI
Basic
What is `s` in the `sets` instruction short for?
Back: **S**igned.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027143-->
END%%
%%ANKI
Basic
What is `ns` in the `setns` instruction short for?
Back: **N**ot **s**igned.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027147-->
END%%
%%ANKI
Cloze
{`set[ez]`} is to {`ZF`} whereas {`sets`} is to {`SF`}.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1720793027151-->
END%%
## Bibliography
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.