Notes on bags and multigraphs.

c-declarations
Joshua Potter 2024-07-07 08:55:30 -06:00
parent dd03cbe973
commit ffe76a1a39
6 changed files with 208 additions and 5 deletions

View File

@ -322,8 +322,8 @@
"_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f",
"_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b",
"set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53",
"set/index.md": "fb066e22d2531f530e2899df975e4e35",
"set/graphs.md": "75f0ee994436ae39f7ba94a4eb73435a",
"set/index.md": "5302d73c3f54892d46413533b1eb04d0",
"set/graphs.md": "55298be7241906cb6b61673cf0a2e709",
"_journal/2024-03-19.md": "a0807691819725bf44c0262405e97cbb",
"_journal/2024-03/2024-03-18.md": "63c3c843fc6cfc2cd289ac8b7b108391",
"awk/variables.md": "e40a20545358228319f789243d8b9f77",
@ -580,7 +580,10 @@
"_journal/2024-07/2024-07-04.md": "d34b6c7ed601ca8d0792c749ae40f8a9",
"_journal/2024-07/2024-07-03.md": "55d4b1e159b41c6dd52943e5b7a50961",
"_journal/2024-07/2024-07-02.md": "489464ee47c3ba21307bfabae569ad29",
"_journal/2024-07/2024-07-01.md": "7cffc27813fe7a7338e411d054ac3bd5"
"_journal/2024-07/2024-07-01.md": "7cffc27813fe7a7338e411d054ac3bd5",
"set/bags.md": "ba7990801734f411838d7b33e7ec0542",
"_journal/2024-07-07.md": "fbd2ad529330b632d65280c7fc221122",
"_journal/2024-07/2024-07-06.md": "2b794e424985f0e7d4d899163ce5733c"
},
"fields_dict": {
"Basic": [

View File

@ -0,0 +1,11 @@
---
title: "2024-07-07"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* Notes on [[bags]] and multigraphs.

144
notes/set/bags.md Normal file
View File

@ -0,0 +1,144 @@
---
title: Bags
TARGET DECK: Obsidian::STEM
FILE TAGS: set::bag
tags:
- bag
- set
---
## Overview
Sets can contain the same element only once. This means $\{1, 1\} = \{1\}$. A **bag** (or **multiset**) can include a single element multiple times.
%%ANKI
Basic
What is a bag?
Back: A set in which we are allowed to include a single element multiple times.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266774-->
END%%
%%ANKI
Basic
What alternative term do "bags" go by?
Back: Multisets.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266800-->
END%%
%%ANKI
Cloze
The {multiplicity} of an element in a bag is the {number of instances given for that element}.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266806-->
END%%
%%ANKI
Basic
How many bags exist with members $a$ and $b$?
Back: An infinite amount.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266813-->
END%%
%%ANKI
Basic
What is the multiplicity of $a$ in bag $\{a, b\}$?
Back: $1$
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266819-->
END%%
%%ANKI
Basic
What is the multiplicity of $a$ in bag $\{a, a, a, b, b, c\}$?
Back: $3$
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266825-->
END%%
%%ANKI
Basic
What distinguishes a bag from a tuple?
Back: Order is irrelevant in the former.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266830-->
END%%
%%ANKI
Basic
What is the cardinality of $a$ in bag $\{a, a, a, b, b, c\}$?
Back: N/A. Cardinality applies to bags, not members.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266835-->
END%%
%%ANKI
Basic
What is the cardinality of bag $\{a, a, a, b, b, c\}$?
Back: $6$
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266840-->
END%%
%%ANKI
Basic
How is the cardinality of a bag calculated?
Back: By summing the multiplicities of each member.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266845-->
END%%
%%ANKI
Basic
When viewed as a function, a multiset has domain what?
Back: The set comprising each member of the multiset.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266850-->
END%%
%%ANKI
Basic
When viewed as a function, a multiset has range what?
Back: The set comprising the multiplicities of the multiset's members.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266856-->
END%%
%%ANKI
Basic
When viewed as a function, a multiset has codomain what?
Back: The positive integers.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266861-->
END%%
%%ANKI
Basic
Do all multisets correspond to sets?
Back: No.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266867-->
END%%
%%ANKI
Basic
Do all sets correspond to multisets?
Back: Yes.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266873-->
END%%
%%ANKI
Basic
Under what condition is a bag also a set?
Back: When the multiplicity of each element in the bag is $1$.
Reference: “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
<!--ID: 1720360266878-->
END%%
## Bibliography
* “Multiset,” in _Wikipedia_, April 4, 2024, [https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725](https://en.wikipedia.org/w/index.php?title=Multiset&oldid=1217165725).
* Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).

View File

@ -243,6 +243,49 @@ Reference: Thomas H. Cormen et al., Introduction to Algorithms, Fourth edition (
<!--ID: 1710793937921-->
END%%
A graph that allows multiple edges between vertices is called a **multigraph**. It is analagous to the concept of [[bags|multisets]] in set theory.
%%ANKI
Basic
What is a multigraph?
Back: A graph with multiple edges between any two vertices.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1720360545669-->
END%%
%%ANKI
Cloze
{Multigraphs} are to graph theory as {multisets} are to set theory.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1720360545673-->
END%%
%%ANKI
Basic
Does every multigraph correspond to a graph?
Back: No.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1720360545677-->
END%%
%%ANKI
Basic
Does every graph correspond to a multigraph?
Back: Yes.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1720360545680-->
END%%
%%ANKI
Basic
Under what conditions is a multigraph considered a graph?
Back: When the number of edges between any two vertices is $1$.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1720360545684-->
END%%
## Incidence
If $\langle u, v \rangle$ is an edge of a directed graph, we say $\langle u, v \rangle$ is **incident to** $v$ and **incident from** $u$. Furthermore, we say $v$ is **adjacent** to $u$. If $\{u, v\}$ was instead an edge of an undirected graph, we say $\{u, v\}$ is **incident on** $u$ and $v$. Likewise, $v$ is adjacent to $u$ and $u$ is adjacent to $v$.
%%ANKI
@ -1120,7 +1163,7 @@ END%%
Basic
If the following graphs are isomorphic, what is the domain of the isomorphism?
![[graph-isomorphic.png]]
Back: $\{a, b, c\}$.
Back: $\{a, b, c\}$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1715537560210-->
END%%
@ -1129,7 +1172,7 @@ END%%
Basic
If the following graphs are isomorphic, what is the codomain of the isomorphism?
![[graph-isomorphic.png]]
Back: $\{u, v, w\}$.
Back: $\{u, v, w\}$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1715537560214-->
END%%

View File

@ -8,6 +8,8 @@ tags:
## Overview
Set theory begins with two primitive notions of sets and membership. Other axioms are defined relative to these concepts.
%%ANKI
Basic
What are the two primitive notions of set theory?