In a directed graph we call a (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle a directed (gerichtet) (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle.
In a directed graph we call a (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle a directed (gerichtet) (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle.
Field-by-field Comparison
Field
Before
After
Text
In a directed graph we call a (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle a {{c1::directed (<i>gerichtet</i>)}} (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle.
\(O(n+m)\)
In an Adjacency Matrix: runtime is \(O(n^2)\) as looping over all edges is \(O(n)\).
In an Adjacency List: we loop \(n\) times over \(O(1 + \deg(u))\). Using the handshake lemma: \(\sum_{u \in V} (1 + \deg(u)) = n + \sum_{u \in V} \deg(u) = n + 2m\)
Field-by-field Comparison
Field
Before
After
Name
Find Closed Eulerian Path
Runtime
\(O(n+m)\)
Approach
We want to be able to find closed walks in a graph. We can then merge them together to form a single closed walk, by exploiting shared vertices.<br><br>Algo:<br><ol><li>Start at vertex \(u_0\) arbitrary</li><li>For loop over edges. If not marked, mark and recurse.</li><li>Append vertex to list after execution</li></ol> Returns a list of vertices in order of a closed walk if there is one.<br><br>Example:<br><img src="paste-a669de30c7bc4a38d788fb96b6b5551a4781ec71.jpg"><br>Output:<br><img src="paste-b453826818903aa4da2ac10897e9dc0e177229b6.jpg">
In an Adjacency Matrix: runtime is \(O(n^2)\) as looping over all edges is \(O(n)\).<br><br>In an Adjacency List: we loop \(n\) times over \(O(1 + \deg(u))\).<br>Using the handshake lemma: \(\sum_{u \in V} (1 + \deg(u)) = n + \sum_{u \in V} \deg(u) = n + 2m\)
A graph \(G\) is bipartite if {{c2:: it's possible to partition the vertices into two sets \(V_1\) and \(V_2\) that are disjoint and cover the graph. Any edge \(\{u, v\}\) has to have one endpoint in \(V_1\) and the other in \(V_2\)}}.
A graph \(G\) is bipartite if {{c2:: it's possible to partition the vertices into two sets \(V_1\) and \(V_2\) that are disjoint and cover the graph. Any edge \(\{u, v\}\) has to have one endpoint in \(V_1\) and the other in \(V_2\)}}.
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is {{c1:: <b>bipartite</b>}} if {{c2:: it's possible to partition the vertices into two sets \(V_1\) and \(V_2\) that are disjoint and cover the graph. Any edge \(\{u, v\}\) has to have one endpoint in \(V_1\) and the other in \(V_2\)}}.
Name the impossible cases in DFS pre/post ordering for edge \((u, v)\):
Overlapping but not Nested Intervals:
{{c2:: \(\text{pre}(u)<\text{pre}(v)<\text{post}(u)<\text{post}(v)\): as visit(u) would call visit(v) before the recursive call ends}}
Field-by-field Comparison
Field
Before
After
Text
Name the impossible cases in DFS pre/post ordering for edge \((u, v)\):<br><ul><li>{{c1::Overlapping but not Nested Intervals: <img src="paste-b7976dbbff12de2b44594553e0c91633f59e9c05.jpg">}}</li><li>{{c2:: \(\text{pre}(u)<\text{pre}(v)<\text{post}(u)<\text{post}(v)\): <img src="paste-a6fc070f96de8bd2b8148e3891cf956fd611a0a2.jpg"> as visit(u) would call visit(v) before the recursive call ends}}</li></ul>
push(k, S): push a new object k to the top of the stack S
pop(S): remove and return the top element of the stack S
top(S): get the top element of the stack S without deleting it
Other operations might be isEmpty or emptystack which produces and emtpy stack.
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>stack</b> has the following operations:<br><ul><li>{{c1:: <b>push(k, S)</b>}}: {{c2:: push a new object <b>k</b> to the top of the stack <b>S</b>}}</li><li>{{c3:: <b>pop(S)</b>}}: {{c4:: remove and return the top element of the stack <b>S</b>}}</li><li>{{c5:: <b>top(S)</b>}}: {{c6:: get the top element of the stack <b>S</b> without deleting it}}</li></ul>
Extra
Other operations might be <b>isEmpty</b> or <b>emptystack</b> which produces and emtpy stack.
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but not tree edge: Forward edge
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but not tree edge: Forward edge
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br>\(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but <b>not tree edge</b>: {{c1:: Forward edge}}
Prim’s algorithm starts with a single vertex and grows the MST outwards from that seed.
Initialisation:
Select and arbitrary starting vertex \(s\) and empty set \(F\)
Set \(S = {s}\) tracks the vertices in the MST
Each vertex gets a key[v] = representing the cheapest known connection cost to \(v\):
\(\infty\) if no edge connects \(s\) to \(v\)
\(w(s, v)\) if edge \((s, v)\) exists
Use a priority queue \(Q\) (Min-Heap) to store the vertices, in order of lowest key cost
Iteration:
Select and add Extract the vertex \(u\) with the minimum key from \(Q\). This is the cheapest to connected to the current MST. Add \(u\) to \(S\).
Update Neighbours For each neighbour \(v\) of \(u\) not in \(S\):
If \(w(u, v) < \text{key}[v]\) update key[v] = w(u, v) and update the priority in $Q$.
This discovers potentially cheaper connections to vertices outside the current MST. If a cheaper edge to \(v\) is found, the current value in key[v] cannot be part of the MST
Termination: When \(Q\) is empty, all vertices are in \(S\) and connected, and the edges chosen are in the MST (tracked in the set \(F\) through updates).
Field-by-field Comparison
Field
Before
After
Front
Describe the steps of <b>Prim's Algorithm</b>:
Back
<div>Prim’s algorithm starts with a single vertex and grows the MST outwards from that seed.</div>
<ol>
<li><strong>Initialisation:</strong><ul>
<li>Select and arbitrary starting vertex \(s\) and empty set \(F\)</li>
<li>Set \(S = {s}\) tracks the vertices in the MST</li>
<li>Each vertex gets a <code>key[v] =</code> representing the cheapest known connection cost to \(v\):<ul>
<li>\(\infty\) if no edge connects \(s\) to \(v\)</li>
<li>\(w(s, v)\) if edge \((s, v)\) exists</li>
</ul>
</li>
<li>Use a priority queue \(Q\) (<em>Min-Heap</em>) to store the vertices, in order of lowest <code>key</code> cost</li>
</ul>
</li>
<li><strong>Iteration:</strong><ul>
<li><em>Select and add</em> Extract the vertex \(u\) with the minimum <code>key</code> from \(Q\). This is the cheapest to connected to the current MST. Add \(u\) to \(S\).</li>
<li><em>Update Neighbours</em> For each neighbour <b>\(v\) </b>of \(u\) <em>not</em> in \(S\):<ul>
<li>If \(w(u, v) < \text{key}[v]\) update <code>key[v] = w(u, v)</code> and update the priority in $Q$.<ul>
<li>This discovers potentially cheaper connections to vertices outside the current MST. If a <em>cheaper edge</em> to \(v\) is found, the current value in <code>key[v]</code> cannot be part of the MST</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><strong>Termination:</strong> When \(Q\) is empty, all vertices are in \(S\) and connected, and the edges chosen are in the MST (tracked in the set \(F\) through updates).</li></ol>
Boruvka's Algorithm has a runtime of \(O((|V| + |E|) \log |V|)\).
During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):
Run DFS to find the connected components: \(O(|V| + |E|)\)
Find the cheapest one \(O(|E|)\)
We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
Field-by-field Comparison
Field
Before
After
Text
<b>Boruvka's Algorithm</b> has a runtime of {{c1:: \(O((|V| + |E|) \log |V|)\)}}.
Extra
During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):<br><ol><li>Run DFS to find the connected components: \(O(|V| + |E|)\)</li><li>Find the cheapest one \(O(|E|)\)</li></ol>We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
<div style="text-align: center;"><b>DFS</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| + |V|) \)}}</div><div><br></div><div><b>Approach</b>: {{c2::Explore as far as possible along each branch before backtracking. Potentially keep track of pre- / post-numbers to make edge classifications.}}</div><div><br></div><div><b>Uses</b>: {{c3::Detect cycles (if backward edge), <b>topological sorting </b>(reverse post-ordering), test if bipartite, mazes, ...}}</div>
For an array A[1..n] <b>longest</b> subsequence (non-continuous) that is ascending.<br><br>DP Table with entry \(M(l) = a\) where a ist the smallest possible ending of a LAT with length \(l\).<br><ul><li>Base Cases: \(M[*] = \infty\)</li><li>Recursion: set \(M[k]\) to \(A[i]\) where \(k\) is the index of the next smallest + 1 in \(M\).</li></ul>We can find the smaller with binary search, thus \(\log n \) search for \(n\) elements -> \(\Theta(n \log n)\).<br><img src="paste-1b9069bf0a881a3cd3900a4de699cac89f0498b8.jpg"><br>
In a doubly linked list, we store a pointer to the previous and next element for each key.
This increases memory usage as a trade-off for speed.
Field-by-field Comparison
Field
Before
After
Text
In a <b>doubly linked list</b>, we store a pointer to the {{c1:: previous and next element}} for each key.<br><br>This increases {{c2::memory usage}} as a trade-off for {{c2:: speed}}.
If \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = C \in \mathbb{R}^{+}\cup\set0\) or \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = \infty\), then:
\[\lim_{x \rightarrow \infty} \frac{f(x)}{g(x)} = \lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)}\]The ratio of the derivatives tend to the same limit.
Field-by-field Comparison
Field
Before
After
Front
What is L'Hôpital's Rule?
Back
<div>If \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = C \in \mathbb{R}^{+}\cup\set0\) or \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = \infty\), then:</div> <div>\[\lim_{x \rightarrow \infty} \frac{f(x)}{g(x)} = \lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)}\]The ratio of the <b>derivatives</b> tend to the <b>same limit.</b><br></div>
dequeue(S): remove and return the first element of the queue
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>quue</b> has the following operations:<br><ul><li>{{c1:: <b>enqueue(k, S)</b>}}: {{c2:: append at the end of the queue}}</li><li>{{c3:: <b>dequeue(S)</b>}}: {{c4:: remove and return the first element of the queue}}</li></ul>
A graph \(G\) is called a directed acyclic graph (DAG) (gerichteter azyklischer Graph) if there is no directed cycles (gerichteter Kreis).
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is called a {{c1::directed acyclic graph (DAG) (<i>gerichteter azyklischer Graph</i>)}} if there is {{c2::no directed cycles (<i>gerichteter Kreis</i>)}}.
You start in the middle and if the middle element is not the one you're searching, you recurse on the left OR right side (depending on the middle elements size).
\(O(|V| \cdot (|V| + |E|) \log |V|)\) (running dijkstra's n times, but allows negatives)
Field-by-field Comparison
Field
Before
After
Name
Johnson's Algorithm
Runtime
\(O(|V| \cdot (|V| + |E|) \log |V|)\) (running dijkstra's n times, but allows negatives)<br><img src="paste-b0103885454d02688fec99eb8383f57710d89f68.jpg">
Requirements
No negative cycles
Approach
<ol><li><b>Add a New Vertex:</b><ul><li>Add a new vertex s to the graph and connect it to all vertices with zero-weight edges. </li>
</ul></li><li><b>Run Bellman-Ford</b>:<ul><li>Use the Bellman-Ford algorithm starting from s to compute the shortest distance h[v] from s to each vertex v.</li><li>If a negative-weight cycle is detected, stop.</li></ul></li><li><b>Reweight Edges</b>: <ul><li>For each edge u → v with weight w(u, v), reweight it as: w′(u, v) = w(u, v) + h[u] − h[v]</li><li>This ensures all edge weights are non-negative.</li>
</ul> </li><li><b>Run Dijkstra’s Algorithm:</b><ul><li>For each vertex v, use Dijkstra’s algorithm to compute the shortest paths to all other vertices.</li>
</ul></li><li><b>Adjust Back</b>:<ul><li>Convert the distances back to the original weights using: d′(u, v) = d′(u, v) − h[u] + h[v]</li>
</ul></li><li><b>End:</b></li><ul><li>The resulting shortest path distances between all pairs of vertices are valid.</li></ul></ol><div>The overall higher cost allows us to run pre-computation steps like B-F for "free"</div>
A Minimum Spanning Tree is a subgraph of a connected, undirected, weighted Graph with that fullfills:
spanning, it connects all vertices
acylic, it's a tree
minimal, the sum of all edge weights in the Tree is minimal
Back
ETH::1._Semester::A&D::11._Minimum_Spanning_Trees
A Minimum Spanning Tree is a subgraph of a connected, undirected, weighted Graph with that fullfills:
spanning, it connects all vertices
acylic, it's a tree
minimal, the sum of all edge weights in the Tree is minimal
Field-by-field Comparison
Field
Before
After
Text
A <b>Minimum Spanning Tree</b> is a subgraph of a {{c1:: connected, undirected, weighted}} Graph with that fullfills:<br><ul><li>{{c3:: spanning, it connects all vertices}}</li><li>{{c3:: acylic, it's a tree}}</li><li>{{c3:: minimal, the sum of all edge weights in the Tree is minimal}}</li></ul>
What does the Master theorem state when it comes to the upper bound on the asymptotic runtime of a function?
Let \(a, C > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\) \(T(n) \leq aT(\frac{n}{2}) + Cn^b\). Then for all \(n = 2^k\) the following statements hold: 1. if \(b > \log_2a\), \(T(n) \leq O(n^b)\) 2. if \(b = \log_2a\), \(T(n) \leq O(n^{log_2a}\log n)\) 3. if \(b < \log_2a\), \(T(n) \leq O(n^{\log_2a})\)
Field-by-field Comparison
Field
Before
After
Front
What does the Master theorem state when it comes to the upper bound on the asymptotic runtime of a function?
Back
Let \(a, C > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\)<br>\(T(n) \leq aT(\frac{n}{2}) + Cn^b\). <br>Then for all \(n = 2^k\) the following statements hold:<br>1. if \(b > \log_2a\), \(T(n) \leq O(n^b)\)<br>2. if \(b = \log_2a\), \(T(n) \leq O(n^{log_2a}\log n)\)<br>3. if \(b < \log_2a\), \(T(n) \leq O(n^{\log_2a})\)<br>
The {{c1::In-degree \(\deg_{\text{in} }(v)\) (Eingangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the end-vertex.
The {{c1::In-degree \(\deg_{\text{in} }(v)\) (Eingangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the end-vertex.
Field-by-field Comparison
Field
Before
After
Text
The {{c1::In-degree \(\deg_{\text{in} }(v)\) (<i>Eingangsgrad</i>)}} of a vertex in a directed graph is the {{c2::number of edges that have \(v\) as the end-vertex}}.
insert(k, L): insert the key K at the end of the list L
get(i, L): return the memory address of the i-th key in list L
delete(k, L): remove the key k from the list L
insertAfter(k, k', L): inserts the key k' after the key k in the list L
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>List</b> defines the following operations:<br><ul><li>{{c1:: <b>insert(k, L)</b>}}: {{c2:: insert the key <b>K</b> at the end of the list <b>L</b>}}</li><li>{{c3:: <b>get(i, L)</b>}}: {{c4:: return the memory address of the i-th key in list <b>L</b> }}</li><li>{{c4:: <b>delete(k, L)</b>}}: {{c5:: remove the key <b>k</b> from the list <b>L</b>}}</li><li>{{c6::<b>insertAfter(k, k', L)</b>}}: {{c7:: inserts the key <b>k'</b> after the key <b>k</b> in the list <b>L</b>}}</li></ul>
Explain how unions works in the optimised Union-Find:
Arrays:
rep, where rep[v] gives the representative of \(v\).
members, where members[rep[v]] which contains all members of the ZHK of \(v\)
rank, where rank[rep[v]] contains the size of the ZHK of \(v\).
We always merge the smaller ZHK into the bigger to minimise updates.
We update the reps, then the membership lists and finally the size
Field-by-field Comparison
Field
Before
After
Front
Explain how unions works in the optimised <b>Union-Find:</b>
Back
Arrays:<br><ul><li><b>rep</b>, where <b>rep[v]</b> gives the representative of \(v\).</li><li><b>members</b>, where <b>members[rep[v]] </b>which contains all members of the ZHK of \(v\)<br></li><li><b>rank</b>, where <b>rank[rep[v]]</b> contains the size of the ZHK of \(v\).</li></ul><div>We always merge the smaller ZHK into the bigger to minimise updates.</div><img src="paste-5129796b3ae6c46edebbaae726a47f0c892c2435.jpg"><br>We update the reps, then the membership lists and finally the size
The ADT queue can be efficiently implemented using a singly linked list with a pointer to the end:
push: \(O(1)\) insert at the end, with pointer to the end
pop: \(O(1)\) remove the first element like in a stack
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>queue</b> can be efficiently implemented using a {{c1:: <b>singly linked list with a pointer to the end</b>}}:<br><ul><li><b>push</b>: {{c2:: \(O(1)\) insert at the end, with pointer to the end}}<br></li><li><b>pop</b>: {{c3:: \(O(1)\) remove the first element like in a stack}}</li></ul>
Approach: Add all vertices to the set of components (so every vertex has its own component). As long as the size of the components set is greater than 1, connect each component to the one with the cheapest edge.
Uses: Find MST in weighted, undirected graph
?
Field-by-field Comparison
Field
Before
After
Name
<div style="text-align: center;"><b>Boruvka</b></div><div><br></div><div><b>Runtime</b>: </div><div><br></div><div><b>Approach</b>: Add all vertices to the set of components (so every vertex has its own component). As long as the size of the components set is greater than 1, connect each component to the one with the cheapest edge.</div><div><br></div><div><b>Uses</b>: Find MST in weighted, undirected graph</div>
Approach
<ol><li>For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the <em>isolated vertices</em> of the graph as it’s <em>own connected component</em>.</li><li>Each vertex marks it’s cheapest outgoing edge as a <em>safe edge</em> (making use of the cut property). We add these to \(F\).</li></ol><ul><li>Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.<br><img src="paste-053ccf0acc6d560628bd8518b928a0d6c2687cb1.jpg"></li></ul><ol><li>Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.</li><li>\(F\) constitutes the edges of the MST.</li></ol>
Let \(W\) be a walk and let \(u\) be a vertex, what is \(\text{deg}_W(u)\)? (generally)
it is the degree of \(u\) in \(W\), which is the number of edges incident to \(u\) which are part of \(W\) but repetitions are included, therefore it is possible that \(\text{deg}(u) < \text{deg}_W(u)\)
Field-by-field Comparison
Field
Before
After
Front
Let \(W\) be a walk and let \(u\) be a vertex, what is \(\text{deg}_W(u)\)? (generally)
Back
it is the degree of \(u\) in \(W\), which is the number of edges incident to \(u\) which are part of \(W\) but <b>repetitions are included</b>, therefore it is possible that \(\text{deg}(u) < \text{deg}_W(u)\)
The {{c1::Out-degree \(\deg_{\text{out} }(v)\) (Ausgangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the start-vertex.
The {{c1::Out-degree \(\deg_{\text{out} }(v)\) (Ausgangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the start-vertex.
Field-by-field Comparison
Field
Before
After
Text
The {{c1::Out-degree \(\deg_{\text{out} }(v)\) (<i>Ausgangsgrad</i>)}} of a vertex in a directed graph is the {{c2::number of edges that have \(v\) as the start-vertex}}.
What is a sufficient condition to show that \(f = \Theta(g)\)?
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: \mathbb{N} \rightarrow \mathbb{R}^+\) and \(g: \mathbb{N} \rightarrow \mathbb{R}^+\) then \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = C \in \mathbb{R}^+\) then \(f = \Theta(g)\)
Field-by-field Comparison
Field
Before
After
Front
What is a sufficient condition to show that \(f = \Theta(g)\)?
Back
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: \mathbb{N} \rightarrow \mathbb{R}^+\) and \(g: \mathbb{N} \rightarrow \mathbb{R}^+\)<br>then \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = C \in \mathbb{R}^+\) then \(f = \Theta(g)\)
DFS Runtime: In a sparse graph adjacency list better, in a dense graph adjacency matrix is better.
\(|E| \geq |V|^2 / 10\), then DFS has the same runtime in the worst-case using adjacency matrices or lists as \(|V| + |E| \leq |V| + |V|^2 \)which is \(O(n^2)\).
Field-by-field Comparison
Field
Before
After
Text
DFS Runtime: In a sparse graph {{c1:: adjacency list better}}, in a dense graph {{c1:: adjacency matrix is better}}.
Extra
\(|E| \geq |V|^2 / 10\), then DFS has the same runtime in the worst-case using adjacency matrices or lists as \(|V| + |E| \leq |V| + |V|^2 \)which is \(O(n^2)\).
In graph theory, a Hamiltonian path (Hamiltonpfad) is a path (Pfad) that contains every vertex (every vertex exactly once as it's a path).
Field-by-field Comparison
Field
Before
After
Text
In graph theory, a {{c2::Hamiltonian path (<i>Hamiltonpfad</i>)}} is a {{c1::path (<i>Pfad</i>) that contains every vertex (every vertex exactly once as it's a path)}}.
Search for the correct node under which the key is inserted: \(O(\log_2 n)\)
Insert the new key value as a separator
Rebalance (if necessary, i.e. more than 3 keys)
split node into two nodes (each gets 2 children and 1 seps)
the middle sep is pushed to the parent level (and propagate)
The rebalancing being recursively pushed to the parent limits the operations at the height \(h\) thus we get \(O(\log n)\).
Field-by-field Comparison
Field
Before
After
Text
<b>2-3 Tree</b>: Inserting Steps:<br><ol><li>{{c1::Search for the correct node under which the key is inserted: \(O(\log_2 n)\)}}</li><li>{{c2::Insert the new key value as a <b>separator</b>}}</li><li>{{c3::<b>Rebalance</b> (if necessary, i.e. more than 3 keys)<br></li></ol><ul><li>split node into two nodes (each gets 2 children and 1 seps)</li><li>the middle sep is pushed to the parent level (and propagate)}}</li></ul>
Extra
The rebalancing being recursively pushed to the parent limits the operations at the height \(h\) thus we get \(O(\log n)\).
Insert in \(O(1)\) as we know the first empty cell in the array and can just write the key there
Get in \(O(1)\) as we know the offset for each key
InsertAfter in \(\Theta(l)\), since we have to shift the entire contents of the array behind the newly inserted element by 1.
Delete in \(\Theta(l)\) as in the worst case (Delete first element) we need to shift all to the left by 1.
Field-by-field Comparison
Field
Before
After
Text
In an array we can:<br><ul><li><b>Insert</b> in {{c1:: \(O(1)\) as we know the first empty cell in the array and can just write the key there}}</li><li><b>Get</b> in {{c2::\(O(1)\) as we know the offset for each key}}</li><li><b>InsertAfter</b> in {{c3::\(\Theta(l)\), since we have to shift the entire contents of the array behind the newly inserted element by 1.}}<br></li><li><b>Delete</b> in {{c4::\(\Theta(l)\) as in the worst case (Delete first element) we need to shift all to the left by 1.}}<br></li></ul>
Take a limited number of terms, which is then automatically lower than the sum. \[ \frac{n^4}{2^4} = \frac{n}{2} \cdot (\frac{n}{2})^3 = \sum_{i = \frac{n}{2}}^n (\frac{n}{2})^3 \leq \sum_{i = 1}^n i^3 = 1^3 + \ ... \ + (\frac{n}{2})^3 + \ ... \ + n^3 \] Here we take only the n/2 term.
Field-by-field Comparison
Field
Before
After
Front
How do we derive a <b>lower</b> limit for a sum?
Back
Take a <b>limited number of terms</b>, which is then automatically <b>lower</b> than the sum.<br>\[ \frac{n^4}{2^4} = \frac{n}{2} \cdot (\frac{n}{2})^3 = \sum_{i = \frac{n}{2}}^n (\frac{n}{2})^3 \leq \sum_{i = 1}^n i^3 = 1^3 + \ ... \ + (\frac{n}{2})^3 + \ ... \ + n^3 \]<br>Here we take only the n/2 term.
Sei \(G\) ein ungerichteter, gewichteter und zusammenhängender Graph. Nehmen Sie an, dass es eine eindeutige Kante mit Gewicht \(1\) gibt und, dass das Gewicht aller anderen Kanten strikt größer als \(1\) ist.
Dann enthält jeder minimale Spannbaum von die Kante \(e\).
Back
ETH::1._Semester::A&D::11._Minimum_Spanning_Trees
Sei \(G\) ein ungerichteter, gewichteter und zusammenhängender Graph. Nehmen Sie an, dass es eine eindeutige Kante mit Gewicht \(1\) gibt und, dass das Gewicht aller anderen Kanten strikt größer als \(1\) ist.
Dann enthält jeder minimale Spannbaum von die Kante \(e\).
True
Wir wählen immer die Kante \(e\), weil sie die günstigste Art die ZHK's zu verbinden ist.
Siehe Cut Property.
Field-by-field Comparison
Field
Before
After
Front
Sei \(G\) ein ungerichteter, gewichteter und zusammenhängender Graph. <br>Nehmen Sie an, dass es eine eindeutige Kante mit Gewicht \(1\) gibt und, dass das Gewicht aller anderen Kanten strikt größer als \(1\) ist.<div>Dann enthält jeder minimale Spannbaum von die Kante \(e\).</div>
Back
True<br><br>Wir wählen immer die Kante \(e\), weil sie die günstigste Art die ZHK's zu verbinden ist.<br><br>Siehe Cut Property.
In an undirected graph, what is special about pre/post-ordering:
back-edges = forward-edges
cross edges are not possible
Field-by-field Comparison
Field
Before
After
Text
In an undirected graph, what is special about pre/post-ordering:<br><ul><li><div>{{c2::back-edges = forward-edges}}</div></li><li><div><div>cross edges {{c1::are not possible}}</div></div></li></ul>
Prim's Algorithm Invariants: \(\forall v \not \in S, v \neq s\), \(d[v] = \) {{c1:: \(\min \{ w(u, v) \ | \ (u, v) \in E, u \in S \}\)(\(\infty\) if no such edge exists)}}.
Prim's Algorithm Invariants: \(\forall v \not \in S, v \neq s\), \(d[v] = \) {{c1:: \(\min \{ w(u, v) \ | \ (u, v) \in E, u \in S \}\)(\(\infty\) if no such edge exists)}}.
The 3rd invariant \[d[v] = \begin{cases} 0, & \text{if } v = s \text{ (the starting vertex)} \\ \min_{(u,v) \in E : u \in S} {w(u,v)}, & \text{if } v \in V \setminus S \text{ and } \exists (u,v) \in E \text{ with } u \in S \\ \infty, & \text{if } v \in V \setminus S \text{ and } \nexists (u,v) \in E \text{ with } u \in S \end{cases}\]ensures that d[v] always reflects the minimum cost to reach vertex v from the current MST.
We always want to add the vertex with the cheapest edge connecting it to the MST, thus this invariant has to hold in order for the algorithm to be correct.
Field-by-field Comparison
Field
Before
After
Text
Prim's Algorithm Invariants:<br>\(\forall v \not \in S, v \neq s\), \(d[v] = \) {{c1:: \(\min \{ w(u, v) \ | \ (u, v) \in E, u \in S \}\)(\(\infty\) if no such edge exists)}}.
Extra
<div>The 3rd invariant \[d[v] = \begin{cases} 0, & \text{if } v = s \text{ (the starting vertex)} \\ \min_{(u,v) \in E : u \in S} {w(u,v)}, & \text{if } v \in V \setminus S \text{ and } \exists (u,v) \in E \text{ with } u \in S \\ \infty, & \text{if } v \in V \setminus S \text{ and } \nexists (u,v) \in E \text{ with } u \in S \end{cases}\]ensures that d[v] always reflects the minimum cost to reach vertex v from the current MST.</div><div><br></div> <div>We always want to add the vertex with the cheapest edge connecting it to the MST, thus this invariant has to hold in order for the algorithm to be correct.</div>
How can we quickly check if an Eulerian walk exists?
we can check the degrees of the vertices, an Eulerian walk exists only if at most 2 vertices have an odd degree
this is because if a vertex has an odd degree, it must either be the start point or the endpoint as otherwise we would not be able to leave from it
Field-by-field Comparison
Field
Before
After
Front
How can we quickly check if an Eulerian walk exists?
Back
we can check the degrees of the vertices, an Eulerian walk exists only if at most 2 vertices have an odd degree<br><br>this is because if a vertex has an odd degree, it must either be the start point or the endpoint as otherwise we would not be able to leave from it
Differences between Subarray vs. Subsequence vs. Subset:
subarray: continous partition of the original
subsequence: non-continous partition
subset any subset (order does not matter)
Back
ETH::1._Semester::A&D::06._Dynamic_Programming
Differences between Subarray vs. Subsequence vs. Subset:
subarray: continous partition of the original
subsequence: non-continous partition
subset any subset (order does not matter)
Field-by-field Comparison
Field
Before
After
Text
Differences between Subarray vs. Subsequence vs. Subset:<br><ul><li><b>subarray</b>: {{c1:: continous partition of the original}}</li><li><b>subsequence</b>: {{c2:: non-continous partition}}</li><li><b>subset</b> {{c3:: any subset (order does not matter)}}</li></ul>
In a directed graph, for the edge \(e = (u, v)\), \(u\) is the direct predecessor (Vorgänger) of \(v\) and \(v\) the direct successor (Nachfolger of \(u\).
In a directed graph, for the edge \(e = (u, v)\), \(u\) is the direct predecessor (Vorgänger) of \(v\) and \(v\) the direct successor (Nachfolger of \(u\).
Field-by-field Comparison
Field
Before
After
Text
In a directed graph, for the edge \(e = (u, v)\), \(u\) is the {{c1::direct predecessor (<i>Vorgänger</i>)}} of \(v\) and \(v\) the {{c1::direct successor (<i>Nachfolger</i>}} of \(u\).
The ADT Dictionary implements the following methods:
search(x, W) returns the position of the key x in memory
insert(x, W) Insert the key x into W, as long as it’s not saved there yet
delete(x, W) find and delete the key x from W
Field-by-field Comparison
Field
Before
After
Text
The ADT Dictionary implements the following methods:<br><ul><li>{{c1::<b>search(x, W)</b> returns the position of the key x in memory}}</li><li>{{c2::<b>insert(x, W)</b> Insert the key <b>x</b> into <b>W</b>, as long as it’s not saved there yet}}<br></li><li>{{c3::<b>delete(x, W)</b> find and delete the key <b>x</b> from <b>W</b>}}<br></li></ul>
For \(u, v \in V\) we say that \(u\) reaches \(v\) (erreicht) if there is a walk with endpoints \(u\) and \(v\) (or a path).
Reachability is an equivalence relation.
Field-by-field Comparison
Field
Before
After
Text
For \(u, v \in V\) we say that {{c1::\(u\) <b>reaches</b> \(v\) (<i>erreicht</i>)}} if {{c2::there is a walk with endpoints \(u\) and \(v\) (or a path)}}.
<div style="text-align: center;"><b>Johnson</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| \cdot |V| + |V|^2 \cdot \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::Idea: Make all edges positive and then perform Dijkstra \(n\) times. To do this, create an additional node that is linked to each node with edge weight 0 and store for each node a height \(h(x)\), where \(h(x)\) is equal to the shortest path from the new node n to the node x (might be negative). The new weights are calculated with \(w'(u,v) = w(u,v) + h(u) - h(v)\).}}</div><div><br></div><div><b>Uses</b>: {{c3::All-to-all shortest paths in directed graphs without negative cycles.}}</div>
While traversing the tree, in each layer, we colour all vertices with the same. If we then encounter a vertex with the same colour during traversal, it's not two-colourable.
Field-by-field Comparison
Field
Before
After
Front
Bipartite Test with BFS:
Back
We substitute bipartite for two-colourable. <br><br>While traversing the tree, <b>in each layer</b>, we <b>colour all vertices with the same</b>. If we then <b>encounter </b>a vertex with the<b> same colour</b> during traversal, it's <b>not two-colourable</b>.<br><br><img src="paste-c8749f8e54bcf6eb4c7cd1ac37ca03ea43e15fd6.jpg">
Base Case: Let \(n = 5\) .... So the property holds for \(n = 5\). Induction Hypothesis: We assume the property is true for some \(k \geq 5\) Induction Step: We must show that the property holds for \(k + 1\).
By the principle of mathematical induction ... is true for all \(n \geq 5\).
Field-by-field Comparison
Field
Before
After
Front
Give the outline of an induction proof:
Back
We want to prove that ... for \(n \geq 5\)<br><br><b>Base Case: </b>Let \(n = 5\) .... So the property holds for \(n = 5\).<br><b>Induction Hypothesis:</b> We assume the property is true for some \(k \geq 5\)<br><b>Induction Step:</b> We must show that the property holds for \(k + 1\).<br><br>By the principle of mathematical induction ... is true for all \(n \geq 5\).
We want to find the subset \(I \subseteq \{1, \dots, n\}\) such that \(\sum_{i \in I} A[i] = b\) (must not exist for all \(b\)).<br><br>\(T(i,s)\) is 1 if there exists a subset from 1 to i that sums to s<br><ul><li>Base Case: T(0, 0) = 1 as we can use </li><li>Recursion: \( T(i, s) = T(i - 1, s) \ \lor \ T(i - 1, s - A[i]) \)</li></ul><div>Either we use A[i] or we don't.</div>
The ADT priorityQueue has the following operations:
insert: insert with priority p
extractMax: removes and returns element with highest priority.
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>priorityQueue</b> has the following operations:<br><ul><li><b>{{c1:: insert}}</b>: {{c2::insert with priority <b>p}}</b><br></li><li><b>{{c3:: extractMax}}</b>: {{c4::removes and returns element with highest priority.}}<br></li></ul>
For insertion sort, we start at the left-side and create our sorted array there. We take the next element from the unsorted ones and insert it at the correct place in our sorted array.<br><img src="paste-5c36171852af92d3caae178195f26449be038802.jpg"><br>Insertion sort is slowly sorting in the elements from the right side into the left side sorted array.<br><br><i>This insertion is not constant time! We have to swap it with each previous element!</i>
<i>This insertion is not constant time! We have to swap it with each previous element!</i>
Invariant
Nach \(j\) Durchläufen der äusseren Schleife ist das Teilarray \(A[1, \dots, j]\) sortiert (es enthält aber nicht zwangsläufig die \(j\) kleinsten Elemente des Arrays)
Subset problem choosing the maximum staying under a weight \(W\).<br>The greedy algorithm fails as a local optimum is not global here.<br><br>Base Cases: \(dp[0][w] = 0, \quad dp[i][0] = 0\)<br>If item weight > max allowed left, don't take it. Otherwise get the max from using it or not:<br>\(dp[i][w] = \begin{cases} dp[i-1][w], & w_i > w \\ \max(dp[i-1][w], dp[i-1][w-w_i] + v_i), & \text{sonst} \end{cases}\)
A connected component of \(G\) is a equivalence class of the relation defined as follows: \(u = v\) if \(u\) reaches \(v\).
Field-by-field Comparison
Field
Before
After
Text
A {{c1::connected component}} of \(G\) is a {{c2::equivalence class of the relation defined as follows: \(u = v\) if \(u\) reaches \(v\)}}.
In an edge \(e = \{u, v\}\), we call \(u\) adjacent (Adjazent oder Benachbart) to \(v\) (and the other way around) and \(e\) incident (Inzident oder Anliegen) to \(u, v\).
In an edge \(e = \{u, v\}\), we call \(u\) adjacent (Adjazent oder Benachbart) to \(v\) (and the other way around) and \(e\) incident (Inzident oder Anliegen) to \(u, v\).
Field-by-field Comparison
Field
Before
After
Text
In an edge \(e = \{u, v\}\), we call \(u\) {{c1::adjacent (<i>Adjazent</i> oder <i>Benachbart</i>)}} to \(v\) (and the other way around) and \(e\) {{c2::incident (<i>Inzident</i> oder <i>Anliegen</i>)}} to \(u, v\).
1. Check if \(uv \in E \): \(O(1 + \min\{\text{deg}(u), \text{deg}(v) \})\) (we have to check the smaller of the two adjacency lists 2. Vertex \(u\), find all adjacent vertices: \(O(1+\text{deg}(u) )\)
Field-by-field Comparison
Field
Before
After
Front
<b>Runtime</b>: Operations in an Adjacency <b>List</b>:
Back
1. Check if \(uv \in E \): \(O(1 + \min\{\text{deg}(u), \text{deg}(v) \})\) (we have to check the smaller of the two adjacency lists<br>2. Vertex \(u\), find all adjacent vertices: \(O(1+\text{deg}(u) )\)
Best Case: \(O(n \log n)\) Worst Case: \(O(n \log n)\)
Field-by-field Comparison
Field
Before
After
Name
Merge Sort
Runtime
Best Case: \(O(n \log n)\)<br>Worst Case: \(O(n \log n)\)
Approach
Merge sort works by divide-and-conquering the array into smaller chunks. it then merges them together slowly.<br><br>The merging works by having two indices showing the current position in the left and right array that we are merging.<br>We then compare the elements at the indices and take the smaller one. We then increase the counter on that array, while the other stays the same.<br><br>As soon as one array has been merged in completely, we can just append the second one (as it's already sorted).<br><br><img src="merge-sort-example_0.png">
<div>Merge sort always sorts correctly when called for a sub-array shorter than \(r - l + 1\).</div><div>This means that merge has to correctly merge the two sub-arrays into a complete array.</div>
Worst Case Scenario
The worst-case scenario for Mergesort is an array that has alternating small and big elements, thus they will always have to be compared during the merge.
Attributes
not in place, thus the space complexity is \(K(n)\). (can be made in place)<br><b>Stable</b>
The ADTs stack and queue behave similarly to a list, but with more constrained operations that allow more efficient computation.
Back
ETH::1._Semester::A&D::05._Data_Structures
The ADTs stack and queue behave similarly to a list, but with more constrained operations that allow more efficient computation.
Field-by-field Comparison
Field
Before
After
Text
The ADTs {{c2::<b>stack</b> and <b>queue</b>}} behave similarly to a {{c1:: list}}, but with {{c3:: more constrained operations that allow more efficient computation}}.
Search for the correct node under which the key is inserted: \(O(\log_2 n)\)
Remove the leaf with the value and one separator
Rebalance (if necessary, i.e. now 1 key)
Field-by-field Comparison
Field
Before
After
Text
<b>2-3 Tree</b>: Deleting Steps:<br><ol><li>{{c1::Search for the correct node under which the key is inserted: \(O(\log_2 n)\)}}</li><li>{{c2::Remove the leaf with the value and one separator}}</li><li>{{c3::<b>Rebalance</b> (if necessary, i.e. now 1 key)}}</li></ol>
A vertex in a connected graph is a cut vertex if the subgraph obtained after removing it and all it's incident edges is disconnected.
Field-by-field Comparison
Field
Before
After
Text
A vertex in a connected graph is a {{c1::cut vertex}} if {{c2::the subgraph obtained after removing it and all it's incident edges is <b>disconnected</b>}}.
In a singly and doubly linked list, the operation:
Insert is \(\Theta(1)\) as we know the memory address of the final element in the list and just have to set the null pointer to the new keys address. Without this pointer it's \(\Theta(l)\).
Get is \(\Theta(i)\) very slow as we need to traverse the entire list up to i
insertAfter is \(O(1)\) if we get the memory address of the element to insert after.
delete is: SLL: {{c4::\(\Theta(l)\) as we need to find the previous element and change it's pointer.} DLL: \(O(1)\) we know the address of the previous element and then just edit it's pointer.
In a singly and doubly linked list, the operation:
Insert is \(\Theta(1)\) as we know the memory address of the final element in the list and just have to set the null pointer to the new keys address. Without this pointer it's \(\Theta(l)\).
Get is \(\Theta(i)\) very slow as we need to traverse the entire list up to i
insertAfter is \(O(1)\) if we get the memory address of the element to insert after.
delete is: SLL: {{c4::\(\Theta(l)\) as we need to find the previous element and change it's pointer.} DLL: \(O(1)\) we know the address of the previous element and then just edit it's pointer.
Field-by-field Comparison
Field
Before
After
Text
In a <b>singly</b> and <b>doubly linked list</b>, the operation:<br><ul><li><b>Insert</b> is {{c1::\(\Theta(1)\) as we know the memory address of the final element in the list and just have to set the null pointer to the new keys address. Without this pointer it's \(\Theta(l)\). }}<br></li><li><b>Get</b> is {{c2::\(\Theta(i)\) very slow as we need to traverse the entire list up to <b>i</b>}}<br></li><li><b>insertAfter</b> is {{c3:: \(O(1)\) if we get the memory address of the element to insert after.}}<br></li><li><b>delete</b> is:<br> SLL: {{c4::\(\Theta(l)\) as we need to find the previous element and change it's pointer.}<br> DLL: {{c5:: \(O(1)\) we know the address of the previous element and then just edit it's pointer.}}</li></ul>
Steps of giving a DP solution:<br><ol><li>{{c1::Define the DP table (dimensions, index, range; meaning of entry): ex: <b>DP[1..n+1][1..k+1]</b>}}</li><li>{{c2::Computation of Entry (Base Case, recursive formula, pay attention to bounds!)}}</li><li>{{c3::Calculation Order (what depends on what entries, what variable incremented first)}}</li><li>{{c4::Extract Solution (How to get final solution out)}}</li><li>{{c5::Running time proof}}</li></ol>
During the recursive call, if we find an adjacent vertex without a post-number, there's a back-edge (\(\implies\)the recursive call for that edge is still active...)
Field-by-field Comparison
Field
Before
After
Front
Check for cycles in DFS algo:
Back
During the recursive call, if we find an adjacent vertex <b>without a post-number</b>, there's a back-edge (\(\implies\)the recursive call for that edge is still active...)
What is a sufficient condition to show that \(f \geq \Omega(g)\)?
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: N \rightarrow \mathbb{R}^+\) and \(g: N \rightarrow \mathbb{R}^+\) then if \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = \infty\), \(f \geq \Omega(g)\) but \(f \neq \Theta(g)\)
Field-by-field Comparison
Field
Before
After
Front
What is a sufficient condition to show that \(f \geq \Omega(g)\)?
Back
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: N \rightarrow \mathbb{R}^+\) and \(g: N \rightarrow \mathbb{R}^+\)<br>then if \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = \infty\), \(f \geq \Omega(g)\) but \(f \neq \Theta(g)\)
the nodes \(u\) and \(v\) are merged to form one new node with 3 children.
The separator from the parent node is pulled down to be the new \(s_2\).
Parent may lose child -> rebalance there (can go up to the root). If root has 1 child -> root replaced by child.
Field-by-field Comparison
Field
Before
After
Front
2-3 Tree: Deleting Steps if neighbour has 2 keys:
Back
<ol><li>the nodes \(u\) and \(v\) are <b>merged</b> to form one new node with <b>3 children</b>.</li><li>The separator from the parent node is pulled down to be the new \(s_2\).</li></ol>Parent may lose child -> rebalance there (can go up to the root).<br>If root has 1 child -> root replaced by child.<br><img src="paste-fcffee6f619138677fc86eb74beebfaa266c8cfe.jpg">
Outer loop: Iterate \(|E|\) times at most: Inner loop: find and union take \(O(\log |V|)\) per call amortised, thus \(O(|V| \log |V|)\) total.
This requires the Union Find Datastructure
Field-by-field Comparison
Field
Before
After
Name
Kruskal's Algorithm
Runtime
\(O(|E| \log |E| + |V| \log |V|)\)<br><br><b>Outer loop: </b>Iterate \(|E|\) times at most:<br><b>Inner loop: </b>find and union take \(O(\log |V|)\) per call <b>amortised</b>, thus \(O(|V| \log |V|)\) total.
Requirements
Undirected, weighted, connected graph
Approach
<ol><li><b>Initialisation</b>: Start with an empty set \(F = \emptyset\) to represent the MST edges. Initially each vertex is it’s own seperate ZHK. </li><li><b>Iteration</b>: Sort all edges in the graphs by weight in increasing order. For each edge \((u, v)\) in sorted order: <br>If adding \((u, v)\) does not create a cycle (i.e. \(u\) and \(v\) in different ZHKs) <br>Add \((u, v)\) to \(F\). Merge the ZHKs of \(u\) and \(v\)</li><li>Stop: once we have \(n-1\) edges</li></ol><div>The operation of checking if there is no cycle can be done efficiently using the check of \(u\) and \(v\) being in different ZHKs. </div><div>This can be done efficiently using the <b>Union-Find datastructure</b>.</div>
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\): tree edge, as \(v\) is a descendant of \(u\)
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\): tree edge, as \(v\) is a descendant of \(u\)
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br>\(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\): {{c1:: tree edge, as \(v\) is a descendant of \(u\)}}
In an acyclic graph, topological sorting is already an algorithm that gives us the most-efficient order to calculate the cost in.
Because we can be sure that any predecessors already have the correct \(l\)-good bound distance (guaranteed by topo-sort, no backedges), we can simply relax once.
Thus we can compute the correct cheapest path in one "relaxation": \(O(|E|)\). Therefore with toposort: \(O(|V| + |E|)\)
Field-by-field Comparison
Field
Before
After
Front
Bellman-Ford optimisation in a DAG?
Back
In an acyclic graph, <b>topological sorting</b> is already an algorithm that gives us the most-efficient order to <b>calculate the cost in</b>.<br><br>Because we can be sure that any predecessors already have the correct \(l\)-good bound distance (guaranteed by topo-sort, no backedges), we can simply relax once.<br><br>Thus we can compute the correct cheapest path in one "relaxation": \(O(|E|)\).<br>Therefore with toposort: \(O(|V| + |E|)\)
Why does naively adding the lowest-edge weight not work for Johnson's?
We need the cost of the paths to stay the same relative to each other.
If we add a constant to each edge, long (length-wise) paths are penalised more. This means that the ordering of all paths by cost changes.
Field-by-field Comparison
Field
Before
After
Front
Why does naively adding the lowest-edge weight not work for Johnson's?
Back
We need the cost of the paths to stay the same relative to each other.<br><br>If we add a constant to each edge, long (length-wise) paths are penalised more. This means that the ordering of all paths by cost changes.
An edge in a connected graph is a cut edge if the subgraph obtained after removing it (keeping the vertices) is disconnected.
Field-by-field Comparison
Field
Before
After
Text
An edge in a connected graph is a {{c1::cut edge}} if {{c2::the subgraph obtained after removing it (keeping the vertices) is <b>disconnected</b>}}.
By plugging in previous terms into a recursive definition we can get a feel for it's asymptotic runtime. This is only for intuiton, not a proof
\(M(n + 1) = 3 \cdot M(n)\) turns into \(M(n + 1) = 3 \cdot (3 \cdot M(n - 1))\) and so on and so forth.
Field-by-field Comparison
Field
Before
After
Front
What is telescoping?
Back
By plugging in previous terms into a recursive definition we can get a feel for it's asymptotic runtime. <i>This is only for intuiton, not a proof</i> <br><br>\(M(n + 1) = 3 \cdot M(n)\) turns into \(M(n + 1) = 3 \cdot (3 \cdot M(n - 1))\) and so on and so forth.
Insert the node \(v\) at the next free space in the tree, i.e. first to the left, then right (to conserve the tree structure).
Then we restore the heap condition by reverse-“versickern” the element until it’s restored.
You swap it with it’s parent nodes until the condition is restored.
Field-by-field Comparison
Field
Before
After
Front
How do we create a maxHeap?
Back
<div>Insert the node \(v\) at the next free space in the tree, i.e. first to the left, then right (to conserve the tree structure).</div><div><br></div> <div>Then we restore the heap condition by reverse-“<b>versickern</b>” the element until it’s restored.</div><div>You swap it with it’s parent nodes until the condition is restored.</div>
<div style="text-align: center;"><b>Prim</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}((|E| + |V|) \cdot \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::We start at a given vertex. To this subtree we add one-by-one the cheapest edge connecting the subtree to another component until all vertices are connected. The implementation is very similar to Dijkstra.}}</div><div><br></div><div><b>Uses</b>: {{c3::Find MST in weighted, undirected graph}}<b>Runtime</b>: {{c1::</div><div>\( \mathcal{O}((|E| + |V|) \cdot \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::We start at a given vertex. To this subtree we add one-by-one the cheapest edge connecting the subtree to another component until all vertices are connected. The implementation is very similar to Dijkstra.}}</div><div><br></div><div><b>Uses</b>: {{c3::Find MST in weighted, undirected graph}}</div>
Best Case: \(O(n \log n)\)<br>Worst Case: \(O(n^2)\)
Approach
Quicksort works by taking an element as the "pivot". We then split the array in to two parts: one smaller than the pivot and the other bigger.<br>We then swap the pivot into the middle of that.<br>Repeat for each of the smaller subdivisions, until you arrive at single-array elements.
Elemente links des pivots sind kleiner und Elemente rechts des Pivots sind größer als das Pivot-Element selbst.
Worst Case Scenario
<div>Already sorted array.</div><div>We usually choose the <b>last element</b> (element r) as the pivot. Then we only split the array into one part, with size \(n-1\).</div><div>If we instead randomly choose the pivot, we avoid the worst-case pitfalls.</div><div><br></div><div>In the best case the pivot is exactly in the middle and we can perfectly recurse with \(\log(n)\).</div>
Attributes
Not In-Place (but can be implemented as such)<br>Not Stable
During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):
Run DFS to find the connected components: \(O(|V| + |E|)\)
Find the cheapest one \(O(|E|)\)
We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
Field-by-field Comparison
Field
Before
After
Name
Boruvka's Algorithm
Runtime
\(O((|V| + |E|) \cdot \log |V|)\)<br><br>During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):<br><ol><li>Run DFS to find the connected components: \(O(|V| + |E|)\)</li><li>Find the cheapest one \(O(|E|)\)</li></ol>We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
Requirements
undirected, connected, weighted Graph.
Approach
<ol><li>For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the <em>isolated vertices</em> of the graph as it’s <em>own connected component</em>.</li><li>Each vertex marks it’s cheapest outgoing edge as a <em>safe edge</em> (making use of the cut property). We add these to \(F\).</li></ol><ul><li>Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.<br><img src="paste-053ccf0acc6d560628bd8518b928a0d6c2687cb1.jpg"></li></ul><ol><li>Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.</li><li>\(F\) constitutes the edges of the MST.</li></ol>
<div style="text-align: center;"><b>Dijkstra</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}((|E| + |V|) \cdot \log|V|) \)}}</div><div><br></div><div><b>Approach</b>: {{c2::Put the starting node into the queue, take it out, and set the distance for all adjacent nodes and put them into the queue. Repeat (we always take cheapest vertex from the queue first, min heap), update distances and only put nodes into the queue if they weren't visited before.}}</div><div><br></div><div><b>Uses</b>: {{c3::Minimal-cost paths in non-negative weighted directed graphs}}</div>
<b>Union-Find</b> datastructure methods:<br><ul><li>{{c1::<b>make(u, v)</b> creates the DS for \(F = \emptyset\)}}<br></li><li>{{c2::<b>same(u,v) </b>test if \(u, v\) in the same component}}</li><li>{{c3::<b>union(u,v)</b> merge ZHKs of \(u, v\)}}<br></li></ul>
What can we learn by running DFS on a directed graph?
while running DFS we can keep a counter and each time we visit a vertex we denote the current counter value as the PRE value for that vertex and once we finish the recursive call on that vertex and return we denote the current counter as the POST value for that vertex.
This way we are able to reconstruct how the recursive calls overlap and construct the recursion call tree (also the depth-search tree/forest). Also, by reverse-sorting the nodes by their POST-value we get a topological sort.
Field-by-field Comparison
Field
Before
After
Front
What can we learn by running DFS on a directed graph?
Back
while running DFS we can keep a counter and each time we visit a vertex we denote the current counter value as the PRE value for that vertex and once we finish the recursive call on that vertex and return we denote the current counter as the POST value for that vertex.<br><br>This way we are able to reconstruct how the recursive calls overlap and construct the recursion call tree (also the depth-search tree/forest). Also, by reverse-sorting the nodes by their POST-value we get a topological sort.
We relax the edges one more time after \(n-1\) times. If the distance to an edge decreased, there's a negative cycle reachable from \(s\).
Field-by-field Comparison
Field
Before
After
Front
How does Bellman-Ford detect negative cycles?
Back
We relax the edges one more time after \(n-1\) times. If the distance to an edge decreased, there's a negative cycle reachable from \(s\).
The extract max operation works by taking the root node, the biggest element in the heap by it’s definition and restoring the heap condition.
We remove the root and replace it by the element that is most to the right (last element in the array storing the heap). Then we "versickern" this small element, until the heap condition is restored.
We swap it with the larger of the child nodes, until it's bigger than both of it's children.
This takes \(O(\log(n))\) time as the tree has maximum \(O(\log(n))\) levels.
Field-by-field Comparison
Field
Before
After
Front
How does <b>extract_max</b> work for a maxHeap?
Back
<div>The extract max operation works by taking the root node, the biggest element in the heap by it’s definition and restoring the <b>heap condition</b>.</div><div><br></div><div>We remove the root and replace it by the element that is most to the right (last element in the array storing the heap).<br>Then we "versickern" this small element, until the heap condition is restored. </div><div>We <i>swap it with the larger of the child nodes</i>, until it's bigger than both of it's children. </div><div><br></div><div>This takes \(O(\log(n))\) time as the tree has maximum \(O(\log(n))\) levels.</div><div><br></div><div><img src="paste-bbcbf147dcbf6bb7fed164a5949034f0184f9017.jpg"></div>
How can I get the lower bound on the function \(n!\) ?
I can only take for example the largest 90% of elements \(n! \geq 1 \cdot 2 \cdot ... \cdot n \geq n/10 \cdot ... \cdot n\)
\(\geq (n/10)^{0.9n}\)
Field-by-field Comparison
Field
Before
After
Front
How can I get the lower bound on the function \(n!\) ?
Back
I can only take for example the largest 90% of elements \(n! \geq 1 \cdot 2 \cdot ... \cdot n \geq n/10 \cdot ... \cdot n\)<div>\(\geq (n/10)^{0.9n}\)</div>
How do we know if a walk \(W=(v_0, ..., v_n)\) is closed using the degree of \(v_n\) in \(W\)?
it is closed if and only if \(\text{deg}_W(v_n)\) is even
every occurrence of \(v_n\) within the walk increases its degree by 2, so it does not affect parity so if the degree is even then \(v_n\) is both the first and the last node
Field-by-field Comparison
Field
Before
After
Front
How do we know if a walk \(W=(v_0, ..., v_n)\) is closed using the degree of \(v_n\) in \(W\)?
Back
it is closed if and only if \(\text{deg}_W(v_n)\) is even<br><br>every occurrence of \(v_n\) within the walk increases its degree by 2, so it does not affect parity so if the degree is even then \(v_n\) is both the first and the last node
Minimum amount of edits (insert, delete, replace) to go from s1 to s2 -> LGT gives us the ED.<br><br>Three cases for \(a_i\) last char of \(a\):<br><ul><li>deleted: \(ED(i, j) = 1 + ED(i - 1, j)\) (if deleted, it doesn't matter when)<br><img src="paste-254e45a17676954472f6aebe7c8c4f0517b3d6b5.jpg"></li><li>ends up in \(1, \dots, j-1\): no char \(a_k, k < i\) can be behind \(a_i\) (suboptimal as it would cost 2): \(E1+ ED(i, j -1)\)<br><img src="paste-fae70ea53a12531dc9ac1ac30b00512b6f0c150e.jpg"></li><li>ends up at \(b_j\): cannot insert char behind \(a_i\) thus: \(ED(i-1, j -1) \) if \(a_i = b_j\) else \(1 + ED(i-1, k-1)\) <br><img src="paste-3027dc66600e0cb2f8e3a1b12c8a1be248f13f5c.jpg"> </li></ul>
In very dense graphs\(|E| > \frac{|V|^2}{\log |V|}\), Dijkstra's is faster on an array than in a minHeap.
Extract_min takes \(O(|V|)\) with an array (\(O(\log |V|)\) in a MinHeap) -> array implementation runtime: \(O(|V|^2 + |E|) = O(|V|^2)\) for \(|E| = \Theta(|V|^2)\) (there are at most \(|V|^2\) edges in a graph).
If we plug in |E| > ... into the log runtime we see it's faster.
Field-by-field Comparison
Field
Before
After
Front
When do we want Dijkstra's with an array?
Back
In very dense graphs\(|E| > \frac{|V|^2}{\log |V|}\), Dijkstra's is <b>faster on an array than in a minHeap</b>.<br><br><div>Extract_min takes \(O(|V|)\) with an array (\(O(\log |V|)\) in a MinHeap) -> array implementation runtime: \(O(|V|^2 + |E|) = O(|V|^2)\) for \(|E| = \Theta(|V|^2)\) (there are at most \(|V|^2\) edges in a graph).</div><div><br></div><div>If we plug in |E| > ... into the log runtime we see it's faster.</div>
To join a set of disjoint connected components, we need to use an edge to join two of their vertices. The idea is that the cheapest such edge is always a safe edge.
This is true only for distinct edge weights!
Field-by-field Comparison
Field
Before
After
Front
What is the Cut-Property (Schnittprinzip)?
Back
To join a set of disjoint connected components, we need to use an edge to join two of their vertices. The idea is that the <i>cheapest</i> such edge is always a <i>safe edge.</i><div><i><br></i></div><div><b>This is true only for distinct edge weights!</b></div>
<ol><li><b>Initialise</b>: distance matrix D D[i][j] is the weight of the edge from \(i \rightarrow j\) if it exists, \(\infty\) otherwise<br></li><li><b>Iterate over intermediate</b>: for each vertex \(k\) update D[i][j] = min(D[i][j], D[i][k] + D[k][j]). for all intermediate k from 1,...,n</li></ol><div><br></div><div>The final distance matrix D contains the shortest path from any i to j.</div><div><br></div><div><i>Note that this can also be done using a 3d DP table, the 2d is just optimised.</i><br></div>
Pseudocode
<img src="paste-f6965d427f4a2df5b61ba8dd2ee9c0f0a90baaf6.jpg"><br><div><b>Important</b>: Use a value like 10000 instead of Integer.MAX_VALUE in Java, as you get <b>overflows</b> otherwise.</div>
We add a vertex \(s\) and add a 0 cost edge from it to all vertices.
We then run B-F which determines the height of each vertex by the d[v] from start vertex \(s\)
Field-by-field Comparison
Field
Before
After
Text
Reweighting in Johnson's algorithm:<br><ol><li>We {{c1::add a vertex \(s\)}} and {{c1::add a 0 cost edge from it to all vertices}}.</li><li>We then {{c2::run B-F which determines the height of each vertex by the d[v] from start vertex \(s\)}} </li></ol>
The amortised runtime of union in the Union-Find DS is \(O(|V| \log |V|)\).
union takes \(\Theta(\min \{ |ZHK(u)| , |ZHK(v)| \}\). In the worst case, the minimum is \(|V| / 2\) as both have the same size.
Therefore over all loops, this would take \(O(|V| \log |V|)\) time, as on average we only take \(O(\log |V|)\) time. The graph stays worst case, this is the average of the calls in the worst case.
Field-by-field Comparison
Field
Before
After
Text
The amortised runtime of <b>union</b> in the Union-Find DS is {{c1:: \(O(|V| \log |V|)\)}}.
Extra
union takes \(\Theta(\min \{ |ZHK(u)| , |ZHK(v)| \}\). In the worst case, the minimum is \(|V| / 2\) as both have the same size.<br><br>Therefore over all loops, this would take \(O(|V| \log |V|)\) time, as <i>on average</i> we only take \(O(\log |V|)\) time.<br><i>The graph stays worst case, this is the average of the calls in the worst case.</i>
A graph \(G\) is transitive when for {{c2:: any two edges \(\{u, v\} \text{ and } \{v, w\}\) in \(E\), the edge \(\{u, w\}\) is also in \(E\)}}.
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is {{c1:: <b>transitive</b>}} when for {{c2:: any two edges \(\{u, v\} \text{ and } \{v, w\}\) in \(E\), the edge \(\{u, w\}\) is also in \(E\)}}.
Is it possible to use the master theorem to get \(\Theta(f)\)? How?
for a recursive function if both the Master theorem for the upper bound on the runtime and the lower bound on the runtime hold, then \(T(n) = \Theta(n^b), \Theta(n^{\log_2 a}\log n), \Theta(n^{\log_2 a})\) respectively for the three cases
Field-by-field Comparison
Field
Before
After
Front
Is it possible to use the master theorem to get \(\Theta(f)\)? How?
Back
for a recursive function if both the Master theorem for the upper bound on the runtime and the lower bound on the runtime hold, then \(T(n) = \Theta(n^b), \Theta(n^{\log_2 a}\log n), \Theta(n^{\log_2 a})\) respectively for the three cases
A graph \(G\) is connected (Zusammenhängend) if for every two vertices \(u, v \in V\) \(u\) reaches \(v\).
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is {{c1::connected (<i>Zusammenhängend</i>)}} if {{c2::for every two vertices \(u, v \in V\) \(u\) reaches \(v\)}}.
Backtracking can find the solution of the problem from the DP table. From the recursion and it's behaviour we find the "path"
Field-by-field Comparison
Field
Before
After
Front
Backtracking in DP Problems
Back
Backtracking can find the solution of the problem from the DP table. From the recursion and it's behaviour we find the "path"<br><br><img src="paste-c186a33203c3cb874cfeb7870ee1a4c5d52bf205.jpg">
Approach: Initiate all distances with \(\infty\) . Then go \(|V| - 1\) times through every edge, and test for all (u,v) in E if \(\text{dist}[v] > \text{dist}[u] + w(u,v)\). If yes, update the distance. If after \(|V| - 1\) iterations an edge can still be relaxed (in a last iteration), then there exists a negative cycle
Uses: Detect negative cycles, find minimal-cost paths in weighted graphs with negative weights}}
?
Field-by-field Comparison
Field
Before
After
Name
<div style="text-align: center;"><b>Bellman-Ford</b></div><div style="text-align: center; "><br></div><div><b>Runtime</b>: :\( \mathcal{O}(|E| \cdot |V|)\)}}</div><div><br></div><div><b>Approach</b>: Initiate all distances with \(\infty\) . Then go \(|V| - 1\) times through every edge, and test for all (u,v) in E if \(\text{dist}[v] > \text{dist}[u] + w(u,v)\). If yes, update the distance. If after \(|V| - 1\) iterations an edge can still be relaxed (in a last iteration), then there exists a negative cycle</div><div><br></div><div><b>Uses</b>: Detect negative cycles, find minimal-cost paths in weighted graphs with negative weights}}</div>
<div style="text-align: center;"><b>Kruskal</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| \log |E| + |E| \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::Sort the edges by weight and add them one-by-one as long as they are in different components (which can be checked efficiently with Union Find).}}</div><div><br></div><div><b>Uses</b>: {{c3::Find MST in weighted, undirected graph}}</div>
Same as with pre-/postordering, we can use enter-/leave-ordering here:
enter step at which vertex \(v\) is first encountered.
leave step at which vertex \(v\) is dequeued
Field-by-field Comparison
Field
Before
After
Front
Pre- and Postordering in BFS:
Back
<div>Same as with <strong>pre-/postordering</strong>, we can use <strong>enter-/leave-ordering</strong> here: </div><div><ul><li><code>enter</code> step at which vertex \(v\) is first encountered.</li><li><code>leave</code> step at which vertex \(v\) is dequeued<br></li></ul><div><img src="paste-19431b32f9a8ad33704854b76596be9edd8629d5.jpg"></div></div>
It's a \(G = (V, E)\) with \(V\) the set of all vertices (Knotenmenge) and \(E\) the set of all edges (Kantenmenge).
Field-by-field Comparison
Field
Before
After
Front
What is the mathematical definition of a Graph?
Back
It's a \(G = (V, E)\) with \(V\) the set of all vertices (<i>Knotenmenge</i>) and \(E\) the set of all edges (<i>Kantenmenge</i>).
In every connected graph \(G\), when executing Kruskal using Union-Find, the representative repr[u] changes \(O(\dots)\) times:
\(O(\log_2 |V|)\), as we always at least double the size of the representative (we merge smaller into bigger, and repr[u] changes if it's the smaller one).
Field-by-field Comparison
Field
Before
After
Front
In every connected graph \(G\), when executing Kruskal using Union-Find, the representative <b>repr[u]</b> changes \(O(\dots)\) times:
Back
\(O(\log_2 |V|)\), as we always at least double the size of the representative (we merge smaller into bigger, and repr[u] changes if it's the smaller one).
Explore as far as possible along each branch before backtracking. Potentially keep track of pre- / post-numbers to make edge classifications.<br><br>We want to find a sink, add it to the list, then backtrack and find the next one.<br><br>The reversed post-order then gives us a toposort.<br><br>Example output:<br><img src="paste-f6163ccea9c72dbfdc9cb9045b600a5a41b8aa6b.jpg">
Our current node adopts one of the children. The separators have to be updated (one is given with the adopted child)
Field-by-field Comparison
Field
Before
After
Front
<b>2-3 Tree</b>: Deleting Steps if neighbour has 3 keys:
Back
Our current node adopts one of the children. The separators have to be updated (one is given with the adopted child)<br><img src="paste-bd8f4c10d3d0aaa08619b4e358673f9ff6b134a0.jpg">
set the inner loop variable to be the array's inner variable:
for j in ...: for i in ...: DP[j][i]
Otherwise we have to jump DP[i].length elements each time we want to access the next element
Field-by-field Comparison
Field
Before
After
Front
how to speed up array access to DP-Array
Back
<b>Row-Major</b> vs. <b>Column Major</b> Access:<br><br>set the inner loop variable to be the array's inner variable:<br><br>for j in ...:<br> for i in ...:<br> DP[j][i]<br><br>Otherwise we have to jump DP[i].length elements each time we want to access the next element
For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the isolated vertices of the graph as it’s own connected component.
Each vertex marks it’s cheapest outgoing edge as a safe edge (making use of the cut property). We add these to \(F\).
Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.
Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.
\(F\) constitutes the edges of the MST.
Field-by-field Comparison
Field
Before
After
Front
Describe the steps of <b>Boruvka's Algorithm</b>:
Back
<ol><br><li>For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the <em>isolated vertices</em> of the graph as it’s <em>own connected component</em>.</li><li>Each vertex marks it’s cheapest outgoing edge as a <em>safe edge</em> (making use of the cut property). We add these to \(F\).</li></ol><ul><li>Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.<br><img src="paste-053ccf0acc6d560628bd8518b928a0d6c2687cb1.jpg"></li></ul><ol><li>Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.</li><li>\(F\) constitutes the edges of the MST.</li></ol>
<div>Prim’s algorithm starts with a single vertex and grows the MST outwards from that seed.</div>
<ol>
<li><strong>Initialisation:</strong><ul>
<li>Select and arbitrary starting vertex \(s\) and empty set \(F\)</li>
<li>Set \(S = {s}\) tracks the vertices in the MST</li>
<li>Each vertex gets a <code>key[v] =</code> representing the cheapest known connection cost to \(v\):<ul>
<li>\(\infty\) if no edge connects \(s\) to \(v\)</li>
<li>\(w(s, v)\) if edge \((s, v)\) exists</li>
</ul>
</li>
<li>Use a priority queue \(Q\) (<em>Min-Heap</em>) to store the vertices, in order of lowest <code>key</code> cost</li>
</ul>
</li>
<li><strong>Iteration:</strong><ul>
<li><em>Select and add</em> Extract the vertex \(u\) with the minimum <code>key</code> from \(Q\). This is the cheapest to connected to the current MST. Add \(u\) to \(S\).</li>
<li><em>Update Neighbours</em> For each neighbour <b>\(v\) </b>of \(u\) <em>not</em> in \(S\):<ul>
<li>If \(w(u, v) < \text{key}[v]\) update <code>key[v] = w(u, v)</code> and update the priority in \(Q\).<ul>
<li>This discovers potentially cheaper connections to vertices outside the current MST. If a <em>cheaper edge</em> to \(v\) is found, the current value in <code>key[v]</code> cannot be part of the MST</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><strong>Termination:</strong> When \(Q\) is empty, all vertices are in \(S\) and connected, and the edges chosen are in the MST (tracked in the set \(F\) through updates).</li></ol>
Explain how to find a topological order (high-level):
it is a sorting of the vertices of a directed graph, which we can build from the back by always finding a vertex which has no succeeding vertices, remove it from the graph and add it to the front of our topologically sorted list.
This is not possible if there is a directed cycle in the graph.
Field-by-field Comparison
Field
Before
After
Front
Explain how to find a topological order (high-level):
Back
it is a sorting of the vertices of a directed graph, which we can build from the back by always finding a vertex which has no succeeding vertices, remove it from the graph and add it to the front of our topologically sorted list.<br><br>This is not possible if there is a directed cycle in the graph.
We can use a binary search tree to implement the dictionary. The tree-condition is for every node, all keys in the left child are smaller than those in the right child.
We can use a binary search tree to implement the dictionary. The tree-condition is for every node, all keys in the left child are smaller than those in the right child.
Field-by-field Comparison
Field
Before
After
Text
We can use a binary search tree to implement the dictionary. The tree-condition is {{c1::for every node, all keys in the left child are smaller than those in the right child}}.
In BFS enter/leave ordering, the FIFO queue guarantees that the enter order = leave order within a given level.
Field-by-field Comparison
Field
Before
After
Text
In BFS enter/leave ordering, the FIFO queue guarantees that {{c1:: the <b>enter</b> order = <b>leave</b> order}} within a given level.
The ADT stack can be efficiently implemented using a singly linked list:
push: \(\Theta(1)\)
pop: \(\Theta(1)\) as this removes the first element. This means we just copy the pointer next from the first element to be the first pointer of the list.
The ADT stack can be efficiently implemented using a singly linked list:
push: \(\Theta(1)\)
pop: \(\Theta(1)\) as this removes the first element. This means we just copy the pointer next from the first element to be the first pointer of the list.
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>stack</b> can be efficiently implemented using a {{c1:: <b>singly linked list</b>}}:<br><ul><li><b>push</b>: {{c2:: \(\Theta(1)\)}}<br></li><li><b>pop</b>: {{c3:: \(\Theta(1)\) as this removes the first element. This means we just copy the pointer next from the first element to be the first pointer of the list.}}<br></li></ul>
<div>Heapsort works like selection sort by always selecting the largest element and placing it at the end of the sorted array, but instead of having to do an expensive linear search for the largest element, we make it \(O(\log(n))\).</div><div><br></div> <div>This is done by converting the array into a <b>MaxHeap</b> before sorting.</div><div>This Heap is a tree that has the property that children are always smaller than their parents.</div>
<div style="text-align: center;"><b>Floyd-Warshall</b></div><div style="text-align: center; "><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|V|^3)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::3D DP: It is based on a triple-nested <code>for</code>-loop with the following recursion: \(d[u][v] = \min(d[u][v], d[u][i] + d[i][v])\).}}</div><div><br></div><div><b>Uses</b>: {{c3::All-to-all shortest path in directed graph without negative cycles.}}</div>
Best Case: \(O(n^2)\) (\(O(n)\) if checking for swaps and aborting early) Worst Case: \(O(n^2)\)
We use \(\Theta(n^2)\) comparisons and \(O(n^2)\) switches.
Field-by-field Comparison
Field
Before
After
Name
Bubble Sort
Runtime
Best Case: \(O(n^2)\) (\(O(n)\) if checking for swaps and aborting early)<br>Worst Case: \(O(n^2)\)
Approach
It goes through the array \(n\) times, each time "bubbling up" the biggest element to the end, by swapping it.<br><br>During each inner iteration, high elements are swapped with their right neighbours until they hit a higher one. The algorithm then continues after that.<br><img src="paste-77ff59065d5ea6786b5452097dc4c319413d239e.jpg">
<div>DP-Table: <code>DP[0..n][0..m]</code> for \(n, m\) lengths of the strings</div><div><br></div><div><div>longest common subsequence that two strings share. For example TIGER and ZIEGE share IGE as a LGT.</div></div><div><br></div><div>
<div>This gives us the following recursion: \[L(i,j) = \begin{cases} 0, & i = 0 \text{ oder } j = 0 \\ L(i-1, j-1) + 1, & X_i = Y_j \\ \max(L(i-1,j), L(i,j-1)), & X_i \neq Y_j \end{cases}\]</div></div>
There exists a negative cycle \(\Leftrightarrow \exists v \in V \ : \ d^n_{v \rightarrow v} < 0\)
In words: If there exists a path from a vertex to itself with negative weight (passing through any other vertex, i.e. \(n\)th iteration of the outer loop), then there exists a negative cycle that contains this vertex.
We can perform a negative cycle check at the end, by going over all diagonals.
Field-by-field Comparison
Field
Before
After
Front
Floyd-Warshall, when is there a negative cycle?
Back
<div>There exists a negative cycle \(\Leftrightarrow \exists v \in V \ : \ d^n_{v \rightarrow v} < 0\)</div><div><br></div> <div>In words: If there exists a path from a vertex to itself with negative weight (passing through any other vertex, i.e. \(n\)th iteration of the outer loop), then there exists a negative cycle that contains this vertex.</div><br><div>We can perform a negative cycle check at the end, by going over all diagonals.</div>
The upper limit can be expressed as the highest term, times the amount of terms:\[ \sum_{i = 1}^n i^3 = 1^3 + 2^3 + 3^3 + \ ... \ + n^3 \leq n \cdot \sum_{i = 1}^n n^3 = n^4 \]
Field-by-field Comparison
Field
Before
After
Front
How do we derive an upper limit for a sum?
Back
The upper limit can be expressed as the <b>highest term</b>, times the <b>amount of terms</b>:\[ \sum_{i = 1}^n i^3 = 1^3 + 2^3 + 3^3 + \ ... \ + n^3 \leq n \cdot \sum_{i = 1}^n n^3 = n^4 \]<br>
runtime dependent on a number \(W\) (like in knapsack) which is not correlated polynomially to input length but exponentially.
The DP-table get's 10x for \(W = 10 \rightarrow 100\) but the input size (binary) only grows from \(\log_2(10) \approx 3 \rightarrow \approx 6\) so x2.
Field-by-field Comparison
Field
Before
After
Front
What is pseudo-polynomial time?
Back
runtime dependent on a number \(W\) (like in knapsack) which is not correlated polynomially to input length but exponentially.<br><br>The DP-table get's 10x for \(W = 10 \rightarrow 100\) but the input size (binary) only grows from \(\log_2(10) \approx 3 \rightarrow \approx 6\) so x2.
In every iteration of insertion sort, we take the first element from the unsorted input and place it correctly in the sorted output.
Field-by-field Comparison
Field
Before
After
Text
In every iteration of <b>insertion sort</b>, we {{c1::take the first element from the unsorted input and place it correctly in the sorted output}}.
We "relax" an edge when \(d[u] + c(u, v) < d[v]\). In other words, we currently say that there is a path from \(s \rightarrow u\) and \(u \rightarrow v\) such that it's shorter than \(s \rightarrow v\).
This means that our current upper-bound for the shortest distance to \(v\) (\(d[v]\)), is too high as it violates the triangle inequality. Thus we updated ("relax") the edge.
Field-by-field Comparison
Field
Before
After
Front
What is a relaxation in Bellman-Ford?
Back
We "relax" an edge when \(d[u] + c(u, v) < d[v]\). In other words, we currently say that there is a path from \(s \rightarrow u\) and \(u \rightarrow v\) such that it's shorter than \(s \rightarrow v\).<br><br>This means that our <b>current upper-bound</b> for the shortest distance to \(v\) (\(d[v]\)), is too high as it violates the triangle inequality. Thus we updated ("relax") the edge.
How can we make Knapsack polynomial using approximation?
round the profits and solve the Knapsack problem for these rounded profits:\(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\). We then only have to compute every K'th entry to the DP-table.
Field-by-field Comparison
Field
Before
After
Front
How can we make Knapsack polynomial using approximation?
Back
round the profits and solve the Knapsack problem for these rounded profits:\(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\). We then only have to compute every K'th entry to the DP-table.
Every iteration, selection sort goes through the "unsorted part" of the array, searches for the biggest element and puts it at the end.<br><br>Thus on the right-side (or left-side if inverted), we have a list of sorted integers slowly growing, while we only compare the unsorted ones to findest the next biggest to put at the beginning of the sorted list.<br><br><img src="paste-6a66b1206f7de5b79d25af683f5dd409004852c0.jpg">
Pseudocode
<img src="paste-e41e8fe78828c54643b03175043cfb7610ff04df.jpg"><div>(This has the sorted list at the start thus searches the smallest element)</div>
Invariant
Nach \(j\) Durchläufen der äusseren Schleife sind die \(j\) grössten Elemente am richtigen Ort. (Same as for Bubblesort)
How can we use the Master theorem to get a lower bound on the asymptotic runtime of a recursive function?
Let \(a, C' > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\) \(T(n) \geq aT(\frac{n}{2}) + C'n^b\) . Then for all \(n = 2^k\) the following statements hold: 1. if \(b > \log_2a\), \(T(n) \geq \Omega(n^b)\) 2. if \(b = \log_2a\), \(T(n) \geq \Omega (n^{\log_2a}\log n)\) 3. if \(b < \log_2a\), \(T(n) \geq \Omega(n^{\log_2 a})\)
Field-by-field Comparison
Field
Before
After
Front
How can we use the Master theorem to get a lower bound on the asymptotic runtime of a recursive function?
Back
Let \(a, C' > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\) <br> \(T(n) \geq aT(\frac{n}{2}) + C'n^b\) . <br>Then for all \(n = 2^k\) the following statements hold:<br>1. if \(b > \log_2a\), \(T(n) \geq \Omega(n^b)\)<br>2. if \(b = \log_2a\), \(T(n) \geq \Omega (n^{\log_2a}\log n)\)<br>3. if \(b < \log_2a\), \(T(n) \geq \Omega(n^{\log_2 a})\)
In Dijkstra's after visiting vertex \(v\), the distance \(d(v)\) is never updated anymore.
No negative edges means there's no shorter way (we consider in increasing distance order).
With negative weights, a longer path through an unvisited vertex could later turn out to be shorter due to a negative edge.
Field-by-field Comparison
Field
Before
After
Text
In Dijkstra's after visiting vertex \(v\), the distance \(d(v)\) is {{c1:: never updated anymore}}.
Extra
No negative edges means there's no shorter way (we consider in increasing distance order).<br><br>With negative weights, a longer path through an unvisited vertex could later turn out to be shorter due to a negative edge.
Table: DP[1..n]<br>Define the "randmax": \( R_j := \max_{1 \leq i \leq j} \sum_{k = i}^j A[k] \) (maximale summe eines teilarrays das an j endet.<br><ul><li>Base Case: \(R_1 = A[1]\)</li><li>Recursion is \(R_j = \max \{ A[j], R_{j - 1} + A[j]
\}\)<br>Thus either our current subarray contains the element at j, or not and we start with it again.</li></ul>
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(v) < \text{pre}(u) < \text{post}(u) < \text{post}(v)\): back edge
exists a cycle!
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br>\(\text{pre}(v) < \text{pre}(u) < \text{post}(u) < \text{post}(v)\): {{c1:: back edge}}
In a linked list, the keys don't appear in order in memory. They each contain {c2::a pointer to the start of the next element in the list instead}}.
We also have an extra pointer to the end in practice.
The last pointer of the list is a null pointer to indicate the end.
Field-by-field Comparison
Field
Before
After
Text
In a <b>linked list</b>, the keys {{c1::don't appear in order in memory}}. They each contain {c2::a pointer to the start of the next element in the list instead}}.<br><br>We also have {{c3::an extra pointer to the end in practice}}.
Extra
The last pointer of the list is a null pointer to indicate the end.
Set the distance to all vertices to \(\infty\) in the d[v] array. Set the d[s] = 0.
Initialise a Queue \(Q\) with \(s\)
Set the dictionary parent = {}
Exploration:
Dequeue the first element in the queue $v$
For all adjacent nodes \(u\) with distance \(= \infty\) (not visited yet):
Set the distance d[u] = d[v] + 1
add \(u\) to the queue
Set the parent[u] = v.
Return: We return the distances and the shortest path tree
The queue ensures that we don't mix up the order.
Field-by-field Comparison
Field
Before
After
Front
Describe the steps in <b>BFS</b>:
Back
BFS is a <b>shortest path algorithm</b>.<br><ol><li><strong>Initialisation:</strong> <ul>
<li>Set the distance to all vertices to \(\infty\) in the <code>d[v]</code> array. Set the <code>d[s] = 0</code>.</li>
<li>Initialise a Queue \(Q\) with \(s\)</li>
<li>Set the dictionary <code>parent = {}</code></li>
</ul>
</li>
<li><strong>Exploration:</strong><ul>
<li>Dequeue the first element in the queue $v$</li>
<li>For all <em>adjacent nodes</em> \(u\) with distance \(= \infty\) (not visited yet):<ul>
<li>Set the distance <code>d[u] = d[v] + 1</code></li>
<li>add \(u\) to the queue</li>
<li>Set the <code>parent[u] = v</code>.</li>
</ul>
</li>
</ul>
</li>
<li><strong>Return:</strong> We return the distances and the <em>shortest path tree</em></li></ol><div><br></div><div>The queue ensures that we don't mix up the order.</div>
A PriorityQueue is like a queue, with the difference that every key is associated with a natural number which indicates the importance.
The elements are then returned in the order of this importance.
Field-by-field Comparison
Field
Before
After
Text
A <b>PriorityQueue</b> is like a queue, with the difference that {{c1:: every key is associated with a natural number which indicates the importance}}.
Extra
The elements are then returned in the order of this importance.
How does Depth-first-search work and what is its runtime for the two implementations of a graph?
a depth first search marks the vertices it visits, at each vertex it looks for a vertex it has not yet visited and if there are none, it tracks back to a vertex which still has some unvisited adjacent nodes
its runtime in an adjacency matrix is \(O(n^2)\) as it has to visit each vertex once and search through all \(n\) potential neighbors
implemented using adjacency lists, the runtime is \(O(n+m)\) as we still have to visit each vertex once but we only have to search through at most \(\text{deg}_{out}(u)\) vertices at each step, which adds up to searching through all the edges
Field-by-field Comparison
Field
Before
After
Front
How does Depth-first-search work and what is its runtime for the two implementations of a graph?
Back
a depth first search marks the vertices it visits, at each vertex it looks for a vertex it has not yet visited and if there are none, it tracks back to a vertex which still has some unvisited adjacent nodes<br><br>its runtime in an adjacency matrix is \(O(n^2)\) as it has to visit each vertex once and search through all \(n\) potential neighbors<br><br>implemented using adjacency lists, the runtime is \(O(n+m)\) as we still have to visit each vertex once but we only have to search through at most \(\text{deg}_{out}(u)\) vertices at each step, which adds up to searching through all the edges
The ADT priorityQueue can be efficiently implemented using a MaxHeap. This guarantees \(O(\log n)\) for both operations.
Field-by-field Comparison
Field
Before
After
Text
<div>The ADT <b>priorityQueue</b> can be efficiently implemented using a {{c1:: <b>MaxHeap</b>}}. This guarantees {{c2:: \(O(\log n)\)}} for both operations.</div>
We iterate over all edges in the "relaxation" thus the time complexity of that step is \(O(m)\) (the actual check is \(O(1)\)). As we relax \(n - 1\) (or \(n\) for negative cycle check) times, the total runtime is \(O(n \cdot m)\).
Field-by-field Comparison
Field
Before
After
Name
Bellman-Ford
Runtime
\(O(|V| \cdot |E|)\) (uses DP)<br><br>We iterate over all edges in the "relaxation" thus the time complexity of that step is \(O(m)\) (the actual check is \(O(1)\)).<br>As we relax \(n - 1\) (or \(n\) for negative cycle check) times, the total runtime is \(O(n \cdot m)\).
Requirements
Negative-edges allowed (neg. cycles detected) in a directed, weighted graph.
Approach
<ol>
<li><b>Initialize</b>:<br>Set the distance to the source vertex as 0 and to all other vertices as infinity.</li>
<li><b>Relax Edges</b>: <br>Repeat for V − 1 iterations (where V is the number of vertices):<br>For each edge, update the distance to its destination vertex if the distance through the edge
is smaller than the current distance.</li>
<li><b>Check for Negative Cycles</b>: <br>Check all edges to see if a shorter path can still be found. If so, the graph contains a negative-
weight cycle.</li>
<li><b>End</b>: <br>If no negative-weight cycle is found, the algorithm outputs the shortest paths.</li></ol><img src="paste-95017d19365697a9f94b52394c6bdb999dfc81d1.jpg"><br><br>(quicker to implement the edge-based approach, but there's also a vertex based approach)
Binary trees are not balanced possible that \(h >> \log_2 n\) Worst case example if inserted in ascending order:
Field-by-field Comparison
Field
Before
After
Front
<b>Worst case</b> for <b>search</b> in a <b>binary tree</b>?
Back
Binary trees are not <b>balanced</b> possible that \(h >> \log_2 n\)<br>Worst case example if inserted in ascending order:<br><b></b><img src="paste-201c49e27928e7a814e89e8de667e07e5c7789ce.jpg">
Minimal jumps to get from beginning of array to the end.<br><br>Variable switch: cells which we can reach in \(k\) jumps. Solution is smallest \(k\) for which \(M[k] \geq n\).<br><br>We look at all \(i\) we can reach with exactly \(k-1\) jumps:<br><ul><li>Base Case: \(M[0] = A[0]\), \(M[1] = A[1] + 1\)</li><li>Recursion: \( M[k] = \max \{i + A[i] \ | \ M[k - 2] \leq i \leq M[k - 1]\} \)</li></ul><div>We look exactly 1 at every \(i\), thus \(O(n)\)</div>
<div style="text-align: center;"><b>BFS</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| + |V|) \)}}</div><div><br></div><div><b>Approach</b>: {{c2::First go through all direct successors of an edge, then move to a level deeper.}}</div><div><br></div><div><b>Uses</b>: {{c3::Shortest path in unweighted graphs, cycle detection, test if graph is bipartite, path finding}}</div>
A cheapest path in a weighted graph (without negative cycles) has the optimal substructure property: any subpath is itself the cheapest path between it's endpoints.
Field-by-field Comparison
Field
Before
After
Front
Optimal substructure of cheapest paths:
Back
A cheapest path in a weighted graph (without negative cycles) has the optimal substructure property: <i>any subpath is itself the cheapest path between it's endpoints</i>.
The length of a walk \((v_0, v_1, \dots, v_k)\) is \(k\), i.e. the number of vertices minus 1.
A walk of length \(l\) connects \(l + 1\) vertices.
Field-by-field Comparison
Field
Before
After
Front
What is the length of a walk?
Back
The length of a walk \((v_0, v_1, \dots, v_k)\) is \(k\), i.e. the number of vertices minus 1.<br><br>A walk of length \(l\) connects \(l + 1\) vertices.
The distances "d[.] = " in the distance array are the values of the vertices in the priority queue (see line decrease_key(H, v, d[v])).
Field-by-field Comparison
Field
Before
After
Text
Prim's Algorithm Invariants:<br><br><div>The distances "d[.] = " in the distance array are {{c1::the values of the vertices in the priority queue (see line decrease_key(H, v, d[v]))}}.</div>
Prim's Algorithm is similar to Dijkstra's with the difference that \(d[v]\) is the minimum between current value and \(w(v*, v)\) instead of \(d[v^*] + w(v^*, v)\) .
Prim's Algorithm is similar to Dijkstra's with the difference that \(d[v]\) is the minimum between current value and \(w(v*, v)\) instead of \(d[v^*] + w(v^*, v)\) .
Dijkstra's find the shortest distance to each vertex, thus it tracks the total.
Prim's needs to build the MST, thus it only cares about which vertex to choose next to find a (cheapest) safe-edge.
Field-by-field Comparison
Field
Before
After
Text
<b>Prim's Algorithm</b> is similar to {{c1:: Dijkstra's}} with the difference that {{c1:: \(d[v]\) is the minimum between current value and \(w(v*, v)\) instead of \(d[v^*] + w(v^*, v)\) }}.
Extra
Dijkstra's find the shortest distance to each vertex, thus it tracks the total.<br><br>Prim's needs to build the MST, thus it only cares about which vertex to choose next to find a (cheapest) safe-edge.
Prim's Algorithm Invariants: The priority queue \(H = V \setminus S\) (\(V\) set of all vertices, \(S\) vertices currently in the MST) never contains a vertex already in the MST.
Prim's Algorithm Invariants: The priority queue \(H = V \setminus S\) (\(V\) set of all vertices, \(S\) vertices currently in the MST) never contains a vertex already in the MST.
Field-by-field Comparison
Field
Before
After
Text
Prim's Algorithm Invariants: <br>The priority queue \(H = V \setminus S\) (\(V\) set of all vertices, \(S\) vertices currently in the MST) {{c1::never contains a vertex already in the MST}}.
If \(\frac{f(n)}{g(n)}\) tends to {{c1::\(C \in \mathbb{R}^+\)}}, then \(f \leq O(g)\) and \(g \leq O(f) \Leftrightarrow f = \Theta(g)\).
Field-by-field Comparison
Field
Before
After
Text
If \(\frac{f(n)}{g(n)}\) tends to {{c1::\(C \in \mathbb{R}^+\)}}, then {{c2::\(f \leq O(g)\) and \(g \leq O(f) \Leftrightarrow f = \Theta(g)\)}}.
\(O(|V|+|E|)\) (Adjacency List)
The runtime of BFS:
each loop we take \(O(1 + \deg(u))\) time (go through the vertex \(u\)'s edges
We loop a total of \(|V|\) times (we visit each edge max. 1 time)
Field-by-field Comparison
Field
Before
After
Name
BFS (Breadth First Search)
Runtime
\(O(|V|+|E|)\) (Adjacency List)
Requirements
Directed Graph ((negative) cycles accepted, as "shortest" (not cheapest) path not affected)
Approach
<b>BFS</b> looks for the shortest paths (not cheapest) in a graph.<br><ol><li><b>Initialisation:</b> <ul>
<li>Set the distance to all vertices to \(\infty\) in the <code>d[v]</code> array. Set the <code>d[s] = 0</code>.</li>
<li>Initialise a Queue \(Q\) with \(s\)</li>
<li>Set the dictionary <code>parent = {}</code></li>
</ul>
</li>
<li><b>Exploration:</b><ul>
<li>Dequeue the first element in the queue \(v\)</li>
<li>For all <em>adjacent nodes</em> \(u\) with distance \(= \infty\) (not visited yet):<ul>
<li>Set the distance <code>d[u] = d[v] + 1</code></li>
<li>add \(u\) to the queue</li>
<li>Set the <code>parent[u] = v</code>.</li>
</ul>
</li>
</ul>
</li>
<li><b>Return:</b> We return the distances and the <i>shortest path tree</i></li></ol>
The runtime of BFS:<br><ol><li>each loop we take \(O(1 + \deg(u))\) time (go through the vertex \(u\)'s edges</li><li>We loop a total of \(|V|\) times (we visit each edge max. 1 time)</li></ol>
The triangle inequality in a weighted graph is \(d(u, v) \leq d(u, w) + d(w, v)\)
Back
ETH::1._Semester::A&D::10._Shortest_Paths
The triangle inequality in a weighted graph is \(d(u, v) \leq d(u, w) + d(w, v)\)
This holds as if the path through \(w\) was actually cheaper, then \(d(u, v)\) would be wrong.
Does not hold in graphs with negative cycles.
Field-by-field Comparison
Field
Before
After
Text
The {{c1::<b>triangle inequality</b>}} in a weighted graph is {{c2::\(d(u, v) \leq d(u, w) + d(w, v)\)}}
Extra
This holds as if the path through \(w\) was actually cheaper, then \(d(u, v)\) would be wrong.<br><br>Does not hold in graphs with negative cycles.
The runtime is calculated from \(O(n + (\#\text{extract-min} + \#\text{decrease-key}) \cdot \log n)\) which gives \(O((n + m) \cdot \log n)\).
Field-by-field Comparison
Field
Before
After
Name
Dijkstra's Algorithm
Runtime
\(O((|E| + |V|) \log |V|)\) (or \(O(|V|^2)\)<br><br>The runtime is calculated from \(O(n + (\#\text{extract-min} + \#\text{decrease-key}) \cdot \log n)\) which gives \(O((n + m) \cdot \log n)\).
Requirements
No negative edge-weights (to make sure that we don't need to go back)
Approach
Vertices are considered in <i>increasing</i> order of their distances from the source.<br><br>Recurrence:\[ d(s, v_k) = \min_{(v_i, v_k) \in E, i < k} \{ d(s, v_i) + c(v_i, v_k) \} \]<br><ol><li>Add start vertex \(s\) to prioqueue with dist 0 and set all other dists to \(\infty\)</li><li>Pop Cheapest Vertex \(v\) from Priority Queue</li><li>For each neighbour \(u\): if distance (= current_distance + \(w(v\rightarrow u)\)) < distance to \(u\) then overwrite and push new distance to queue.<br>Current vertex is marked as visited and not revisited again.</li></ol>
In any ring \(\langle R; +, -, 0, \cdot, 1 \rangle\), and for all \(a, b \in R\) \(a0 =\) {{c1::\(0a = 0\)}}.
Extra
The zero (neutral of additive group) pulls all other elements to 0 by multiplication.<br><br>\(0a=(0+0)a=0a+0a\) and thus \(0a - 0a = 0a \implies 0 = 0a\)
A subset \(H \subseteq G\) of a group is called a subgroup if \(H\) is: closed with respect to all operations (operation, neutral, inverse).
Field-by-field Comparison
Field
Before
After
Text
<p>A subset \(H \subseteq G\) of a group is called a {{c1::subgroup}} if \(H\) is: {{c2::closed with respect to all operations (operation, neutral, inverse)}}.</p>
Are the rational numbers \(\mathbb{Q}\) countable?
Yes, the rational numbers \(\mathbb{Q}\) are countable. They correspond to (a, b) tuples which can be mapped bijectively to the natural numbers.
Field-by-field Comparison
Field
Before
After
Front
Are the rational numbers \(\mathbb{Q}\) countable?
Back
Yes, the rational numbers \(\mathbb{Q}\) are <strong>countable</strong>. They correspond to (a, b) tuples which can be mapped bijectively to the natural numbers.
A polynomial \(a(x)\) over a commutative ring \(R\) in the indeterminate \(x\) is a formal expression of the form: \[ a(x) = {{c2::a_d x^d + a_{d-1}x^{d-1} + \cdots + a_1 x + a_0}} = \sum_{i=0}^d a_i x^i \] for some non-negative integer \(d\), with \(a_i \in R\).
The set of polynomials in \(x\) over \(R\) is denoted \(R[x]\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is a polynomial over a commutative ring?</p>
Back
<p>A polynomial \(a(x)\) over a commutative ring \(R\) in the indeterminate \(x\) is a formal expression of the form: \[ a(x) = {{c2::a_d x^d + a_{d-1}x^{d-1} + \cdots + a_1 x + a_0}} = \sum_{i=0}^d a_i x^i \] for some non-negative integer \(d\), with \(a_i \in R\).</p>
<p>The set of polynomials in \(x\) over \(R\) is denoted \(R[x]\).</p><p><br></p>
Steps to proving an isomorphism \(\phi: G \rightarrow H\):
Back
We have to prove the map is:<br><ul><li>well-defined</li><li>The image of \(\phi\) lies entirely within \(H\)</li><li>homomorphism-property \(\phi(g_1 \cdot g_2) = \phi(g_1) \cdot \phi(g_2)\)</li><li>injectivity</li><li>surjectivity</li></ul>
For a poset \((A;\preceq)\), two elements \(a,b\) are comparable if \(a \preceq b\) or \(b \preceq a\), otherwise they are incomparable.
Field-by-field Comparison
Field
Before
After
Text
For a poset \((A;\preceq)\), two elements \(a,b\) are <b>comparable</b> if {{c1::\(a \preceq b\) or \(b \preceq a\),}} otherwise they are <b>incomparable</b>.
For any \(i\) and \(k\), if \(t_1, \dots, t_k\) are terms, then {{c1::\(P_i^{(k)}(t_1, \dots, t_k)\) is a formula}}, called an atomic formula.
Field-by-field Comparison
Field
Before
After
Text
For any \(i\) and \(k\), if \(t_1, \dots, t_k\) are terms, then {{c1::\(P_i^{(k)}(t_1, \dots, t_k)\) is a formula}}, called an {{c2::<i>atomic formula</i>}}.
What does it mean intuitively for two groups to be isomorphic?
Two groups are isomorphic if they have the same structure - they "behave identically" even if they look different.
Analogy: Like two jigsaw puzzles that look completely different, but use the same cutout pattern. The same piece goes into the same place on both puzzles.
The bijection between them preserves all group operations and relationships.
Field-by-field Comparison
Field
Before
After
Front
<p>What does it mean intuitively for two groups to be isomorphic?</p>
Back
<p>Two groups are isomorphic if they have the <strong>same structure</strong> - they "behave identically" even if they look different.</p>
<p><strong>Analogy</strong>: Like two jigsaw puzzles that look completely different, but use the same cutout pattern. The same piece goes into the same place on both puzzles.</p>
<p>The bijection between them preserves all group operations and relationships.</p>
For a homomorphism \(h: G \rightarrow H\), the {{c1::image \(\text{im} h\)}} is the set of all elements in \(H\) that are mapped to by some element in \(G\).
For a homomorphism \(h: G \rightarrow H\), the {{c1::image \(\text{im} h\)}} is the set of all elements in \(H\) that are mapped to by some element in \(G\).
Field-by-field Comparison
Field
Before
After
Text
<p>For a homomorphism \(h: G \rightarrow H\), the {{c1::image \(\text{im} h\)}} is the {{c2::set of all elements in \(H\) that are mapped to by some element in \(G\)}}.</p>
For every \(k\) we have:
\[(A_1 \lor \dots \lor A_k) \land (A_1 \rightarrow B) \land \dots \land (A_k \rightarrow B) \models B\]
(If at least one case occurs, and all cases imply \(B\), then \(B\) holds)
Field-by-field Comparison
Field
Before
After
Front
What is the logical rule for case distinction?
Back
For every \(k\) we have:
\[(A_1 \lor \dots \lor A_k) \land (A_1 \rightarrow B) \land \dots \land (A_k \rightarrow B) \models B\]
<br>
(If at least one case occurs, and all cases imply \(B\), then \(B\) holds)
Ein Körper ist eine Menge {{c1::\( \mathbb{K}\) mit Operationen \(+ , *\)}} mit folgenden Eigenschaften:
{{c2::
- \( (\mathbb{K}, +)\) ist eine abelsche Gruppe
- \( (\mathbb{K} \backslash \{0\}, *)\) ist eine abelsche Gruppe
- Distributivität: \( a * (b+c) = a*b + a*c\)
}}
Beispiel: \( \mathbb{Q}, \mathbb{R}\)
Field-by-field Comparison
Field
Before
After
Text
{{c1::Ein Körper}} ist eine Menge {{c1::\( \mathbb{K}\) mit Operationen \(+ , *\)}} mit folgenden Eigenschaften:<div>{{c2::<div>- \( (\mathbb{K}, +)\) ist eine abelsche Gruppe</div><div>- \( (\mathbb{K} \backslash \{0\}, *)\) ist eine abelsche Gruppe</div><div>- Distributivität: \( a * (b+c) = a*b + a*c\)</div>}}<br></div>
Give the formal definition of a greatest common divisor \(d\) of integers \(a\) and \(b\) (not both 0).
\[d | a \land d | b \land \forall c \ ((c | a \land c | b) \rightarrow c | d)\]
\(d\) divides both \(a\) and \(b\), AND every common divisor of \(a\) and \(b\) divides \(d\).
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of a greatest common divisor \(d\) of integers \(a\) and \(b\) (not both 0).
Back
\[d | a \land d | b \land \forall c \ ((c | a \land c | b) \rightarrow c | d)\]
\(d\) divides both \(a\) and \(b\), AND every common divisor of \(a\) and \(b\) divides \(d\).
A proof system is sound if no false statement has a proof: \(\phi(s, p) = 1 \implies \tau(s) = 1\).
Note that the use of \(\implies\)is not the correct formalism.
For all \(s \in \mathcal{S}\) for which there exists a \(p \in \mathcal{P}\) with \(\phi(s, p) = 1\), we have \(\tau(s) = 1\) is the correct formal definition.
Field-by-field Comparison
Field
Before
After
Text
A proof system is {{c2:: <b>sound</b>}} if {{c1:: no false statement has a proof: \(\phi(s, p) = 1 \implies \tau(s) = 1\)}}.
Extra
<i>Note that the use of </i>\(\implies\)<i>is not the correct formalism.<br></i><br>For all \(s \in \mathcal{S}\) for which there exists a \(p \in \mathcal{P}\) with \(\phi(s, p) = 1\), we have \(\tau(s) = 1\) is the correct formal definition.
What is the logical rule for proof by contradiction?
\((\lnot A \rightarrow B) \land \lnot B \models A\)
Alternative: \((A \lor B) \land \lnot B \models A\)
(If assuming \(\lnot A\) leads to something false, then \(A\) must be true)
Field-by-field Comparison
Field
Before
After
Front
What is the logical rule for proof by contradiction?
Back
<ul>
<li>\((\lnot A \rightarrow B) \land \lnot B \models A\)</li>
<li>Alternative: \((A \lor B) \land \lnot B \models A\)</li>
</ul>
<br>
(If assuming \(\lnot A\) leads to something false, then \(A\) must be true)
An interpretation is suitable for a formula \(F\) if it assigns a value to all symbols \(\beta \in \Lambda\) occurring free in \(F\).
Field-by-field Comparison
Field
Before
After
Text
An interpretation is {{c1::<i>suitable</i>}} for a formula \(F\) if it {{c2::assigns a value to all symbols \(\beta \in \Lambda\) occurring free in \(F\)}}.
Theorem 5.25: Let \(F\) be a field. For any \(a(x)\) and \(b(x) \neq 0\) in \(F[x]\), there exists a unique \(q(x)\) (quotient) and unique \(r(x)\) (remainder) such that: \[ a(x) = b(x) \cdot q(x) + r(x) \quad \text{and} \quad \deg(r(x)) < \deg(b(x)) \]
This is analogous to integer division with remainder.
Field-by-field Comparison
Field
Before
After
Front
<p>Euclidian Division of polynomials in a Field:</p>
Back
<p><strong>Theorem 5.25</strong>: Let \(F\) be a field. For any \(a(x)\) and \(b(x) \neq 0\) in \(F[x]\), there exists a <strong>unique</strong> \(q(x)\) (quotient) and <strong>unique</strong> \(r(x)\) (remainder) such that: \[ a(x) = b(x) \cdot q(x) + r(x) \quad \text{and} \quad \deg(r(x)) < \deg(b(x)) \]</p>
<p>This is analogous to integer division with remainder.</p>
A partial function \(A \to B\) is a relation from \(A\) to \(B\) such that{{c1::\(\forall a \in A \; \forall b,b' \in B \; (a \mathop{f} b \land a\mathop{f} b' \to b = b')\) (well-defined).}}
A partial function \(A \to B\) is a relation from \(A\) to \(B\) such that{{c1::\(\forall a \in A \; \forall b,b' \in B \; (a \mathop{f} b \land a\mathop{f} b' \to b = b')\) (well-defined).}}
Field-by-field Comparison
Field
Before
After
Text
A <b>partial function </b>\(A \to B\) is a relation from \(A\) to \(B\) such that{{c1::\(\forall a \in A \; \forall b,b' \in B \; (a \mathop{f} b \land a\mathop{f} b' \to b = b')\) (well-defined).}}
Why is a polynomial of degree \(d\) uniquely determined by \(d + 1\) values of \(a(x)\)?
This \(a(x)\) is unique since if there was another \(a'(x)\) then \(a(x) - a'(x)\) would have at most degree \(d\) and thus at most \(d\) roots. But since \(a(x) - a'(x)\) has the same \(d + 1\) roots, it's \(0 \implies a(x) = a'(x)\).
Field-by-field Comparison
Field
Before
After
Front
<p>Why is a polynomial of degree \(d\) <strong>uniquely</strong> determined by \(d + 1\) values of \(a(x)\)?</p>
Back
<p>This \(a(x)\) is unique since if there was another \(a'(x)\) then \(a(x) - a'(x)\) would have at most degree \(d\) and thus at most \(d\) roots. But since \(a(x) - a'(x)\) has the same \(d + 1\) roots, it's \(0 \implies a(x) = a'(x)\).</p>
A polynomial \(a(x) \in F[x]\) of degree at most \(d\) is uniquely determined by:
By any \(d + 1\) values of \(a(x)\), i.e., by \(a(\alpha_1), \dots, a(\alpha_{d+1})\) for any distinct \(\alpha_1, \dots, \alpha_{d+1} \in F\).
This is the basis for polynomial interpolation.
Field-by-field Comparison
Field
Before
After
Front
<p>A polynomial \(a(x) \in F[x]\) of degree <strong>at most \(d\)</strong> is <strong>uniquely determined</strong> by:</p>
Back
<p>By any \(d + 1\) values of \(a(x)\), i.e., by \(a(\alpha_1), \dots, a(\alpha_{d+1})\) for any <strong>distinct</strong> \(\alpha_1, \dots, \alpha_{d+1} \in F\).</p>
<p>This is the basis for polynomial interpolation.</p>
Is \(\mathbb{N}\) well-ordered by \(\leq\)? What about \(\mathbb{Z}\)?
\(\mathbb{N}\): YES (every non-empty subset has a least element)
\(\mathbb{Z}\): NO (e.g., \(\mathbb{Z}\) itself has no least element)
Field-by-field Comparison
Field
Before
After
Front
Is \(\mathbb{N}\) well-ordered by \(\leq\)? What about \(\mathbb{Z}\)?
Back
<ul>
<li><strong>\(\mathbb{N}\)</strong>: YES (every non-empty subset has a least element)</li>
<li><strong>\(\mathbb{Z}\)</strong>: NO (e.g., \(\mathbb{Z}\) itself has no least element)</li>
</ul>
Group axiom G3 states that {{c1::every element \(a\) in \(G\) has an inverse element \(\widehat{a}\) such that \(a * \widehat{a} = \widehat{a} * a = e\)}}.
Group axiom G3 states that {{c1::every element \(a\) in \(G\) has an inverse element \(\widehat{a}\) such that \(a * \widehat{a} = \widehat{a} * a = e\)}}.
Field-by-field Comparison
Field
Before
After
Text
<p>Group axiom {{c2::<strong>G3</strong>}} states that {{c1::every element \(a\) in \(G\) has an inverse element \(\widehat{a}\) such that \(a * \widehat{a} = \widehat{a} * a = e\)}}.</p>
Give an example of a group homomorphism involving the logarithm function.
The logarithm function is a group homomorphism from \(\langle \mathbb{R}^{>0}; \cdot \rangle\) to \(\langle \mathbb{R}; + \rangle\) because: \[\log(a \cdot b) = \log a + \log b\]
It's also an isomorphism because the logarithm is bijective on positive reals.
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of a group homomorphism involving the logarithm function.</p>
Back
<p>The logarithm function is a group homomorphism from \(\langle \mathbb{R}^{>0}; \cdot \rangle\) to \(\langle \mathbb{R}; + \rangle\) because: \[\log(a \cdot b) = \log a + \log b\]</p>
<p>It's also an <strong>isomorphism</strong> because the logarithm is bijective on positive reals.</p>
How many equivalence classes does \(\equiv_m\) have, and what are they?
There are \(m\) equivalence classes: \([0], [1], \dots, [m-1]\).
The set \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) contains the canonical representative from each class.
Field-by-field Comparison
Field
Before
After
Front
How many equivalence classes does \(\equiv_m\) have, and what are they?
Back
There are \(m\) equivalence classes: \([0], [1], \dots, [m-1]\).
<br>
The set \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) contains the canonical representative from each class.
For any group \(G\), there exist two trivial subgroups:
- {{c2::The set \(\{e\}\) (containing only the neutral element)}}
- \(G\) itself
Field-by-field Comparison
Field
Before
After
Text
<!-- Card 38: Trivial Subgroups (Cloze) -->
<p>For any group \(G\), there exist two trivial subgroups:<br>
- {{c2::The set \(\{e\}\) (containing only the neutral element)}}<br>
- {{c3::\(G\) itself}}</p>
What happens when a formula in predicate logic has a free variable (no quantifier)?
The variable must be replaced by a specific constant from the universe for any interpretation. Without a quantifier, \(x\) is not bound and requires a concrete value.
Field-by-field Comparison
Field
Before
After
Front
What happens when a formula in predicate logic has a free variable (no quantifier)?
Back
The variable must be replaced by a <strong>specific constant</strong> from the universe for any interpretation. Without a quantifier, \(x\) is not bound and requires a concrete value.
If \(F\) is a formula in predicate logic, then for any \(i\):
\(\forall x_i F\)
\(\exists x_i F\)
are formulas.
Field-by-field Comparison
Field
Before
After
Text
If \(F\) is a formula in predicate logic, then for any \(i\):<br><ul><li>{{c1::\(\forall x_i F\)}}</li><li>{{c2::\(\exists x_i F\)}} </li></ul>are formulas.
Lemma 5.2: In a monoid \(\langle M; *, e \rangle\), if \(a \in M\) has a left inverse and a right inverse, then they are equal. In particular, \(a\) has at most one inverse.
Field-by-field Comparison
Field
Before
After
Front
<p>Lemma about uniqueness of the inverse:</p>
Back
<p><strong>Lemma 5.2</strong>: In a monoid \(\langle M; *, e \rangle\), if \(a \in M\) has a left inverse and a right inverse, then they are <strong>equal</strong>. In particular, \(a\) has <strong>at most one inverse</strong>.</p>
For \(a, b \in \mathbb{Z}\) (not both 0), there exist \(u, v \in \mathbb{Z}\) such that:
\[\text{gcd}(a, b) = ua + vb\]
The GCD can be expressed as an integer linear combination.
Field-by-field Comparison
Field
Before
After
Front
State Bézout's identity (Corollary 4.5).
Back
For \(a, b \in \mathbb{Z}\) (not both 0), there exist \(u, v \in \mathbb{Z}\) such that:
\[\text{gcd}(a, b) = ua + vb\]
The GCD can be expressed as an integer linear combination.
State Corollary 5.9 about the relationship between element order and group order for a finite group \(G\).
Corollary 5.9: For a finite group \(G\), the order of every element divides the group order, i.e., \(\text{ord}(a)\) divides \(|G|\) for every \(a \in G\).
Proof: \(\langle a \rangle\) is a subgroup of \(G\) of order \(\text{ord}(a)\), which by Lagrange's Theorem must divide \(|G|\).
Field-by-field Comparison
Field
Before
After
Front
<p>State Corollary 5.9 about the relationship between element order and group order for a finite group \(G\).</p>
Back
<p><strong>Corollary 5.9</strong>: For a finite group \(G\), the order of every element <strong>divides</strong> the group order, i.e., \(\text{ord}(a)\) divides \(|G|\) for every \(a \in G\).</p>
<p><strong>Proof</strong>: \(\langle a \rangle\) is a subgroup of \(G\) of order \(\text{ord}(a)\), which by Lagrange's Theorem must divide \(|G|\).</p>
When is a polynomial of degree \(2\) or \(3\) irreducible?
Corollary 5.30: A polynomial \(a(x)\) of degree \(2\) or \(3\) over a field \(F\) is irreducible if and only if it has no root.
Important: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.
Field-by-field Comparison
Field
Before
After
Front
<p>When is a polynomial of degree \(2\) or \(3\) irreducible?</p>
Back
<p><strong>Corollary 5.30</strong>: A polynomial \(a(x)\) of degree \(2\) or \(3\) over a field \(F\) is irreducible <strong>if and only if</strong> it has <strong>no root</strong>.</p>
<p><strong>Important</strong>: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.</p>
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is a lower (upper) bound of \(S\) if \(b \preceq a\) (\(b \succeq a) \) for all \(b \in S\)
Note that a is not necessarily in the subset S (difference to the least and greatest elements).
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).<div>\(a \in A\) is a {{c1::<b>lower (upper) bound</b> of \(S\)}} if {{c2::\(b \preceq a\) (\(b \succeq a) \) for all \(b \in S\)}}</div>
Extra
Note that a is not necessarily in the subset S (difference to the least and greatest elements).
If in a sound calculus \(K\) one can derive \(G\) from the set of formulas \(F\) (\(F \vdash_K G\)), then one has proved that \(F \rightarrow G\) is a tautology and thus that \(F \models G\).
If in a sound calculus \(K\) one can derive \(G\) from the set of formulas \(F\) (\(F \vdash_K G\)), then one has proved that \(F \rightarrow G\) is a tautology and thus that \(F \models G\).
Field-by-field Comparison
Field
Before
After
Text
If in a sound calculus \(K\) one can <i>derive</i> \(G\) from the set of formulas \(F\) (\(F \vdash_K G\)), then one has proved that {{c1::\(F \rightarrow G\) is a <i>tautology</i> and thus that \(F \models G\)}}.
For formulas \(F\) and \(H\), where \(x\) does not occur free in \(H\), we have: - \((\forall x \, F) \land H\) \( \equiv\) \( \forall x \, (F \land H)\) - \((\forall x \, F) \lor H \) \(\equiv\) \(\forall x \, (F \lor H)\) - \((\exists x \, F) \land H \) \(\equiv\) \(\exists x \, (F \land H)\) - \((\exists x \, F) \lor H\) \(\equiv\) \(\exists x \, (F \lor H)\)
For formulas \(F\) and \(H\), where \(x\) does not occur free in \(H\), we have: - \((\forall x \, F) \land H\) \( \equiv\) \( \forall x \, (F \land H)\) - \((\forall x \, F) \lor H \) \(\equiv\) \(\forall x \, (F \lor H)\) - \((\exists x \, F) \land H \) \(\equiv\) \(\exists x \, (F \land H)\) - \((\exists x \, F) \lor H\) \(\equiv\) \(\exists x \, (F \lor H)\)
Field-by-field Comparison
Field
Before
After
Text
For formulas \(F\) and \(H\), where \(x\) <b>does not occur free</b> in \(H\), we have:<br>- {{c1::\((\forall x \, F) \land H\)}} \( \equiv\) {{c2::\( \forall x \, (F \land H)\)}}<br>- {{c3::\((\forall x \, F) \lor H \)}} \(\equiv\) {{c4::\(\forall x \, (F \lor H)\)}}<br>- {{c5::\((\exists x \, F) \land H \)}} \(\equiv\) {{c6:: \(\exists x \, (F \land H)\)}}<br>- {{c7::\((\exists x \, F) \lor H\)}} \(\equiv\) {{c8:: \(\exists x \, (F \lor H)\)}}
For a subset \(T\) of \(B\), the {{c1::preimage (in Linalg: Urbild) of \(T\), denoted \(f^{-1}(T)\)}}, is the set of values in \(A\) that map into \(T\).
For a subset \(T\) of \(B\), the {{c1::preimage (in Linalg: Urbild) of \(T\), denoted \(f^{-1}(T)\)}}, is the set of values in \(A\) that map into \(T\).
Example: \(f(x) = x^2\), the preimage of \([4,9]\) is \([-3,-2] \cup [2,3]\)
Field-by-field Comparison
Field
Before
After
Text
For a subset \(T\) of \(B\), the {{c1::<b>preimage </b>(in Linalg: Urbild) of \(T\), denoted \(f^{-1}(T)\)}}, is {{c2::the set of values in \(A\) that map into \(T\).}}
Extra
Example: \(f(x) = x^2\), the preimage of \([4,9]\) is \([-3,-2] \cup [2,3]\)
As \(9^{10} \equiv_{11} 1\) (see Fermat little theorem and 11 prime), we can reduce the exponent modulo $10$ (see Lagrange's theorem in chapter 5). Thus \(R_{11}(9^{2024}) = R_{11}(9^{4}) = R_{11}(-2^{4}) = 5\).
For this to work however, we need the *number and the order of the group* (modulo remainder) to be coprime, i.e. \(\gcd(9, 11) = 1\).
If the modulus itself is prime then it always works and the order of the element can be used to reduce the exponent as \(9^{11-1} = 1\) by FLT.
Field-by-field Comparison
Field
Before
After
Front
Reduce \(R_{11}(9^{2024})\)
Back
As \(9^{10} \equiv_{11} 1\) (see Fermat little theorem and 11 prime), we can reduce the exponent modulo $10$ (see Lagrange's theorem in chapter 5). Thus \(R_{11}(9^{2024}) = R_{11}(9^{4}) = R_{11}(-2^{4}) = 5\).<br><br>For this to work however, we need the *number and the order of the group* (modulo remainder) to be <i>coprime</i>, i.e. \(\gcd(9, 11) = 1\).<div>If the modulus itself is prime then it always works and the order of the element can be used to reduce the exponent as \(9^{11-1} = 1\) by FLT.</div>
Yes, there exist uncomputable functions \(\mathbb{N} \to \{0, 1\}\).
Proof idea: Programs are finite bitstrings (\(\{0,1\}^*\) is countable), but functions \(\mathbb{N} \to \{0,1\}\) are uncountable.
Field-by-field Comparison
Field
Before
After
Front
Do uncomputable functions exist?
Back
Yes, there exist <strong>uncomputable</strong> functions \(\mathbb{N} \to \{0, 1\}\).
<br>
<strong>Proof idea</strong>: Programs are finite bitstrings (\(\{0,1\}^*\) is countable), but functions \(\mathbb{N} \to \{0,1\}\) are uncountable.
Sketch step-by-step how Cantor's diagonalization argument can be used to prove that the set \(\{0,1\}^\infty\) is uncountable.
Proof by contradiction: Assume a bijection to \(\mathbb{N}\) exists.
That means there exists for each \(n\in \mathbb{N}\) a corresponding sequence of 0 and 1s, and vice-versa.
We now construct a new sequence \(\alpha\) of 0s and 1s, by always taking the \(i\)-th bit from the \(i\)-th sequence, and inverting it.
This new sequence does not agree with every existing sequence in at least one place.
However, there is no \(n\in\mathbb{N}\) such that \(\alpha = f(n)\) since \(\alpha\) disagrees with every \(f(n)\) in at least one place.
Thus, no bijection to \(\mathbb{N}\) exists, which means \(\{0,1\}^\infty\) is uncountable.
Field-by-field Comparison
Field
Before
After
Front
Sketch step-by-step how <b>Cantor's diagonalization argument</b> can be used to prove that the set \(\{0,1\}^\infty\) is uncountable.
Back
<ul><li>Proof by contradiction: Assume a bijection to \(\mathbb{N}\) exists.</li><li>That means there exists for each \(n\in \mathbb{N}\) a corresponding sequence of 0 and 1s, and vice-versa.</li><li>We now construct a new sequence \(\alpha\) of 0s and 1s, by always taking the \(i\)-th bit from the \(i\)-th sequence, and inverting it.</li><li>This new sequence does not agree with every existing sequence in at least one place.</li><li>However, there is no \(n\in\mathbb{N}\) such that \(\alpha = f(n)\) since \(\alpha\) disagrees with every \(f(n)\) in at least one place.</li><li>Thus, no bijection to \(\mathbb{N}\) exists, which means \(\{0,1\}^\infty\) is uncountable.</li></ul>
YES! Quantifier order matters for nestedvariables.
\(\exists x \forall y P(x, y)\) is NOT equivalent to \(\forall y \exists x P(x, y)\)!
Example: \(\exists x \forall y (x < y)\) means "there exists a smallest element", while \(\forall y \exists x (x < y)\) means "for every element, there exists a smaller one".
Field-by-field Comparison
Field
Before
After
Front
Does quantifier order matter?
Back
<b>YES!</b> Quantifier order matters for <b>nested</b> <b>variables</b>.<br><br>\(\exists x \forall y P(x, y)\) is <b>NOT</b> equivalent to \(\forall y \exists x P(x, y)\)!<br><br>Example: \(\exists x \forall y (x < y)\) means "there exists a smallest element", while \(\forall y \exists x (x < y)\) means "for every element, there exists a smaller one".
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is a minimal (maximal) element of \(A\) if there exists no \(b \in A\) with \(b \prec a\) (\(b \succ a \) )
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).<div>\(a \in A\) is a {{c1::<b>minimal (maximal) element</b> of \(A\)}} if {{c2::there exists no \(b \in A\) with \(b \prec a\) (\(b \succ a \) )}}<br></div>
If a set of \(n\) objects is partitioned into \(k < n\) sets, then at least one of those sets contains at least \(\lceil \frac{n}{k} \rceil\) objects.
(If you have more pigeons than holes, at least one hole must contain multiple pigeons)
Field-by-field Comparison
Field
Before
After
Front
What is the Pigeonhole Principle?
Back
If a set of \(n\) objects is partitioned into \(k < n\) sets, then at least one of those sets contains at least \(\lceil \frac{n}{k} \rceil\) objects.
<br>
(If you have more pigeons than holes, at least one hole must contain multiple pigeons)
Is the projection of points from \(\mathbb{R}^3\) to \(\mathbb{R}^2\) a homomorphism? Is it an isomorphism?
The projection is a homomorphism (it preserves the group operation of vector addition).
However, it is not an isomorphism because it's not a bijection (not injective - many 3D points project to the same 2D point).
Field-by-field Comparison
Field
Before
After
Front
<p>Is the projection of points from \(\mathbb{R}^3\) to \(\mathbb{R}^2\) a homomorphism? Is it an isomorphism?</p>
Back
<p>The projection is a <strong>homomorphism</strong> (it preserves the group operation of vector addition).</p>
<p>However, it is <strong>not an isomorphism</strong> because it's not a bijection (not injective - many 3D points project to the same 2D point).</p>
State Fermat's Little Theorem (Corollary 5.14) (both totient and prime):
Corollary 5.14 (Fermat's Little Theorem): For all \(m \geq 2\) and all \(a\) with \(\gcd(a, m) = 1\): \[a^{\varphi(m)} \equiv_m 1\]
In particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \[a^{p-1} \equiv_p 1\]
Proof: This follows from Corollary 5.10 (\(a^{|G|} = e\)) since the order of \(\mathbb{Z}_m^*\) is \[a^{p-1} \equiv_p 1\]0 (and \[a^{p-1} \equiv_p 1\]1 for prime \[a^{p-1} \equiv_p 1\]2).
Field-by-field Comparison
Field
Before
After
Front
<p>State Fermat's Little Theorem (Corollary 5.14) (both totient and prime):</p>
Back
<p><strong>Corollary 5.14 (Fermat's Little Theorem)</strong>: For all \(m \geq 2\) and all \(a\) with \(\gcd(a, m) = 1\): \[a^{\varphi(m)} \equiv_m 1\]</p>
<p>In particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \[a^{p-1} \equiv_p 1\]</p>
<p><strong>Proof</strong>: This follows from Corollary 5.10 (\(a^{|G|} = e\)) since the order of \(\mathbb{Z}_m^*\) is \[a^{p-1} \equiv_p 1\]0 (and \[a^{p-1} \equiv_p 1\]1 for prime \[a^{p-1} \equiv_p 1\]2).</p>
In a poset \( ( A; \preceq )\), \(b\) covers \(a\) if \(a \prec b\) and there does not exist a \(c\) with \(a \prec c \land c \prec b \), so no elements are between \(a\) and \(b\).
In a poset \( ( A; \preceq )\), \(b\) covers \(a\) if \(a \prec b\) and there does not exist a \(c\) with \(a \prec c \land c \prec b \), so no elements are between \(a\) and \(b\).
Example: direct superior in a company
Field-by-field Comparison
Field
Before
After
Text
In a poset \( ( A; \preceq )\), \(b\) <b>covers</b> \(a\) if {{c1::\(a \prec b\) and there does not exist a \(c\) with \(a \prec c \land c \prec b \), so no elements are between \(a\) and \(b\).}}
If one replaces a sub-formula \(G\) of a formula \(F\) by an equivalent (to \(G\)) formula \(H\), then the resulting formula is equivalent to \(F\).
Field-by-field Comparison
Field
Before
After
Text
If one replaces a sub-formula \(G\) of a formula \(F\) by an equivalent (to \(G\)) formula \(H\), then {{c2::the resulting formula is equivalent to \(F\)}}.
The syntax defines: 1. An alphabet \(\Lambda\) of allowed symbols 2. Which strings in \(\Lambda^*\) are valid formulas (syntactically correct)
Field-by-field Comparison
Field
Before
After
Front
What does the syntax of a logic define?
Back
The syntax defines:<br>1. An alphabet \(\Lambda\) of allowed symbols<br>2. Which strings in \(\Lambda^*\) are valid formulas (syntactically correct)
The equation \(ax \equiv_m 1\) has a unique solution \(x \in \mathbb{Z}_m\) if and only if \(\gcd(a,m) = 1\). This \(x\) is then called the multiplicative inverse of \(a \mod m\).
The equation \(ax \equiv_m 1\) has a unique solution \(x \in \mathbb{Z}_m\) if and only if \(\gcd(a,m) = 1\). This \(x\) is then called the multiplicative inverse of \(a \mod m\).
Field-by-field Comparison
Field
Before
After
Text
The equation \(ax \equiv_m 1\) has a unique solution \(x \in \mathbb{Z}_m\) if and only if {{c1::\(\gcd(a,m) = 1\).}} This \(x\) is then called the {{c2::multiplicative inverse of \(a \mod m\)}}.
The set of clauses associated with a formula \[F = (L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\] in CNF, denoted as {{c1::\(\mathcal{K}(F)\)}}, is the set {{c2::\[\mathcal{K}(F) = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
The set of clauses associated with a formula \[F = (L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\] in CNF, denoted as {{c1::\(\mathcal{K}(F)\)}}, is the set {{c2::\[\mathcal{K}(F) = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
Field-by-field Comparison
Field
Before
After
Text
The set of clauses associated with a formula \[F = (L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\] in CNF, denoted as {{c1::\(\mathcal{K}(F)\)}}, is the set {{c2::\[\mathcal{K}(F) = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
The idea of Universal Instantiation is that if a statement is true for all elements, it is also true for a particular element, so \(\forall x F \models F[x/t]\).
The idea of Universal Instantiation is that if a statement is true for all elements, it is also true for a particular element, so \(\forall x F \models F[x/t]\).
Example: All elements in \(\mathbb{R}\) are invertible. Thus, 2 is also invertible.
Field-by-field Comparison
Field
Before
After
Text
The idea of {{c2::Universal Instantiation}} is that {{c1::if a statement is true for all elements, it is also true for a particular element, so \(\forall x F \models F[x/t]\).}}
Extra
Example: All elements in \(\mathbb{R}\) are invertible. Thus, 2 is also invertible.
Which elements generate \(\mathbb{Z}_n\)? Also proof
\(\mathbb{Z}_n\) is generated by all \(a \in \mathbb{Z}_n\) for which \(\gcd(n, a) = 1\) (all elements coprime to \(n\)).
Proof idea:
- If \(\mathbb{Z}_n = \langle a \rangle\), then \(1 \in \langle a \rangle\)
- This means \(au \equiv_n 1\) for some \(u\)
- By Bézout's identity, this implies \(\gcd(a, n) = 1\)
Field-by-field Comparison
Field
Before
After
Front
<p>Which elements generate \(\mathbb{Z}_n\)? Also proof</p>
Back
<p>\(\mathbb{Z}_n\) is generated by <strong>all \(a \in \mathbb{Z}_n\) for which \(\gcd(n, a) = 1\)</strong> (all elements coprime to \(n\)).</p>
<p><strong>Proof idea</strong>:<br>
- If \(\mathbb{Z}_n = \langle a \rangle\), then \(1 \in \langle a \rangle\)<br>
- This means \(au \equiv_n 1\) for some \(u\)<br>
- By Bézout's identity, this implies \(\gcd(a, n) = 1\)</p>
Group axiom G1 states that the operation \(*\) is associative: \(a * (b * c) = (a * b) * c\) for all \(a, b, c\) in \(G\).
Field-by-field Comparison
Field
Before
After
Text
<p>Group axiom <strong>G1</strong> states that the operation \(*\) is {{c1::associative}}: {{c2::\(a * (b * c) = (a * b) * c\)}} for all \(a, b, c\) in \(G\).</p>
Two codewords in a polynomial code with degree \(k-1\) cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.
Two codewords in a polynomial code with degree \(k-1\) cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.
Field-by-field Comparison
Field
Before
After
Text
<p>Two codewords in a <em>polynomial code</em> with degree \(k-1\) cannot agree at {{c1:: \(k\) positions (else they'd be equal)}}, so they disagree in {{c2:: at least \(n - k + 1\) positions}}.</p>
If we want to use roots to check that a polynomial is irreducible, it has to have?
Degree \(2\) or \(3\).
Important: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.
Field-by-field Comparison
Field
Before
After
Front
<p>If we want to use roots to check that a polynomial is irreducible, it has to have?</p>
Back
<p>Degree \(2\) or \(3\).</p>
<p><strong>Important</strong>: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.</p>
\[A / \theta \overset{\text{def}}{=} \{[a]_{\theta} \ | \ a \in A\}\]
The set of all equivalence classes of \(\theta\) on \(A\) (also called "\(A\) modulo \(\theta\)" or "\(A\) mod \(\theta\)").
Field-by-field Comparison
Field
Before
After
Front
What is the quotient set \(A / \theta\)?
Back
\[A / \theta \overset{\text{def}}{=} \{[a]_{\theta} \ | \ a \in A\}\]
The set of all equivalence classes of \(\theta\) on \(A\) (also called "\(A\) modulo \(\theta\)" or "\(A\) mod \(\theta\)").
For \(a, b\) in a commutative ring \(R\), we say that \(a\) divides \(b\), denoted \(a \ | \ b\), if there exists a \(c \in R\) such that \(b = ac\).
Field-by-field Comparison
Field
Before
After
Text
<p>For \(a, b\) in a <strong>commutative</strong> ring \(R\), we say that {{c1::\(a\) divides \(b\), denoted \(a \ | \ b\)}}, if {{c2:: there exists a \(c \in R\) such that \(b = ac\)}}.</p>
The set of clauses associated with a set \(M = \{F_1, \dots, F_k\}\) of formulas is {{c1::\[\mathcal{K}(M) = \bigcup_{i=1}^k \mathcal{K}(F_i)\]}} (the union of their clause sets).
The set of clauses associated with a set \(M = \{F_1, \dots, F_k\}\) of formulas is {{c1::\[\mathcal{K}(M) = \bigcup_{i=1}^k \mathcal{K}(F_i)\]}} (the union of their clause sets).
Field-by-field Comparison
Field
Before
After
Text
The set of clauses associated with a set \(M = \{F_1, \dots, F_k\}\) of formulas is {{c1::\[\mathcal{K}(M) = \bigcup_{i=1}^k \mathcal{K}(F_i)\]}} (the {{c2::union of their clause sets}}).
The following three statements are equivalent: 1. {{c1::\(\{F_1, \dots, F_k\} \models G\)}} 2. \((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology 3. {{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.
The following three statements are equivalent: 1. {{c1::\(\{F_1, \dots, F_k\} \models G\)}} 2. \((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology 3. {{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.
This is important for resolution calculus!
Field-by-field Comparison
Field
Before
After
Text
The following three statements are equivalent:<br>1. {{c1::\(\{F_1, \dots, F_k\} \models G\)}}<br>2. {{c2::\((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology}}<br>3. {{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.
A formula in propositional logic is defined recursively: - An atomic formula is a formula - If \(F\) and \(G\) are formulas, then also \(\lnot F\), \(F \lor G\), \(F \land G\).
A formula in propositional logic is defined recursively: - An atomic formula is a formula - If \(F\) and \(G\) are formulas, then also \(\lnot F\), \(F \lor G\), \(F \land G\).
Field-by-field Comparison
Field
Before
After
Text
A formula in propositional logic is defined recursively:<br>- {{c2::An atomic formula is a formula}}<br>- If \(F\) and \(G\) are formulas, then also {{c3::\(\lnot F\), \(F \lor G\), \(F \land G\)}}.
How can we test if a relation is transitive using composition?
A relation \(\rho\) is transitive if and only if \(\rho^2 \subseteq \rho\).
(If all two-step paths are already direct edges, the relation is transitive)
Field-by-field Comparison
Field
Before
After
Front
How can we test if a relation is transitive using composition?
Back
A relation \(\rho\) is transitive <strong>if and only if</strong> \(\rho^2 \subseteq \rho\).
<br>
(If all two-step paths are already direct edges, the relation is transitive)
Which of the following are fields: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5, \mathbb{Z}_6, R[x]\)?
Fields: \(\mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5\) (where \(5\) is prime)
Not fields:
- \(\mathbb{Z}\) (not all nonzero elements have multiplicative inverse, e.g., \(2\))
- \(\mathbb{Z}_6\) (since \(6\) is not prime, e.g., \(2\) has no inverse)
- \(R[x]\) for any ring \(R\) (polynomials don't have multiplicative inverses)
Field-by-field Comparison
Field
Before
After
Front
<p>Which of the following are fields: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5, \mathbb{Z}_6, R[x]\)?</p>
Back
<p><strong>Fields</strong>: \(\mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5\) (where \(5\) is prime)</p>
<p><strong>Not fields</strong>:<br>
- \(\mathbb{Z}\) (not all nonzero elements have multiplicative inverse, e.g., \(2\))<br>
- \(\mathbb{Z}_6\) (since \(6\) is not prime, e.g., \(2\) has no inverse)<br>
- \(R[x]\) for any ring \(R\) (polynomials don't have multiplicative inverses)</p>
The semantics of a logic defines a function \(free\) which {{c2::assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \(free(F) \subseteq \{1, \dots, k\}\) of the indices}}.
The semantics of a logic defines a function \(free\) which {{c2::assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \(free(F) \subseteq \{1, \dots, k\}\) of the indices}}.
If \(i \in free(F)\), then the symbol is said to occur free in \(F\).
Field-by-field Comparison
Field
Before
After
Text
The {{c3::<i>semantics</i>}} of a logic defines a function {{c1::\(free\)}} which {{c2::assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \(free(F) \subseteq \{1, \dots, k\}\) of the indices}}.
Extra
If \(i \in free(F)\), then the symbol is said to occur <i>free</i> in \(F\).
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
Field-by-field Comparison
Field
Before
After
Text
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a {{c2::greatest lower bound}}, then it is called the {{c1::<b>meet </b>of \(a\) and \(b\) (also denoted \(a \land b\)).}}<br>
To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:
- G1 (associativity)
- G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).
- G3 (inverse) G3' -> you only need to prove the existence of a right inverse
To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:
- G1 (associativity)
- G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).
- G3 (inverse) G3' -> you only need to prove the existence of a right inverse
Field-by-field Comparison
Field
Before
After
Text
<p>To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:<br>
- {{c2::G1 (associativity)}}<br>
- {{c3::G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).}}<br>
- {{c4::G3 (inverse) G3' -> you only need to prove the existence of a right inverse}}</p>
What exponentiation operation is valid in modular arithmetic?
I can do:
\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)
What is illegal is:
\(a \equiv_n b\) and \(c \equiv_n d\) and then doing \(a^c \equiv_n b^d\)
Field-by-field Comparison
Field
Before
After
Front
What exponentiation operation is valid in modular arithmetic?
Back
I can do:<br><ul><li>\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)<br></li></ul><div>What is illegal is:</div><div><ul><li>\(a \equiv_n b\) and \(c \equiv_n d\) and then doing \(a^c \equiv_n b^d\)</li></ul></div>
rectify the formula (rename all bound occurrences clashing with free variables)
equivalences in Lemma 6.7 to move up all quantifiers in the tree
Field-by-field Comparison
Field
Before
After
Text
Transform a formula to <b>prenex</b> form:<br><ol><li>{{c1::<b>rectify</b> the formula (rename all bound occurrences clashing with free variables)}}</li><li>{{c2::equivalences in Lemma 6.7 to <b>move up all quantifiers</b> in the tree}}</li></ol>
A function \(f:\mathbb{N}\to\{0,1\}\) is called computable if {{c1::there is a computer program that, for every \(n\in\mathbb{N}\), when given \(n\) as input, outputs \(f(n)\).}}
A function \(f:\mathbb{N}\to\{0,1\}\) is called computable if {{c1::there is a computer program that, for every \(n\in\mathbb{N}\), when given \(n\) as input, outputs \(f(n)\).}}
Field-by-field Comparison
Field
Before
After
Text
A function \(f:\mathbb{N}\to\{0,1\}\) is called <b>computable</b> if {{c1::there is a computer program that, for every \(n\in\mathbb{N}\), when given \(n\) as input, outputs \(f(n)\).}}
What are the two trivial equivalence relations on a set \(A\)?
1. Complete relation \(A \times A\) → single equivalence class \(A\) 2. {{c2:: Identity relation → equivalence classes are all singletons \(\{a\}\)}}
Field-by-field Comparison
Field
Before
After
Text
What are the two trivial equivalence relations on a set \(A\)?<br><br>1. {{c1:: <strong>Complete relation</strong> \(A \times A\) → single equivalence class \(A\)}}<br>2. {{c2:: <strong>Identity relation</strong> → equivalence classes are all singletons \(\{a\}\)}}
A formula F (propositional logic) is a tautology/valid if it is true for all truth combinations of the involved symbols, so if it is always true. Symbol: \( \top \)
Field-by-field Comparison
Field
Before
After
Front
What is a tautology?
Back
A formula F (propositional logic) is a tautology/valid if it is true for all truth combinations of the involved symbols, so if it is always true. Symbol: \( \top \)
Why is Lemma 6.3 (the equivalence between \(F \models G\) and unsatisfiability of \(\{F, \lnot G\}\)) important for the resolution calculus?
The fact that \(F \models G\) is equivalent to \(\{F, \lnot G\}\) being unsatisfiable makes the resolution calculus powerful enough to also show implications, not just unsatisfiability.
Field-by-field Comparison
Field
Before
After
Front
Why is Lemma 6.3 (the equivalence between \(F \models G\) and unsatisfiability of \(\{F, \lnot G\}\)) important for the resolution calculus?
Back
The fact that \(F \models G\) is equivalent to \(\{F, \lnot G\}\) being unsatisfiable makes the resolution calculus powerful enough to also show implications, not just unsatisfiability.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \dots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \dots \times G_n; \star \rangle\) where the operation \(\star\) is component-wise.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \dots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \dots \times G_n; \star \rangle\) where the operation \(\star\) is component-wise.
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::direct product}} of \(n\) groups \(\langle G_1; *_1 \rangle, \dots, \langle G_n; *_n \rangle\) is the algebra {{c2::\(\langle G_1 \times \dots \times G_n; \star \rangle\)}} where the operation \(\star\) is {{c3::component-wise}}.</p>
For a formula \(G\) in which \(y\) does not occur, we have:
\(\forall x G\)\(\equiv\)\(\forall y G[x/y]\)
\(\exists x G\)\(\equiv\)\(\exists y G[x/y]\)
Field-by-field Comparison
Field
Before
After
Text
For a formula \(G\) in which \(y\) does not occur, we have:<br><ul><li>{{c1::\(\forall x G\)}}\(\equiv\){{c2::\(\forall y G[x/y]\)}}</li><li>{{c3::\(\exists x G\)}}\(\equiv\){{c4::\(\exists y G[x/y]\)}}</li></ul>
\(F \models \emptyset\) means that \(F\) is unsatisfiable, as the empty set cannot be made true under any interpretation (it has no literals to set to true).
Field-by-field Comparison
Field
Before
After
Front
What does \(F \models \emptyset\) mean?
Back
\(F \models \emptyset\) means that \(F\) is <b>unsatisfiable</b>, as the empty set cannot be made true under any interpretation (it has no literals to set to true).
How can you check if a polynomial of degree \(d\) is irreducible?
To check if a polynomial of degree \(d\) is irreducible, check all monic irreducible polynomials of degree \(\leq d/2\) as possible divisors.
Why \(d/2\)? If \(a(x) = b(x) \cdot c(x)\) where \(b\) and \(c\) are non-constant, then \(\deg(b) + \deg(c) = \deg(a) = d\). So at least one of \(b\) or \(c\) has degree \(\leq d/2\).
Field-by-field Comparison
Field
Before
After
Front
<p>How can you check if a polynomial of degree \(d\) is irreducible?</p>
Back
<p>To check if a polynomial of degree \(d\) is irreducible, check all <strong>monic irreducible</strong> polynomials of degree \(\leq d/2\) as possible divisors.</p>
<p><strong>Why \(d/2\)?</strong> If \(a(x) = b(x) \cdot c(x)\) where \(b\) and \(c\) are non-constant, then \(\deg(b) + \deg(c) = \deg(a) = d\). So at least one of \(b\) or \(c\) has degree \(\leq d/2\).</p>
A proof of \(S\) by case distinction has three steps:
Find a finite list \(R_1,\ldots,R_k\) of mathematical statements, the cases.
Prove that at least one of the \(R_i\) is true (at least one case occurs).
Prove \(R_i \implies S\) for \(i = 1,\ldots,k\).
Field-by-field Comparison
Field
Before
After
Text
A proof of \(S\) by <i>case distinction</i> has three steps:<br><ol><li>{{c1::Find a finite list \(R_1,\ldots,R_k\) of mathematical statements, the cases.}}<br></li><li>{{c2::Prove that at least one of the \(R_i\) is true (at least one case occurs).}}<br></li><li>{{c3::Prove \(R_i \implies S\) for \(i = 1,\ldots,k\).}}<br></li></ol>
What are the three ways to represent a relation on finite sets?
1. Set notation (subset of \(A \times B\)) 2. Boolean matrix (1 if \((a,b) \in \rho\), 0 otherwise) 3. Directed graph (nodes are elements, edges are relations)
Field-by-field Comparison
Field
Before
After
Text
What are the three ways to represent a relation on finite sets?<br><br>1. {{c1:: <strong>Set notation</strong> (subset of \(A \times B\))}}<br>2. {{c2:: <strong>Boolean matrix</strong> (1 if \((a,b) \in \rho\), 0 otherwise)}}<br>3. {{c3:: <strong>Directed graph</strong> (nodes are elements, edges are relations)}}
State Lemma 5.18 about the units of a ring and the property they satisfy?
Lemma 5.18: For a ring \(R\), \(R^*\) is a group (the multiplicative group of units of \(R\)).
Proof idea: Every element of \(R^*\) has an inverse by definition, so axiom G3 holds. The other group axioms (associativity, neutral element) are inherited from the ring.
Field-by-field Comparison
Field
Before
After
Front
<p>State Lemma 5.18 about the units of a ring and the property they satisfy?</p>
Back
<p><strong>Lemma 5.18</strong>: For a ring \(R\), \(R^*\) is a <strong>group</strong> (the multiplicative group of units of \(R\)).</p>
<p><strong>Proof idea</strong>: Every element of \(R^*\) has an inverse by definition, so axiom <strong>G3</strong> holds. The other group axioms (associativity, neutral element) are inherited from the ring.</p>
An axiom \(A\) is a statement taken as true in a theory. Theorems are the statements which follow from these axioms (\(A \models T\)).
Field-by-field Comparison
Field
Before
After
Text
An {{c1::<i>axiom</i> \(A\)}} is a {{c2::statement taken as true in a theory}}. {{c3::<i>Theorems</i>}} are the statements which {{c4::follow from these axioms}} (\(A \models T\)).
A field (Körper) is {{c2::a nontrivial commutative ring \(F\) in which every nonzero element is a unit, so \(F^* = F \backslash \{0\}\)}}
Example: \(\mathbb{R}\), but not \(\mathbb{Z}\)
Field-by-field Comparison
Field
Before
After
Text
A {{c1::field (<i>Körper</i>)}} is {{c2::a nontrivial commutative ring \(F\) in which every nonzero element is a unit, so \(F^* = F \backslash \{0\}\)}}
Extra
Example: \(\mathbb{R}\), but not \(\mathbb{Z}\)
A k-ary predicate on \( U \) is a function \( U^k \rightarrow \{0,1\}\).
It's like a function that takes any number of arguments, but only returns boolean results.
Field-by-field Comparison
Field
Before
After
Front
What is a predicate?
Back
A k-ary predicate on \( U \) is a function \( U^k \rightarrow \{0,1\}\).<div>It's like a function that takes any number of arguments, but only returns boolean results.</div>
State Theorem 5.31 about the number of roots a polynomial can have.
Theorem 5.31: For a field \(F\), a nonzero polynomial \(a(x) \in F[x]\) of degree \(d\) has at most \(d\) roots.
Field-by-field Comparison
Field
Before
After
Front
<p>State Theorem 5.31 about the number of roots a polynomial can have.</p>
Back
<p><strong>Theorem 5.31</strong>: For a field \(F\), a nonzero polynomial \(a(x) \in F[x]\) of degree \(d\) has <strong>at most \(d\) roots</strong>.</p>
What is a cyclic group of order \(n\) isomorphic to?
Theorem 5.7: A cyclic group of order \(n\) is isomorphic to \(\langle \mathbb{Z}_n; \oplus \rangle\) (and hence abelian).
This means all cyclic groups of the same order have the same structure.
Field-by-field Comparison
Field
Before
After
Front
<p>What is a cyclic group of order \(n\) isomorphic to?</p>
Back
<p><strong>Theorem 5.7</strong>: A cyclic group of order \(n\) is <strong>isomorphic</strong> to \(\langle \mathbb{Z}_n; \oplus \rangle\) (and hence <strong>abelian</strong>).</p>
<p>This means all cyclic groups of the same order have the same structure.</p>
Can the same variable occur both bound and free in a formula?
YES! The same variable can occur both bound in one place and free in another.
We can then replace all occurrences of the bound variable with another letter without changing the meaning.
Field-by-field Comparison
Field
Before
After
Front
Can the same variable occur both bound and free in a formula?
Back
<b>YES!</b> The same variable can occur both bound in one place and free in another.<br><br>We can then replace all occurrences of the bound variable with another letter without changing the meaning.
Give the formal definition of "\(a\) divides \(b\)" (denoted \(a | b\)).
\[a | b \overset{\text{def}}{\Longleftrightarrow} \exists c \in \mathbb{Z} \ b = ac\]
\(a\) is a divisor of \(b\), \(b\) is a multiple of \(a\), and \(c\) is the quotient.
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of "\(a\) divides \(b\)" (denoted \(a | b\)).
Back
\[a | b \overset{\text{def}}{\Longleftrightarrow} \exists c \in \mathbb{Z} \ b = ac\]
\(a\) is a divisor of \(b\), \(b\) is a multiple of \(a\), and \(c\) is the quotient.
Explanation: The characteristic is the order of \(1\) in the additive group. In \(\mathbb{Z}_m\), adding \(1\) to itself \(m\) times gives: \[\underbrace{1 + 1 + \cdots + 1}_{m \text{ times}} = m \equiv_m 0\]
So \(\text{ord}(1) = m\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is the characteristic of \(\mathbb{Z}_m\)?</p>
Back
<p>The characteristic of \(\mathbb{Z}_m\) is <strong>\(m\)</strong>.</p>
<p><strong>Explanation</strong>: The characteristic is the order of \(1\) in the additive group. In \(\mathbb{Z}_m\), adding \(1\) to itself \(m\) times gives: \[\underbrace{1 + 1 + \cdots + 1}_{m \text{ times}} = m \equiv_m 0\]</p>
<p>So \(\text{ord}(1) = m\).</p>
A relation \(\rho\) from a set \(A\) to a set \(B\) (also called an \((A,B)\)-relation) is a subset of \(A\times B\). If \(A = B\), then \(\rho\) is called a relation on \(A\).
A relation \(\rho\) from a set \(A\) to a set \(B\) (also called an \((A,B)\)-relation) is a subset of \(A\times B\). If \(A = B\), then \(\rho\) is called a relation on \(A\).
Field-by-field Comparison
Field
Before
After
Text
A <b>relation </b>\(\rho\) from a set \(A\) to a set \(B\) (also called an \((A,B)\)-relation) is {{c1::a subset of \(A\times B\).}} If \(A = B\), then \(\rho\) is called {{c1::a <i>relation on</i> \(A\).}}
What shortcut exists for testing whether \(n\) is prime? (Lemma 4.12)
Every composite integer \(n\) has a prime divisor \(\leq \sqrt{n}\).
Therefore, to test if \(n\) is prime, we only need to check divisibility by primes up to \(\sqrt{n}\).
Field-by-field Comparison
Field
Before
After
Front
What shortcut exists for testing whether \(n\) is prime? (Lemma 4.12)
Back
Every composite integer \(n\) has a prime divisor \(\leq \sqrt{n}\).
<br>
Therefore, to test if \(n\) is prime, we only need to check divisibility by primes up to \(\sqrt{n}\).
For a set \(Z\) of atomic formulas, a {{c1::truth assignment \(\mathcal{A}\)}} is {{c2::a function \(\mathcal{A}: Z \rightarrow \{0, 1\}\)}}.
A truth assignment \(\mathcal{A}\) is suitable for a formula \(F\) if it contains all atomic formulas appearing in \(F\).
Field-by-field Comparison
Field
Before
After
Text
For a set \(Z\) of atomic formulas, a {{c1::<i>truth assignment</i> \(\mathcal{A}\)}} is {{c2::a function \(\mathcal{A}: Z \rightarrow \{0, 1\}\)}}.
Extra
A truth assignment \(\mathcal{A}\) is suitable for a formula \(F\) if it contains all atomic formulas appearing in \(F\).
If a theorem follows from the empty set of axioms \(\emptyset\), then it's a tautology. This means that it's a theorem in any theory!
Field-by-field Comparison
Field
Before
After
Text
If a theorem follows from the {{c1::empty set}} of axioms \(\emptyset\), then it's a {{c2::<i>tautology</i>}}. This means that {{c3::it's a theorem in any theory!}}
For a formula \(F\), a variable \(x\) and a term \(t\), \(F[x/t]\) denotes the formula obtained from \(F\) by substituting every free occurrence of \(x\) by \(t\).
For a formula \(F\), a variable \(x\) and a term \(t\), \(F[x/t]\) denotes the formula obtained from \(F\) by substituting every free occurrence of \(x\) by \(t\).
Field-by-field Comparison
Field
Before
After
Text
For a formula \(F\), {{c1::a variable \(x\) and a term \(t\), \(F[x/t]\)}} denotes {{c2::the formula obtained from \(F\) by substituting every free occurrence of \(x\) by \(t\)}}.
How does an indirect proof of \(S \Rightarrow T\) work?
An indirect proof assumes that \(T\) is false and proves that \(S\) is false under this assumption. This works because \(\lnot B \rightarrow \lnot A \models A \rightarrow B\).
Field-by-field Comparison
Field
Before
After
Front
How does an indirect proof of \(S \Rightarrow T\) work?
Back
An indirect proof assumes that \(T\) is <strong>false</strong> and proves that \(S\) is <strong>false</strong> under this assumption. This works because \(\lnot B \rightarrow \lnot A \models A \rightarrow B\).
What is the relationship between \(\sigma(F, \mathcal{A})\) and \(\mathcal{A}(F)\)?
They are the same! In logic, one often writes \(\mathcal{A}(F)\) instead of \(\sigma(F, \mathcal{A})\) and calls \(\mathcal{A}(F)\) the truth value of \(F\) under interpretation \(\mathcal{A}\).
Field-by-field Comparison
Field
Before
After
Front
What is the relationship between \(\sigma(F, \mathcal{A})\) and \(\mathcal{A}(F)\)?
Back
They are the same! In logic, one often writes \(\mathcal{A}(F)\) instead of \(\sigma(F, \mathcal{A})\) and calls \(\mathcal{A}(F)\) the <i>truth value of \(F\) under interpretation \(\mathcal{A}\)</i>.
What are the units of \(\mathbb{Z}\) and \(\mathbb{R}\)?
Units of \(\mathbb{Z}\): \(\mathbb{Z}^* = \{-1, 1\}\) (only elements with multiplicative inverse in \(\mathbb{Z}\))
Units of \(\mathbb{R}\): \(\mathbb{R}^* = \mathbb{R} \setminus \{0\}\) (all non-zero reals have multiplicative inverse)
Field-by-field Comparison
Field
Before
After
Front
<p>What are the units of \(\mathbb{Z}\) and \(\mathbb{R}\)?</p>
Back
<ul>
<li><strong>Units of \(\mathbb{Z}\)</strong>: \(\mathbb{Z}^* = \{-1, 1\}\) (only elements with multiplicative inverse in \(\mathbb{Z}\))</li>
<li><strong>Units of \(\mathbb{R}\)</strong>: \(\mathbb{R}^* = \mathbb{R} \setminus \{0\}\) (all non-zero reals have multiplicative inverse)</li>
</ul>
A group \(G = \langle g \rangle\) generated by an element \(g \in G\) is called cyclic, and \(g\) is called a generator of \(G\).
Examples: \(\langle \mathbb{Z}_n;\oplus\rangle\) (cyclic for every \(n\), 1 is a generator) \(\langle\mathbb{Z}_n; +,-,0\rangle\)(infinite cyclic group with generators 1 and -1)
Field-by-field Comparison
Field
Before
After
Text
A group \(G = \langle g \rangle\) generated by an element \(g \in G\) is called {{c1::cyclic}}, and \(g\) is called {{c1::a <b>generator</b> of \(G\)}}.
Extra
Examples:<br>\(\langle \mathbb{Z}_n;\oplus\rangle\) (cyclic for every \(n\), 1 is a generator)<br>\(\langle\mathbb{Z}_n; +,-,0\rangle\)(infinite cyclic group with generators 1 and -1)
DHKE selects two public values:<br><ol><li>{{c1:: a large prime \(p\)}}</li><li>{{c2:: basis \(g\) which is then exponentiated}}</li></ol>
What important property do equivalence classes have?
The set \(A / \theta\) of equivalence classes of an equivalence relation \(\theta\) on \(A\) is a partition of \(A\).
(Equivalence classes are disjoint and cover the entire set)
Field-by-field Comparison
Field
Before
After
Front
What important property do equivalence classes have?
Back
The set \(A / \theta\) of equivalence classes of an equivalence relation \(\theta\) on \(A\) is a partition of \(A\).
<br>
(Equivalence classes are disjoint and cover the entire set)
The semantics of propositional logic are defined as:
{{c1::\(\mathcal{A}(F) = \mathcal{A}(A_i)\) for any atomic formula \(A_i\)}}
for \(\land, \lor, \lnot\) the semantics are identical to before.
Field-by-field Comparison
Field
Before
After
Text
The semantics of propositional logic are defined as:<br><ol><li>{{c1::\(\mathcal{A}(F) = \mathcal{A}(A_i)\) for any atomic formula \(A_i\)}}</li></ol>for \(\land, \lor, \lnot\) the semantics are identical to before.<br>
An interpretation or structure in predicate logic is a tuple \(\mathcal{A} = (U, \phi, \varphi, \xi)\) where: - \(U\) is a non-empty universe - \(\phi\) assigns function symbols to functions \(U^k \rightarrow U\) - {{c3::\(\varphi\) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}} - \(\xi\) assigns variable symbols to values in \(U\)
An interpretation or structure in predicate logic is a tuple \(\mathcal{A} = (U, \phi, \varphi, \xi)\) where: - \(U\) is a non-empty universe - \(\phi\) assigns function symbols to functions \(U^k \rightarrow U\) - {{c3::\(\varphi\) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}} - \(\xi\) assigns variable symbols to values in \(U\)
Field-by-field Comparison
Field
Before
After
Text
An <i>interpretation</i> or <i>structure</i> in predicate logic is a tuple \(\mathcal{A} = (U, \phi, \varphi, \xi)\) where:<br>- {{c1::\(U\) is a <b>non-empty</b> universe}}<br>- {{c2::\(\phi\) assigns function symbols to functions \(U^k \rightarrow U\)}}<br>- {{c3::\(\varphi\) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}}<br>- {{c4::\(\xi\) assigns variable symbols to values in \(U\)}}
For all integers \(a\) and \(d \neq 0\), there exist unique integers \(q\) and \(r\) satisfying:
\[a = dq + r \quad \text{and} \quad 0 \leq r < |d|\]
(\(r\) is the remainder, \(q\) is the quotient)
Field-by-field Comparison
Field
Before
After
Front
State the Euclidean Division Theorem.
Back
For all integers \(a\) and \(d \neq 0\), there exist <strong>unique</strong> integers \(q\) and \(r\) satisfying:
\[a = dq + r \quad \text{and} \quad 0 \leq r < |d|\]
(\(r\) is the remainder, \(q\) is the quotient)
What's the difference between \(\equiv\), \(\leftrightarrow\), and \(\Leftrightarrow\)?
\(\equiv\): links formulas to statements (not part of PL itself)
\(\leftrightarrow\): formula → formula (part of PL)
\(\Leftrightarrow\): statement → statement
Field-by-field Comparison
Field
Before
After
Front
What's the difference between \(\equiv\), \(\leftrightarrow\), and \(\Leftrightarrow\)?
Back
<ul>
<li>\(\equiv\): links formulas to statements (not part of PL itself)</li>
<li>\(\leftrightarrow\): formula → formula (part of PL)</li>
<li>\(\Leftrightarrow\): statement → statement</li>
</ul>
The smallest non-negative integer \(n \in \mathbb{N}\) for which \(x \equiv_m n\). Equivalently, the remainder when \(x\) is divided by \(m\) (so \(0 \leq R_m(x) < m\)).
Field-by-field Comparison
Field
Before
After
Front
What is \(R_m(x)\)?
Back
The smallest <strong>non-negative</strong> integer \(n \in \mathbb{N}\) for which \(x \equiv_m n\). Equivalently, the remainder when \(x\) is divided by \(m\) (so \(0 \leq R_m(x) < m\)).
What is the number of subgroups of \(\mathbb{Z}_n\)?
it is the number of divisors of \(n\) if \(n\) is written \(n = p_1^{e_1} \times p_2^{e_2} \times ... \times p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\)
Field-by-field Comparison
Field
Before
After
Front
What is the number of subgroups of \(\mathbb{Z}_n\)?
Back
it is the number of divisors of \(n\)<br>if \(n\) is written \(n = p_1^{e_1} \times p_2^{e_2} \times ... \times p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\)
Lemma 5.5(ii): A group homomorphism \(\psi: G \rightarrow H\) maps {{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).
Lemma 5.5(ii): A group homomorphism \(\psi: G \rightarrow H\) maps {{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).
Field-by-field Comparison
Field
Before
After
Text
<p><strong>Lemma 5.5(ii)</strong>: A group homomorphism \(\psi: G \rightarrow H\) maps {{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).</p>
To prove equivalence between formulas \(F\) and \(G\) we have to prove that \(F \models G \ \ \land \ \ G \models F\).
Field-by-field Comparison
Field
Before
After
Text
To prove equivalence between formulas \(F\) and \(G\) we have to prove that {{c1:: \(F \models G \ \ \land \ \ G \models F\)}}.
A group is an algebra \(\langle G; *, \widehat{\ \ }, e \rangle\) satisfying three axioms: G1 (associativity), G2 (neutral element), and G3 (inverse elements).
A group is an algebra \(\langle G; *, \widehat{\ \ }, e \rangle\) satisfying three axioms: G1 (associativity), G2 (neutral element), and G3 (inverse elements).
Field-by-field Comparison
Field
Before
After
Text
<p>A {{c1::group}} is an algebra \(\langle G; *, \widehat{\ \ }, e \rangle\) satisfying {{c2::three}} axioms: {{c3::G1 (associativity)}}, {{c4::G2 (neutral element)}}, and {{c5::G3 (inverse elements)}}.</p>
There is a trade-off in calculi between simplicity (which makes proving soundness easier) and versatility (which makes the calculus more complete).
Field-by-field Comparison
Field
Before
After
Text
There is a trade-off in calculi between {{c1::simplicity (which makes proving soundness easier)}} and {{c1::versatility (which makes the calculus more complete)}}.
A clause \(K\) is {{c1::<i>resolvent</i>}} of clauses \(K_1\) and \(K_2\) if {{c2::there is a literal \(L\) such that \(L \in K_1\), \(\lnot L \in K_2\)}}.
The syntax of a logic defines an alphabet \(\Lambda\) (of allowed symbols) and specifies which strings in \(\Lambda^*\) are formulas (i.e. syntactically correct).
The syntax of a logic defines an alphabet \(\Lambda\) (of allowed symbols) and specifies which strings in \(\Lambda^*\) are formulas (i.e. syntactically correct).
Field-by-field Comparison
Field
Before
After
Text
The {{c1::<i>syntax</i>}} of a logic defines {{c2::an alphabet \(\Lambda\) (of allowed symbols)}} and specifies {{c2::which strings in \(\Lambda^*\) are formulas (i.e. syntactically correct)}}.
A monoidis an algebra \( \langle S; *, e \rangle\) where \(*\) is associative and \(e\) is the neutral element.
Difference to group: Inverse missing
Field-by-field Comparison
Field
Before
After
Text
{{c1::A <b>monoid</b>}}<b> </b>is an algebra {{c2::\( \langle S; *, e \rangle\) where \(*\) is associative and \(e\) is the neutral element.}}
What is the group generated by a, denoted \(\langle a \rangle\) defined as?
For a group \(G\) and \(a \in G\), the group generated by \(a\), denoted \(\langle a \rangle\), is defined as: \[\langle a \rangle \ \overset{\text{def}}{=} \ \{a^n \ | \ n \in \mathbb{Z}\}\]
This is a group, the smallest subgroup of \(G\) containing the element \(a\).
For finite groups: \(\langle a \rangle = \{e, a, a^2, \dots, a^{\text{ord}(a)-1}\}\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is the group <em>generated by a</em>, denoted \(\langle a \rangle\) defined as?</p>
Back
<p>For a group \(G\) and \(a \in G\), the group generated by \(a\), denoted \(\langle a \rangle\), is defined as: \[\langle a \rangle \ \overset{\text{def}}{=} \ \{a^n \ | \ n \in \mathbb{Z}\}\]</p>
<p>This is a group, the smallest subgroup of \(G\) containing the element \(a\).</p>
<p>For finite groups: \(\langle a \rangle = \{e, a, a^2, \dots, a^{\text{ord}(a)-1}\}\).</p>
Can a relation be both symmetric and antisymmetric?
YES - the identity relation is both symmetric and antisymmetric. The properties are independent, not mutually exclusive.
Field-by-field Comparison
Field
Before
After
Front
Can a relation be both symmetric and antisymmetric?
Back
<strong>YES</strong> - the identity relation is both symmetric and antisymmetric. The properties are <strong>independent</strong>, not mutually exclusive.
In propositional logic, a formula \(G\) is a logical consequence of a formula \(F\) if for all truth assignments to the propositional symbols appearing in \(F\) or \(G\), the truth value of \(G\) is \(1\) if the truth value of \(F\) is \(1\). This is denoted with \(F \models G\).
In propositional logic, a formula \(G\) is a logical consequence of a formula \(F\) if for all truth assignments to the propositional symbols appearing in \(F\) or \(G\), the truth value of \(G\) is \(1\) if the truth value of \(F\) is \(1\). This is denoted with \(F \models G\).
Example: \(A \land B \models A \lor B\)
Field-by-field Comparison
Field
Before
After
Text
In <b>propositional logic</b>, a formula \(G\) is a <i>logical consequence</i> of a formula \(F\) if {{c1:: for all truth assignments to the propositional symbols appearing in \(F\) or \(G\), the truth value of \(G\) is \(1\) if the truth value of \(F\) is \(1\)}}. This is denoted with \(F \models G\).
An \((n,k)\)-encoding function \(E\) is an {{c2::injective function \(E: \mathcal{A}^k \rightarrow \mathcal{A}^n\) where \(n > k\)}}.
Field-by-field Comparison
Field
Before
After
Text
<p>An {{c1::\((n,k)\)-encoding function}} \(E\) is an {{c2::injective function \(E: \mathcal{A}^k \rightarrow \mathcal{A}^n\) where \(n > k\)}}.</p>
An operation on a set \(S\) is a function \(S^n \to S\), where \(n \ge 0\) is called the arity of the operation.
Field-by-field Comparison
Field
Before
After
Text
An <i>operation</i> on a set \(S\) is {{c1::a function \(S^n \to S\), where \(n \ge 0\) is called the <i>arity</i> of the operation::what (include arity)?}}.
Can the resolution calculus remove two complementary literals at once?
NO! The resolution calculus doesn't allow removing two complementary literals at once.
The derivation \(\{A, \lnot B\}, \{\lnot A, B\} \vdash_{\text{res}} \emptyset\) is wrong and illegal!
For \(A = 1\), \(B = 1\) both clauses are true, so this would derive unsatisfiability from satisfiable clauses.
Field-by-field Comparison
Field
Before
After
Front
Can the resolution calculus remove two complementary literals at once?
Back
<b>NO!</b> The resolution calculus <b>doesn't allow</b> removing two complementary literals at once.<br><br>The derivation \(\{A, \lnot B\}, \{\lnot A, B\} \vdash_{\text{res}} \emptyset\) is <b>wrong and illegal!</b><br><br>For \(A = 1\), \(B = 1\) both clauses are true, so this would derive unsatisfiability from satisfiable clauses.
\(F \models G\) in propositional logic means that the function table (truth table) of \(G\) contains a \(1\) for at least all arguments for which the function table of \(F\) contains a \(1\).
\(F \models G\) in propositional logic means that the function table (truth table) of \(G\) contains a \(1\) for at least all arguments for which the function table of \(F\) contains a \(1\).
Field-by-field Comparison
Field
Before
After
Text
{{c2::\(F \models G\)}} in propositional logic means that {{c1::the function table (truth table) of \(G\) contains a \(1\) for at least all arguments for which the function table of \(F\) contains a \(1\)}}.
In predicate logic interpretation, \(\phi\) assigns function symbols \(f\) to functions, \(\phi(f)\) is a function \(U^k \rightarrow U\).
Field-by-field Comparison
Field
Before
After
Text
In predicate logic interpretation, {{c1::\(\phi\)}} assigns {{c2::<b>function</b> symbols \(f\) to functions, \(\phi(f)\) is a function \(U^k \rightarrow U\)}}.
For two groups \(\langle G;*;\widehat{};e\rangle\)and \(\langle H;\star;\sim;e'\rangle\), a function \(\psi: G\to H\) is called a group homomorphism if for all \(a\) and \(b\): \(\psi(a*b) = \psi(a)\star\psi(b)\). If \(\psi\) is a bijection from \(G\) to \(H\), then it is called an isomorphism.
For two groups \(\langle G;*;\widehat{};e\rangle\)and \(\langle H;\star;\sim;e'\rangle\), a function \(\psi: G\to H\) is called a group homomorphism if for all \(a\) and \(b\): \(\psi(a*b) = \psi(a)\star\psi(b)\). If \(\psi\) is a bijection from \(G\) to \(H\), then it is called an isomorphism.
Field-by-field Comparison
Field
Before
After
Text
For two groups \(\langle G;*;\widehat{};e\rangle\)and \(\langle H;\star;\sim;e'\rangle\), a function \(\psi: G\to H\) is called a <i>group homomorphism</i> if for all \(a\) and \(b\):<br>{{c1::\(\psi(a*b) = \psi(a)\star\psi(b)\)}}.<br>If \(\psi\) is {{c2::a bijection from \(G\) to \(H\)}}, then it is called an <i>isomorphism</i>.
Derivation or inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Derivation or inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Formally, a derivation rule \(R\) is a relation from the power set of the set of formulas to the set of formulas.
Field-by-field Comparison
Field
Before
After
Text
<i>Derivation </i>or <i>inference</i> rule: <br>{{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Extra
Formally, a derivation rule \(R\) is a relation from the power set of the set of formulas to the set of formulas.
In predicate logic interpretation, \(\varphi\) assigns {{c2::predicate symbols \(P\) to functions, \(\varphi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
In predicate logic interpretation, \(\varphi\) assigns {{c2::predicate symbols \(P\) to functions, \(\varphi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
Field-by-field Comparison
Field
Before
After
Text
In predicate logic interpretation, {{c1::\(\varphi\)}} assigns {{c2::<b>predicate</b> symbols \(P\) to functions, \(\varphi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
What are the equivalence classes modulo \(m(x)\) in a polynomial field.
Lemma 5.33: Congruence modulo \(m(x)\) is an equivalence relation on \(F[x]\), and each equivalence class has a unique representation of degree less than \(\deg(m(x))\).
Field-by-field Comparison
Field
Before
After
Front
<p>What are the equivalence classes modulo \(m(x)\) in a polynomial field.</p>
Back
<p><strong>Lemma 5.33</strong>: Congruence modulo \(m(x)\) is an <strong>equivalence relation</strong> on \(F[x]\), and each equivalence class has a <strong>unique representation</strong> of degree less than \(\deg(m(x))\).</p>
If for two groups \(G\) and \(H\) there is a function \(\psi: G\to H\) which is an isomorphism, then we say that \(G\) and \(H\) are isomorphic and we write this as \(G \simeq H\).
If for two groups \(G\) and \(H\) there is a function \(\psi: G\to H\) which is an isomorphism, then we say that \(G\) and \(H\) are isomorphic and we write this as \(G \simeq H\).
Field-by-field Comparison
Field
Before
After
Text
If for two groups \(G\) and \(H\) there is a function \(\psi: G\to H\) which is an isomorphism, then we say that {{c1::\(G\) and \(H\) are <i>isomorphic</i>}} and we write this as {{c1::\(G \simeq H\)}}.
What is the difference between a constructive and non-constructive existence proof?
Constructive: Exhibits an explicit \(a\) for which \(S_a\) is true
Non-constructive: Proves existence without constructing a specific example
Field-by-field Comparison
Field
Before
After
Front
What is the difference between a constructive and non-constructive existence proof?
Back
<ul>
<li><strong>Constructive</strong>: Exhibits an explicit \(a\) for which \(S_a\) is true</li>
<li><strong>Non-constructive</strong>: Proves existence without constructing a specific example</li>
</ul>
Lagrange's theorem: If \(G\) is a finite group and \(H\) is a subgroup, then the order of \(H\) divides the order of \(G\), i.e. \(|H|\) divides \(|G|\).
Lagrange's theorem: If \(G\) is a finite group and \(H\) is a subgroup, then the order of \(H\) divides the order of \(G\), i.e. \(|H|\) divides \(|G|\).
Field-by-field Comparison
Field
Before
After
Text
Lagrange's theorem: If \(G\) is a finite group and \(H\) is a subgroup, then {{c1::the order of \(H\) divides the order of \(G\), i.e. \(|H|\) divides \(|G|\).}}
For any formulas \(F\) and \(G\), \(F \rightarrow G\) is a tautology if and only if\(F \models G\).
Field-by-field Comparison
Field
Before
After
Text
For any formulas \(F\) and \(G\), {{c1::\(F \rightarrow G\)}} is a tautology <strong>if and only if</strong> {{c2::\(F \models G\)}}.
A formula is in conjunctive normal form (CNF) if it is a {{c2::conjunction of disjunctions of literals: \[(L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\]}}
A formula is in conjunctive normal form (CNF) if it is a {{c2::conjunction of disjunctions of literals: \[(L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\]}}
Field-by-field Comparison
Field
Before
After
Text
A formula is in {{c1::<i>conjunctive normal form</i> (CNF)}} if it is a {{c2::conjunction of disjunctions of literals: \[(L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\]}}
The goal of logic is to provide a specific proof system with which we can express a very large class of mathematical statements in \(\mathcal{S}\).
However, it's never possible to create a proof system that captures all such statements, especially self-referential statements.
Field-by-field Comparison
Field
Before
After
Text
The goal of logic is to provide a {{c1::specific proof system}} with which we can express {{c2::a very large class of mathematical statements}} in \(\mathcal{S}\).
Extra
However, it's never possible to create a proof system that captures <i>all</i> such statements, especially self-referential statements.
The Skolem transformation works by replacing all variables bound to an \(\exists\) by a function whose arguments are the universally quantified variables that precede it.
The Skolem transformation works by replacing all variables bound to an \(\exists\) by a function whose arguments are the universally quantified variables that precede it.
Field-by-field Comparison
Field
Before
After
Text
The Skolem transformation works by {{c1::replacing all variables <i>bound to an \(\exists\)</i> by a function}} whose arguments are {{c2::the universally quantified variables that precede it}}.
How is composition of relations represented in matrix and graph form?
Matrix: Matrix multiplication
Graph: Natural composition - there's a path from \(a\) to \(c\) if there's a path \(a \to b\) in graph 1 and \(b \to c\) in graph 2
Field-by-field Comparison
Field
Before
After
Front
How is composition of relations represented in matrix and graph form?
Back
<ul>
<li><strong>Matrix</strong>: Matrix multiplication</li>
<li><strong>Graph</strong>: Natural composition - there's a path from \(a\) to \(c\) if there's a path \(a \to b\) in graph 1 and \(b \to c\) in graph 2</li>
</ul>
Which of the following are integral domains: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_6, \mathbb{Z}_7\)?
Integral domains: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_7\) (where \(7\) is prime)
Not integral domains: \(\mathbb{Z}_6\) (since \(6\) is not prime)
Explanation: \(\mathbb{Z}_m\) is an integral domain if and only if \(m\) is prime. For \(\mathbb{Z}_6\), we have \(2 \cdot 3 \equiv_6 0\), so \(2\) and \(3\) are zerodivisors.
Field-by-field Comparison
Field
Before
After
Front
<p>Which of the following are integral domains: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_6, \mathbb{Z}_7\)?</p>
Back
<p><strong>Integral domains</strong>: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_7\) (where \(7\) is prime)</p>
<p><strong>Not integral domains</strong>: \(\mathbb{Z}_6\) (since \(6\) is not prime)</p>
<p><strong>Explanation</strong>: \(\mathbb{Z}_m\) is an integral domain if and only if \(m\) is prime. For \(\mathbb{Z}_6\), we have \(2 \cdot 3 \equiv_6 0\), so \(2\) and \(3\) are zerodivisors.</p>
State Theorem 5.23 about when \(\mathbb{Z}_p\) is a field.
Theorem 5.23: \(\mathbb{Z}_p\) is a field if and only if \(p\) is prime.
Explanation: When \(p\) is prime, every non-zero element is coprime to \(p\) and thus has a multiplicative inverse. When \(p\) is composite, there exist elements without inverses (the factors of \(p\)).
Field-by-field Comparison
Field
Before
After
Front
<p>State Theorem 5.23 about when \(\mathbb{Z}_p\) is a field.</p>
Back
<p><strong>Theorem 5.23</strong>: \(\mathbb{Z}_p\) is a field <strong>if and only if</strong> \(p\) is prime.</p>
<p><strong>Explanation</strong>: When \(p\) is prime, every non-zero element is coprime to \(p\) and thus has a multiplicative inverse. When \(p\) is composite, there exist elements without inverses (the factors of \(p\)).</p>
What is the proof idea for the soundness of the resolution calculus (Lemma 6.5)?
If \(\mathcal{A}\) models the set \(K_1, K_2\) then it makes at least one literal in both true. Case distinction: - If \(\mathcal{A}(L) = 1\), then \(K_2\) (which has \(\lnot L\)) must have at least one other literal that evaluates to true, so the union (resolvent) is also true - Similarly for \(\mathcal{A}(L) = 0\)
Field-by-field Comparison
Field
Before
After
Front
What is the proof idea for the soundness of the resolution calculus (Lemma 6.5)?
Back
If \(\mathcal{A}\) models the set \(K_1, K_2\) then it makes at least one literal in both true. Case distinction:<br>- If \(\mathcal{A}(L) = 1\), then \(K_2\) (which has \(\lnot L\)) must have at least one other literal that evaluates to true, so the union (resolvent) is also true<br>- Similarly for \(\mathcal{A}(L) = 0\)
A formula is in disjunctive normal form (DNF) if it is a {{c2::disjunction of conjunctions of literals: \[(L_{11} \land \dots \land L_{1m_1}) \lor \dots \lor (L_{n1} \land \dots \land L_{nm_n})\]}}
A formula is in disjunctive normal form (DNF) if it is a {{c2::disjunction of conjunctions of literals: \[(L_{11} \land \dots \land L_{1m_1}) \lor \dots \lor (L_{n1} \land \dots \land L_{nm_n})\]}}
Field-by-field Comparison
Field
Before
After
Text
A formula is in {{c1::<i>disjunctive normal form</i> (DNF)}} if it is a {{c2::disjunction of conjunctions of literals: \[(L_{11} \land \dots \land L_{1m_1}) \lor \dots \lor (L_{n1} \land \dots \land L_{nm_n})\]}}
The application of a derivation rule \(R\) to a set \(M\) of formulas means: 1. Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\) 2. {{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}
The application of a derivation rule \(R\) to a set \(M\) of formulas means: 1. Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\) 2. {{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}
Field-by-field Comparison
Field
Before
After
Text
The <i>application of a derivation rule</i> \(R\) to a set \(M\) of formulas means:<br>1. {{c1::Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\)}}<br>2. {{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}
Why do we replace \(\exists x\) in \(\exists x f(x)\) with a constant \(a\) in Skolem Normal Form?
If the \(\exists\) is the first quantifier in the formula, then it doesn't depend on anything, and we can just replace it by a constant function \(a\) that always returns the \(x\) for which our formula is true: \(\exists x f(x) \equiv f(a)\).
Field-by-field Comparison
Field
Before
After
Front
Why do we replace \(\exists x\) in \(\exists x f(x)\) with a constant \(a\) in Skolem Normal Form?
Back
If the \(\exists\) is the first quantifier in the formula, then it <b>doesn't depend on anything</b>, and we can just replace it by a constant function \(a\) that always returns the \(x\) for which our formula is true: \(\exists x f(x) \equiv f(a)\).
Under interpretation \(P, U, x, f\) become {{c1:: \(P^\mathcal{A}\), \(U^\mathcal{A}\), \(x^\mathcal{A} = \xi(x)\) and \(f^\mathcal{A}\)}}.
Field-by-field Comparison
Field
Before
After
Text
Under interpretation \(P, U, x, f\) become {{c1:: \(P^\mathcal{A}\), \(U^\mathcal{A}\), \(x^\mathcal{A} = \xi(x)\) and \(f^\mathcal{A}\)}}.
Semantics Prop. Logic: {{c2::\(\mathcal{A}((F \land G)) = 1\) }} if and only if {{c1::\(\mathcal{A}(F) = 1\) and \(\mathcal{A}(G) = 1\)}}.
Field-by-field Comparison
Field
Before
After
Text
Semantics Prop. Logic: {{c2::\(\mathcal{A}((F \land G)) = 1\) }} if and only if {{c1::\(\mathcal{A}(F) = 1\) <i>and</i> \(\mathcal{A}(G) = 1\)}}.
An interpretation consists of {{c1::a set \(\mathcal{Z} \subseteq \Lambda\) of \(\Lambda\)}}, {{c2::a domain (a set of possible values) for each symbol in \(\mathcal{Z}\)}}, and {{c3::a function that assigns to each symbol in \(\mathcal{Z}\) a value in the associated domain}}.
An interpretation consists of {{c1::a set \(\mathcal{Z} \subseteq \Lambda\) of \(\Lambda\)}}, {{c2::a domain (a set of possible values) for each symbol in \(\mathcal{Z}\)}}, and {{c3::a function that assigns to each symbol in \(\mathcal{Z}\) a value in the associated domain}}.
Often the domain is defined in terms of the universe \(U\) where a symbol can be a function, predicate or element of \(U\).
Field-by-field Comparison
Field
Before
After
Text
An <i>interpretation</i> consists of {{c1::a set \(\mathcal{Z} \subseteq \Lambda\) of \(\Lambda\)}}, {{c2::a domain (a set of possible values) for each symbol in \(\mathcal{Z}\)}}, and {{c3::a function that assigns to each symbol in \(\mathcal{Z}\) a value in the associated domain}}.
Extra
Often the domain is defined in terms of the <i>universe</i> \(U\) where a symbol can be a function, predicate or element of \(U\).
What is the Skolem transformation of \(\forall s \exists t \forall x \forall y \exists z F(s, t, x, y, z)\)?
\[\forall s \forall x \forall y F(s, f(s), x, y, g(s, x, y))\]
The \(t\) depends only on \(s\), so it becomes \(f(s)\). The \(z\) depends on \(s\), \(x\), and \(y\), so it becomes \(g(s, x, y)\).
Field-by-field Comparison
Field
Before
After
Front
What is the Skolem transformation of \(\forall s \exists t \forall x \forall y \exists z F(s, t, x, y, z)\)?
Back
\[\forall s \forall x \forall y F(s, f(s), x, y, g(s, x, y))\]<br><br>The \(t\) depends only on \(s\), so it becomes \(f(s)\). The \(z\) depends on \(s\), \(x\), and \(y\), so it becomes \(g(s, x, y)\).
A formula \(G\) is a logical consequence of a formula \(F\) (or a set \(M\)), denoted \(F \models G\), if every interpretation suitable for both \(F\) and \(G\) which is a model for \(F\) is also a model for \(G\).
A formula \(G\) is a logical consequence of a formula \(F\) (or a set \(M\)), denoted \(F \models G\), if every interpretation suitable for both \(F\) and \(G\) which is a model for \(F\) is also a model for \(G\).
\(F\) model for \(G\) means: \(\mathcal{A} \models F \implies \mathcal{A} \models G\).
Field-by-field Comparison
Field
Before
After
Text
A formula \(G\) is a {{c1::<i>logical consequence</i>}} of a formula \(F\) (or a set \(M\)), denoted {{c1::\(F \models G\)}}, if {{c2::every interpretation suitable for both \(F\) and \(G\) which is a model for \(F\) is also a model for \(G\)}}.
Extra
\(F\) model for \(G\) means: \(\mathcal{A} \models F \implies \mathcal{A} \models G\).
A derivation of a formula \(G\) from a set \(M\) of formulas in a calculus \(K\) is a finite sequence (of some length \(n\)) of applications of rules in \(K\), leading to \(G\) denoted \(M \vdash_K G\).
A derivation of a formula \(G\) from a set \(M\) of formulas in a calculus \(K\) is a finite sequence (of some length \(n\)) of applications of rules in \(K\), leading to \(G\) denoted \(M \vdash_K G\).
More precisely: \(M_0 := M\), \(M_i := M_{i-1} \cup \{G_i\}\) for \(1 \leq i \leq n\), where \(N \vdash_R G_i\) for some \(N \subseteq M_{i-1}\) and for some \(R_j \in K\), and where \(G_n = G\).
Field-by-field Comparison
Field
Before
After
Text
A <i>derivation</i> of a formula \(G\) from a set \(M\) of formulas in a calculus \(K\) is a {{c1::finite sequence (of some length \(n\)) of applications of rules in \(K\), leading to \(G\)}} denoted {{c2:: \(M \vdash_K G\)}}.
Extra
More precisely: \(M_0 := M\), \(M_i := M_{i-1} \cup \{G_i\}\) for \(1 \leq i \leq n\), where \(N \vdash_R G_i\) for some \(N \subseteq M_{i-1}\) and for some \(R_j \in K\), and where \(G_n = G\).
Proof Idea Resolution Calculus complete (regard to unsatisfiability):
Proof by induction on \(n\) literals:
Base case (n=1): Only one unsatisfiable set for 1 literal: \(\{\{A_1\}, \{\lnot A_1\}\}\)
Inductive step: Remove \(A_{n+1}\)/\(\lnot A_{n+1}\) from all formulas, producing two sets \(\mathcal{K}_1\)/\(\mathcal{K}_0\)
Apply I.H. to derive \(\emptyset\) in each (if unsatisfiable)
Add literals back: get derivations for \(\{A_{n+1}\}\) and \(\{\lnot A_{n+1}\}\), which resolve to \(\emptyset\)
(It could also be that we didn't use the literals in the derivations, then we're done immediately)
Field-by-field Comparison
Field
Before
After
Front
Proof Idea Resolution Calculus complete (regard to unsatisfiability):
Back
<b>Proof by induction on \(n\) literals:</b><br><ul><li><b>Base case (n=1):</b> Only one unsatisfiable set for 1 literal: \(\{\{A_1\}, \{\lnot A_1\}\}\)</li><li><b>Inductive step:</b> Remove \(A_{n+1}\)/\(\lnot A_{n+1}\) from all formulas, producing two sets \(\mathcal{K}_1\)/\(\mathcal{K}_0\)</li><li>Apply I.H. to derive \(\emptyset\) in each (if unsatisfiable)</li><li>Add literals back: get derivations for \(\{A_{n+1}\}\) and \(\{\lnot A_{n+1}\}\), which resolve to \(\emptyset\)</li><li>(It could also be that we didn't use the literals in the derivations, then we're done immediately)</li></ul><br>
How do you construct a CNF formula from a truth table?
For every row evaluating to 0: 1. Take the disjunction of \(n\) literals 2. If \(A_i = 0\) in the row, take \(A_i\) 3. If \(A_i = 1\) in the row, take \(\lnot A_i\) 4. Then take the conjunction of all these rows
This works because \(F\) is \(0\) exactly if every single disjunction is true, which is the case by construction.
Field-by-field Comparison
Field
Before
After
Front
How do you construct a CNF formula from a truth table?
Back
For every row evaluating to <b>0</b>:<br>1. Take the <i>disjunction</i> of \(n\) literals<br>2. If \(A_i = 0\) in the row, take \(A_i\)<br>3. If \(A_i = 1\) in the row, take \(\lnot A_i\)<br>4. Then take the <i>conjunction</i> of all these rows<br><br>This works because \(F\) is \(0\) exactly if every single disjunction is true, which is the case by construction.
We can eliminate the quantifier by replacing \(x\) by one specific \(t\). As \(F\) is true for all \(x\), this holds for the free variable \(t\).
Field-by-field Comparison
Field
Before
After
Front
Why does universal instantiation work?
Back
We can eliminate the quantifier by replacing \(x\) by one specific \(t\). As \(F\) is true for all \(x\), this holds for the free variable \(t\).
For a set \(M\) of formulas, a (suitable) interpretation for which all formulas are true is called a model for \(M\) denoted as {{c2::\(\mathcal{A} \models M\)}}.
For a set \(M\) of formulas, a (suitable) interpretation for which all formulas are true is called a model for \(M\) denoted as {{c2::\(\mathcal{A} \models M\)}}.
If \(\mathcal{A}\) is not a model for \(M\) one writes \(\mathcal{A} \not\models M\).
Field-by-field Comparison
Field
Before
After
Text
For a set \(M\) of formulas, a {{c3:: (suitable) interpretation for which all formulas are true}} is called a {{c2::<i>model</i> for \(M\)}} denoted as {{c2::\(\mathcal{A} \models M\)}}.
Extra
If \(\mathcal{A}\) is not a model for \(M\) one writes \(\mathcal{A} \not\models M\).
How do you construct a DNF formula from a truth table?
For every row evaluating to 1: 1. Take the conjunction of \(n\) literals 2. If \(A_i = 0\) in the row, take \(\lnot A_i\) 3. If \(A_i = 1\) in the row, take \(A_i\) 4. Then take the disjunction of all these rows
This works because \(F\) is \(1\) exactly if one of the rows is \(1\), which is the case by construction.
Field-by-field Comparison
Field
Before
After
Front
How do you construct a DNF formula from a truth table?
Back
For every row evaluating to <b>1</b>:<br>1. Take the <i>conjunction</i> of \(n\) literals<br>2. If \(A_i = 0\) in the row, take \(\lnot A_i\)<br>3. If \(A_i = 1\) in the row, take \(A_i\)<br>4. Then take the <i>disjunction</i> of all these rows<br><br>This works because \(F\) is \(1\) exactly if one of the rows is \(1\), which is the case by construction.
A derivation rule \(R\) is correct if for every set \(M\) of formulas and every formula \(F\), \(M \vdash_R F\) implies \(M \models F\).
Field-by-field Comparison
Field
Before
After
Text
A derivation rule \(R\) is {{c1::<i>correct</i>}} if for every set \(M\) of formulas and every formula \(F\), {{c2::\(M \vdash_R F\) implies \(M \models F\)}}.
The semantics defines: 1. A function \(free\) that assigns to each formula which symbols occur free 2. A function \(\sigma\) that assigns truth values to formulas under interpretations 3. The meaning and behavior of logical operators
Field-by-field Comparison
Field
Before
After
Front
What does the semantics of a logic define?
Back
The semantics defines:<br>1. A function \(free\) that assigns to each formula which symbols occur free<br>2. A function \(\sigma\) that assigns truth values to formulas under interpretations<br>3. The meaning and behavior of logical operators
\(F\) of the form \(\forall x G\) or \(\exists x G\) semantics:
\(\mathcal{A}(\forall x G) = 1\) if {{c1::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for all \(u\) in \(U\)}}
\(\mathcal{A}(\exists x G) = 1\) if {{c2::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for some \(u\) in \(U\)}}
\(\mathcal{A}_{[x \rightarrow u]}\)}} for \(u\) in \(U\) is the same structure as \(\mathcal{A}\), except that \(\xi(x)\) is overwritten by \(u\): \(\xi(x) = u\).
Field-by-field Comparison
Field
Before
After
Text
\(F\) of the form \(\forall x G\) or \(\exists x G\) semantics:<br><ul><li>\(\mathcal{A}(\forall x G) = 1\) if {{c1::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for all \(u\) in \(U\)}}</li><li>\(\mathcal{A}(\exists x G) = 1\) if {{c2::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for some \(u\) in \(U\)}}</li></ul>
Extra
<div>\(\mathcal{A}_{[x \rightarrow u]}\)}} for \(u\) in \(U\) is the same structure as \(\mathcal{A}\), except that \(\xi(x)\) is overwritten by \(u\): \(\xi(x) = u\).</div>
A function symbol is of the form {{c2::\(f_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where \(k\) denotes the number of arguments (the arity) of the function.
A function symbol is of the form {{c2::\(f_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where \(k\) denotes the number of arguments (the arity) of the function.
Function symbols for \(k = 0\) are called constants.
Field-by-field Comparison
Field
Before
After
Text
A {{c1::<i>function symbol</i>}} is of the form {{c2::\(f_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where {{c2::\(k\) denotes the number of arguments (the <i>arity</i>) of the function}}.
Extra
Function symbols for \(k = 0\) are called <i>constants</i>.
A {{c2:: (suitable) interpretation \(\mathcal{A}\) for which a formula \(F\) is true (i.e. \(\mathcal{A}(F) = 1\))}} is called a model for \(F\) and one also writes {{c1::\(\mathcal{A} \models F\)}}.
A {{c2:: (suitable) interpretation \(\mathcal{A}\) for which a formula \(F\) is true (i.e. \(\mathcal{A}(F) = 1\))}} is called a model for \(F\) and one also writes {{c1::\(\mathcal{A} \models F\)}}.
Field-by-field Comparison
Field
Before
After
Text
A {{c2:: (suitable) interpretation \(\mathcal{A}\) for which a formula \(F\) is true (i.e. \(\mathcal{A}(F) = 1\))}} is called a {{c1::<i>model</i>}} for \(F\) and one also writes {{c1::\(\mathcal{A} \models F\)}}.
sound or correct if \(M \vdash_K F\) implies \(M \models F\).
complete if \(M \models F\) implies \(M \vdash_K F\).
Hence, it's sound and complete if \(M \vdash_K F \Leftrightarrow M \models F\).
Field-by-field Comparison
Field
Before
After
Text
A calculus \(K\) is <br><ul><li>{{c1::<i>sound</i> or <i>correct</i>}} if {{c2::\(M \vdash_K F\) implies \(M \models F\)}}.</li><li>{{c3::<i>complete</i>}} if {{c4::\(M \models F\) implies \(M \vdash_K F\)}}.</li></ul>
Extra
Hence, it's <b>sound and complete</b> if \(M \vdash_K F \Leftrightarrow M \models F\).
A predicate symbol is of the form {{c2::\(P_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where \(k\) denotes the number of arguments of the predicate.
Field-by-field Comparison
Field
Before
After
Text
A {{c1::<i>predicate symbol</i>}} is of the form {{c2::\(P_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where {{c2::\(k\) denotes the number of arguments of the predicate}}.
The semantics of a logic defines a function \(\sigma\) {{c1::assigning to each formula \(F\) and each interpretation \(\mathcal{A}\) suitable for \(F\) a truth value\(\sigma(F, \mathcal{A})\)in \(\{0, 1\}\)}}.
The semantics of a logic defines a function \(\sigma\) {{c1::assigning to each formula \(F\) and each interpretation \(\mathcal{A}\) suitable for \(F\) a truth value\(\sigma(F, \mathcal{A})\)in \(\{0, 1\}\)}}.
Field-by-field Comparison
Field
Before
After
Text
The <i>semantics</i> of a logic defines a function \(\sigma\) {{c1::assigning to each formula \(F\) and each interpretation \(\mathcal{A}\) suitable for \(F\) a truth value\(\sigma(F, \mathcal{A})\)in \(\{0, 1\}\)}}.
if \((t_1, \dots, t_k)\) are terms, then {{c3::\(f^{(k)}(t_1, \dots, t_k)\) is a term}}.
For \(k = 0\) one writes no parenthesis (constants).
Field-by-field Comparison
Field
Before
After
Text
A <b>term</b> is defined inductively: <br><ul><li>{{c1::A variable}} is a term</li><li>if {{c2::\((t_1, \dots, t_k)\) are terms}}, then {{c3::\(f^{(k)}(t_1, \dots, t_k)\) is a term}}.</li></ul>
Extra
For \(k = 0\) one writes no parenthesis (constants).
Two formulas \(F\) and \(G\) are equivalent, denoted \(F \equiv G\), if every interpretation suitable for both \(F\) and \(G\) yields the same truth value.
Two formulas \(F\) and \(G\) are equivalent, denoted \(F \equiv G\), if every interpretation suitable for both \(F\) and \(G\) yields the same truth value.
Each one is a logical consequence of the other: \(F \models G\) and \(G \models F\).
Field-by-field Comparison
Field
Before
After
Text
Two formulas \(F\) and \(G\) are {{c1::<i>equivalent</i>}}, denoted {{c1::\(F \equiv G\)}}, if {{c2::every interpretation suitable for both \(F\) and \(G\) yields the same truth value}}.
Extra
Each one is a logical consequence of the other: \(F \models G\) and \(G \models F\).
If a variable \(x\) occurs in a (sub-)formula of the form \(\forall x G\) or \(\exists x G\) then it is bound, otherwise it is free.
Field-by-field Comparison
Field
Before
After
Text
If a variable \(x\) occurs {{c1::in a (sub-)formula of the form \(\forall x G\) or \(\exists x G\)}} then it is {{c2:: <b>bound</b>, otherwise it is <b>free</b>}}.
Does every homomorphism have to be injective? Give an example.
No, homomorphisms do not need to be injective.
Example: We could map all elements of \(G\) to the neutral element \(e'\) in \(H\). This satisfies the homomorphism property: \[\psi(a * b) = e' = e' \star e' = \psi(a) \star \psi(b)\] but is clearly not injective.
Field-by-field Comparison
Field
Before
After
Front
<p>Does every homomorphism have to be injective? Give an example.</p>
Back
<p><strong>No</strong>, homomorphisms do not need to be injective.</p>
<p><strong>Example</strong>: We could map all elements of \(G\) to the neutral element \(e'\) in \(H\). This satisfies the homomorphism property: \[\psi(a * b) = e' = e' \star e' = \psi(a) \star \psi(b)\] but is clearly not injective.</p>
The set of units of \(R\) is denoted by \(R^*\) and \(R^*\) is a group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds.
The set of units of \(R\) is denoted by \(R^*\) and \(R^*\) is a group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds.
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::set of units}} of \(R\) is denoted by {{c2::\(R^*\)}} and {{c3::\(R^*\) is a group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds}}.</p>
Give an example of an element with infinite order.
In the group \(\langle \mathbb{Z}; + \rangle\), any integer \(a \neq 0\) has infinite order.
Explanation: The carrier \(\mathbb{Z}\) is infinite, and we never "loop around" to reach \(0\) by repeatedly adding a non-zero integer. For any \(n \geq 1\), we have \(na \neq 0\) if \(a \neq 0\).
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of an element with infinite order.</p>
Back
<p>In the group \(\langle \mathbb{Z}; + \rangle\), any integer \(a \neq 0\) has <strong>infinite order</strong>.</p>
<p><strong>Explanation</strong>: The carrier \(\mathbb{Z}\) is infinite, and we never "loop around" to reach \(0\) by repeatedly adding a non-zero integer. For any \(n \geq 1\), we have \(na \neq 0\) if \(a \neq 0\).</p>
What is a zerodivisor and in which structure do they exist?
A zerodivisor is an element \(a \neq 0\) in a commutative ring for which there exists a \(b \neq 0\) such that \(ab = 0\).
This is commonly encountered for the polynomial rings formed over \(\text{GF}[x]_{m(x)}\) with \(m(x)\) not irreducible (i.e. it's not a field).
Field-by-field Comparison
Field
Before
After
Front
What is a zerodivisor and in which structure do they exist?
Back
A <b>zerodivisor</b> is an element \(a \neq 0\) in a <b>commutative ring</b> for which there exists a \(b \neq 0\) such that \(ab = 0\).<br><br>This is commonly encountered for the polynomial rings formed over \(\text{GF}[x]_{m(x)}\) with \(m(x)\) not irreducible (i.e. it's not a field).
What's the difference between a minimal element and the least element in a poset?
Minimal: No \(b\) exists with \(b \prec a\) (could be multiple minimal elements)
Least: \(a \preceq b\) for all \(b \in A\) (unique if it exists)
Field-by-field Comparison
Field
Before
After
Front
What's the difference between a minimal element and the least element in a poset?
Back
<ul>
<li><strong>Minimal</strong>: No \(b\) exists with \(b \prec a\) (could be multiple minimal elements)</li>
<li><strong>Least</strong>: \(a \preceq b\) for <strong>all</strong> \(b \in A\) (unique if it exists)</li>
</ul>
What is the ideal \((a, b)\) generated by integers \(a\) and \(b\) and just \(a\)?
\[(a, b) \overset{\text{def}}{=} \{ ua + vb \ | \ u, v \in \mathbb{Z}\}\] and \[(a) \overset{\text{def}}{=} \{ ua \ | \ u \in \mathbb{Z}\}\]
The set of all integer linear combinations of \(a\) and \(b\).
Field-by-field Comparison
Field
Before
After
Front
What is the ideal \((a, b)\) generated by integers \(a\) and \(b\) and just \(a\)?
Back
\[(a, b) \overset{\text{def}}{=} \{ ua + vb \ | \ u, v \in \mathbb{Z}\}\] and \[(a) \overset{\text{def}}{=} \{ ua \ | \ u \in \mathbb{Z}\}\]
The set of all integer linear combinations of \(a\) and \(b\).
A formula \(F\) is satisfiable if it is true for at least one truth assignment of the involved propositional symbols.
Field-by-field Comparison
Field
Before
After
Text
A formula \(F\) is {{c1:: satisfiable}} if it {{c2:: is true for <strong>at least one</strong> truth assignment of the involved propositional symbols}}.
An \((n,k)\)-error-correcting code over the alphabet \(\mathcal{A}\) with \(|\mathcal{A}| = q\) is a subset of \(\mathcal{A}^n\) of cardinality \(q^k\).
An \((n,k)\)-error-correcting code over the alphabet \(\mathcal{A}\) with \(|\mathcal{A}| = q\) is a subset of \(\mathcal{A}^n\) of cardinality \(q^k\).
Field-by-field Comparison
Field
Before
After
Text
<p>An \((n,k)\)-error-correcting code over the alphabet \(\mathcal{A}\) with \(|\mathcal{A}| = q\) is a subset of \(\mathcal{A}^n\) of cardinality {{c1::\(q^k\)}}.</p>
How does satisfiability differ between propositional logic and predicate logic?
Propositional Logic: About truth assignments to symbols
Predicate Logic: About interpretations (universe, predicates, and constants)
Field-by-field Comparison
Field
Before
After
Front
How does satisfiability differ between propositional logic and predicate logic?
Back
<ul>
<li><strong>Propositional Logic</strong>: About truth assignments to symbols</li>
<li><strong>Predicate Logic</strong>: About interpretations (universe, predicates, and constants)</li>
</ul>
Lemma 5.28: Polynomial evaluation is compatible with the ring operations:
- If \(c(x) = a(x) + b(x)\) then \(c(\alpha) = a(\alpha) + b(\alpha)\) for any \(\alpha\)
- If \(c(x) = a(x) \cdot b(x)\) then \(c(\alpha) = a(\alpha) \cdot b(\alpha)\) for any \(\alpha\)
Field-by-field Comparison
Field
Before
After
Front
<p>What does polynomial evaluation preserve?</p>
Back
<p><strong>Lemma 5.28</strong>: Polynomial evaluation is compatible with the ring operations:<br>
- If \(c(x) = a(x) + b(x)\) then \(c(\alpha) = a(\alpha) + b(\alpha)\) for any \(\alpha\)<br>
- If \(c(x) = a(x) \cdot b(x)\) then \(c(\alpha) = a(\alpha) \cdot b(\alpha)\) for any \(\alpha\)</p>
Show that if \(a \not= b\) then under that assumption, if \(f(a) = f(b)\) we get a contradiction as this implies \(a = b\).
Example: \(f(x) = 2x\), then if \(a \not = b\) then if \(f(a) = f(b) \ \implies \ 2a = 2b\). This however \( \ \implies a = b\).
Field-by-field Comparison
Field
Before
After
Front
How do I show the injectivity of a function?
Back
Show that if \(a \not= b\) then under that assumption, if \(f(a) = f(b)\) we get a contradiction as this implies \(a = b\).<br><br><b>Example: </b>\(f(x) = 2x\), then if \(a \not = b\) then if \(f(a) = f(b) \ \implies \ 2a = 2b\). This however \( \ \implies a = b\).
State the Chinese Remainder Theorem (Theorem 4.19).
Let \(m_1, m_2, \dots, m_r\) be pairwise relatively prime integers and let \(M = \prod_{i=1}^{r} m_i\). For every list \(a_1, \dots, a_r\) with \(0 \leq a_i < m_i\), the system
\[\begin{align} x &\equiv_{m_1} a_1 \\ x &\equiv_{m_2} a_2 \\ &\vdots \\ x &\equiv_{m_r} a_r \end{align}\]
has a unique solution \(x\) satisfying \(0 \leq x < M\).
Field-by-field Comparison
Field
Before
After
Front
State the Chinese Remainder Theorem (Theorem 4.19).
Back
Let \(m_1, m_2, \dots, m_r\) be <strong>pairwise relatively prime</strong> integers and let \(M = \prod_{i=1}^{r} m_i\). For every list \(a_1, \dots, a_r\) with \(0 \leq a_i < m_i\), the system
\[\begin{align} x &\equiv_{m_1} a_1 \\ x &\equiv_{m_2} a_2 \\ &\vdots \\ x &\equiv_{m_r} a_r \end{align}\]
has a <strong>unique solution</strong> \(x\) satisfying \(0 \leq x < M\).
Is the "dominates" relation (\(\preceq\)) transitive?
Yes: \(A \preceq B \land B \preceq C \Rightarrow A \preceq C\)
(If \(A\) injects into \(B\) and \(B\) injects into \(C\), then \(A\) injects into \(C\))
Field-by-field Comparison
Field
Before
After
Front
Is the "dominates" relation (\(\preceq\)) transitive?
Back
Yes: \(A \preceq B \land B \preceq C \Rightarrow A \preceq C\)
<br>
(If \(A\) injects into \(B\) and \(B\) injects into \(C\), then \(A\) injects into \(C\))
Why do we need \(\mathbb{Z}_m^*\) for multiplication, rather than just using \(\mathbb{Z}_m\)?
\(\mathbb{Z}_m\) (with \(\oplus\)) is not a group with respect to multiplication modulo \(m\) because elements that are not coprime to \(m\) don't have a multiplicative inverse.
For example, in \(\mathbb{Z}_6\), the element \(2\) has no multiplicative inverse because \(\gcd(2, 6) = 2 \neq 1\).
Thus we need \(\mathbb{Z}_m^*\) (elements coprime to \(m\)) to form a group with \(\odot\) (multiplication mod \(\oplus\)0).
Field-by-field Comparison
Field
Before
After
Front
<p>Why do we need \(\mathbb{Z}_m^*\) for multiplication, rather than just using \(\mathbb{Z}_m\)?</p>
Back
<p>\(\mathbb{Z}_m\) (with \(\oplus\)) is <strong>not a group</strong> with respect to multiplication modulo \(m\) because elements that are <strong>not coprime</strong> to \(m\) don't have a <strong>multiplicative inverse</strong>.</p>
<p>For example, in \(\mathbb{Z}_6\), the element \(2\) has no multiplicative inverse because \(\gcd(2, 6) = 2 \neq 1\).</p>
<p>Thus we need \(\mathbb{Z}_m^*\) (elements coprime to \(m\)) to form a group with \(\odot\) (multiplication mod \(\oplus\)0).</p>
If two sets each dominate the other, what can we conclude?
For sets \(A\) and \(B\):
\[A \preceq B \land B \preceq A \quad \Rightarrow \quad A \sim B\]
If there's an injection \(f: A \to B\) and an injection \(g: B \to A\), then there's a bijection between \(A\) and \(B\).
Bernstein-Schröder Theorem
Field-by-field Comparison
Field
Before
After
Front
If two sets each dominate the other, what can we conclude?
Back
For sets \(A\) and \(B\):
\[A \preceq B \land B \preceq A \quad \Rightarrow \quad A \sim B\]
If there's an injection \(f: A \to B\) and an injection \(g: B \to A\), then there's a bijection between \(A\) and \(B\).<div><br></div><div>Bernstein-Schröder Theorem</div>
The monic polynomial \(g(x)\) of largest degree such that \(g(x) \ | \ a(x)\) and \(g(x) \ | \ b(x)\) is called the greatest common divisor of \(a(x)\) and \(b(x)\), denoted \(\gcd(a(x), b(x))\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is the GCD in a polynomial Field</p>
Back
<p>The <em>monic</em> polynomial \(g(x)\) of <em>largest degree</em> such that \(g(x) \ | \ a(x)\) and \(g(x) \ | \ b(x)\) is called the <em>greatest common divisor</em> of \(a(x)\) and \(b(x)\), denoted \(\gcd(a(x), b(x))\).</p>
A relation ρ on a set A is called reflexive if {{c2::\( a \ \rho \ a\) is true for all \( a \in A\), i.e. if \( \text{id} \subseteq \rho\).}}
Example: \( \ge, \le \) are reflexive, while \( <, > \) are not.
Field-by-field Comparison
Field
Before
After
Text
A relation ρ on a set A is called {{c1::reflexive}} if {{c2::\( a \ \rho \ a\) is true for all \( a \in A\), i.e. if \( \text{id} \subseteq \rho\).}}
Extra
Example: \( \ge, \le \) are reflexive, while \( <, > \) are not.
A proof system is complete if every true statement has a proof: \(\phi(s, p) = 1 \Longleftarrow \tau(s) = 1\).
Note that the use of \(\Longleftarrow\) is not the correct formalism. For all \(s \in \mathcal{S}\) with \(\tau(s) = 1\) there exists a \(p \in \mathcal{P}\) such that \(\phi(s, p) = 1\), is the correct formal definition.
Field-by-field Comparison
Field
Before
After
Text
A proof system is {{c2:: <b>complete</b>}} if {{c1:: every true statement has a proof: \(\phi(s, p) = 1 \Longleftarrow \tau(s) = 1\)}}.
Extra
<i>Note that the use of </i> \(\Longleftarrow\) <i>is not the correct formalism.</i><br>For all \(s \in \mathcal{S}\) with \(\tau(s) = 1\) there exists a \(p \in \mathcal{P}\) such that \(\phi(s, p) = 1\), is the correct formal definition.
Give the formal definition of a prime number \(p\).
\[p \ \text{prime} \overset{\text{def}}{\Longleftrightarrow} p > 1 \land \forall d \ ((d > 1) \land (d | p) \rightarrow d = p)\]
A prime is greater than 1 and its only positive divisors are 1 and itself.
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of a prime number \(p\).
Back
\[p \ \text{prime} \overset{\text{def}}{\Longleftrightarrow} p > 1 \land \forall d \ ((d > 1) \land (d | p) \rightarrow d = p)\]
A prime is greater than 1 and its only positive divisors are 1 and itself.
State Corollary 5.10 about raising elements to the power of the group order.
Corollary 5.10: Let \(G\) be a finite group. Then \(a^{|G|} = e\) for every \(a \in G\).
Proof: By Corollary 5.9, \(|G| = k \cdot \text{ord}(a)\) for some \(k\). Thus: \[a^{|G|} = a^{k \cdot \text{ord}(a)} = (a^{\text{ord}(a)})^k = e^k = e\]
Field-by-field Comparison
Field
Before
After
Front
<p>State Corollary 5.10 about raising elements to the power of the group order.</p>
Back
<p><strong>Corollary 5.10</strong>: Let \(G\) be a finite group. Then \(a^{|G|} = e\) for every \(a \in G\).</p>
<p><strong>Proof</strong>: By Corollary 5.9, \(|G| = k \cdot \text{ord}(a)\) for some \(k\). Thus: \[a^{|G|} = a^{k \cdot \text{ord}(a)} = (a^{\text{ord}(a)})^k = e^k = e\]</p>
How does the inverse of a composition of relations behave?
Let \(\rho: A \to B\) and \(\sigma: B \to C\). Then:
\[\widehat{\rho \sigma} = \hat{\sigma}\hat{\rho}\]
(The inverse of a composition reverses the order)
Field-by-field Comparison
Field
Before
After
Front
How does the inverse of a composition of relations behave?
Back
Let \(\rho: A \to B\) and \(\sigma: B \to C\). Then:
\[\widehat{\rho \sigma} = \hat{\sigma}\hat{\rho}\]
(The inverse of a composition reverses the order)
There are uncomputable functions \(\mathbb{N} \to \{0, 1\}\) because {{c1::the set of functions \(\mathbb{N} \to \{0, 1\}\) is uncountable (Cantor's diagonalization argument), but the set of programs \(\{0, 1\}^*\) computing them is countable.}}
There are uncomputable functions \(\mathbb{N} \to \{0, 1\}\) because {{c1::the set of functions \(\mathbb{N} \to \{0, 1\}\) is uncountable (Cantor's diagonalization argument), but the set of programs \(\{0, 1\}^*\) computing them is countable.}}
Field-by-field Comparison
Field
Before
After
Text
There are <i>uncomputable functions</i> \(\mathbb{N} \to \{0, 1\}\) because {{c1::the set of functions \(\mathbb{N} \to \{0, 1\}\) is uncountable (<i>Cantor's diagonalization argument</i>), but the set of programs \(\{0, 1\}^*\) computing them is countable.}}
For what \(m\) is \(\mathbb{Z}^*_m\) cyclic? (Theorem 5.15)
The group ℤ*_m is cyclic if and only if: • \(m = 2\) • \(m = 4\) • \(m = p^e\) (where p is an odd prime and \(e ≥ 1\)) • \(m = 2p^e\) (where p is an odd prime and \(e ≥ 1\)) Example: Is \(\mathbb{Z}^*_{19}\) cyclic? What is a generator? Yes, \(\mathbb{Z}^*_{19}\) is cyclic (since \(19\) is an odd prime).
For what \(m\) is \(\mathbb{Z}^*_m\) cyclic? (Theorem 5.15)
Back
The group ℤ*_m is cyclic if and only if:<br>• \(m = 2\)<br>• \(m = 4\)<br>• \(m = p^e\) (where p is an odd prime and \(e ≥ 1\))<br>• \(m = 2p^e\) (where p is an odd prime and \(e ≥ 1\)) Example: Is \(\mathbb{Z}^*_{19}\) cyclic? What is a generator? Yes, \(\mathbb{Z}^*_{19}\) is cyclic (since \(19\) is an odd prime).<br><br>2 is a generator.<br><br>Powers of 2: 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10, 1<br><br>Other generators: 3, 10, 13, 14, 15
An element \(a\ne0\) of a commutative ring \(R\) is called a zerodivisor if \(ab=0\) for some \(b\ne0\) in \(R\).
Field-by-field Comparison
Field
Before
After
Text
An element \(a\ne0\) of a commutative ring \(R\) is called a <i>zerodivisor</i> if {{c1:: \(ab=0\) for some \(b\ne0\) in \(R\)}}.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \ldots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \cdots \times G_n; \star\rangle\). The operation \(\star\) is component-wise.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \ldots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \cdots \times G_n; \star\rangle\). The operation \(\star\) is component-wise.
Field-by-field Comparison
Field
Before
After
Text
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \ldots, \langle G_n; *_n \rangle\) is {{c1::the algebra \(\langle G_1 \times \cdots \times G_n; \star\rangle\)}}. The operation \(\star\) is component-wise.
Why does \(ax \equiv_m 1\) have no solution when \(\text{gcd}(a, m) = d > 1\)?
We can rewrite \(ax \equiv_m 1\) as \(ax - 1 = km \Leftrightarrow ax - km = 1\). Now since, \(d | a\) and \(d | m\), then \(d | ax\) and \(d | km\) for any \(x\). Thus \(d | (ax - km)\), and \(ax - km = 1\).
But \(d \nmid 1 \implies d \nmid (ax - km)\), which is a contradiction. Thus \(ax\) can never be congruent to \(1\) modulo \(m\).
Field-by-field Comparison
Field
Before
After
Front
Why does \(ax \equiv_m 1\) have no solution when \(\text{gcd}(a, m) = d > 1\)?
Back
We can rewrite \(ax \equiv_m 1\) as \(ax - 1 = km \Leftrightarrow ax - km = 1\). Now since, \(d | a\) and \(d | m\), then \(d | ax\) and \(d | km\) for any \(x\).<br>Thus \(d | (ax - km)\), and \(ax - km = 1\).<br><br>But \(d \nmid 1 \implies d \nmid (ax - km)\), which is a contradiction. Thus \(ax\) can never be congruent to \(1\) modulo \(m\).
A code \(\mathcal{C}\) with minimum distance \(d\) is \(t\)-error correcting if and only if:
\(d \geq 2t + 1\).
Intuition: To correct \(t\) errors, codewords must be at least \(2t + 1\) apart (so that even with \(t\) errors, the received word is closer to the correct codeword than to any other).
If they were only \(2t\) apart for each codeword, then there would be a tie.
Field-by-field Comparison
Field
Before
After
Front
<p>A code \(\mathcal{C}\) with minimum distance \(d\) is \(t\)-error correcting if and only if:</p>
Back
<p>\(d \geq 2t + 1\).</p>
<p><strong>Intuition</strong>: To correct \(t\) errors, codewords must be at least \(2t + 1\) apart (so that even with \(t\) errors, the received word is closer to the correct codeword than to any other).</p>
<p>If they were only \(2t\) apart for each codeword, then there would be a <strong>tie</strong>.</p>
We can reduce the exponent \(a^m\) modulo \(n\) by {{c1::the \(\text{ord}(a)\)}} iff. \(\gcd(a, n) = 1\), i.e. \(a\) and \(n\) are coprime.
This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\).
Field-by-field Comparison
Field
Before
After
Text
We can reduce the exponent \(a^m\) modulo \(n\) by {{c1::the \(\text{ord}(a)\)}} iff. {{c2::\(\gcd(a, n) = 1\), i.e. \(a\) and \(n\) are coprime}}.
Extra
This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\).
Lemma 5.6: In a finite group \(G\), every element has a finite order.
(This doesn't hold for infinite groups - elements can have infinite order.)
Field-by-field Comparison
Field
Before
After
Front
<p>What is the order of elements in finite groups.</p>
Back
<p><strong>Lemma 5.6</strong>: In a <strong>finite group</strong> \(G\), every element has a <strong>finite order</strong>.</p>
<p>(This doesn't hold for infinite groups - elements can have infinite order.)</p>
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) (also called Euler's totient function) is defined as {{c1::the cardinality of \(\mathbb{Z}^*_m\).}}
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) (also called Euler's totient function) is defined as {{c1::the cardinality of \(\mathbb{Z}^*_m\).}}
Example: \(\mathbb{Z}_{18}^* = \{1,5,7,11,13,17\}\), so \(\varphi(18) = 6\)
Field-by-field Comparison
Field
Before
After
Text
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) (also called Euler's totient function) is defined as {{c1::the cardinality of \(\mathbb{Z}^*_m\).}}
Why is closure important when verifying that \(H\) is a subgroup of \(G\)?
Closure ensures that when you apply operations within \(H\), you stay within \(H\).
Without closure:
- \(a * b\) might not be in \(H\) (operation closure)
- \(\widehat{a}\) might not be in \(H\) (inverse closure)
- The neutral element \(e\) might not be in \(H\)
If \(H\) lacks closure, it cannot form a group on its own.
Field-by-field Comparison
Field
Before
After
Front
<p>Why is closure important when verifying that \(H\) is a subgroup of \(G\)?</p>
Back
<p>Closure ensures that when you apply operations within \(H\), you <strong>stay within</strong> \(H\).</p>
<p>Without closure:<br>
- \(a * b\) might not be in \(H\) (operation closure)<br>
- \(\widehat{a}\) might not be in \(H\) (inverse closure)<br>
- The neutral element \(e\) might not be in \(H\)</p>
<p>If \(H\) lacks closure, it cannot form a group on its own.</p>
The transitive closure of a relation \(\rho\) on a set \(A\), denoted \(\rho^*\), is defined as {{c1::\(\rho^* = \bigcup_{n\in\mathbb{N}\setminus \{0\} } \rho^n\)}}.
The transitive closure of a relation \(\rho\) on a set \(A\), denoted \(\rho^*\), is defined as {{c1::\(\rho^* = \bigcup_{n\in\mathbb{N}\setminus \{0\} } \rho^n\)}}.
Field-by-field Comparison
Field
Before
After
Text
The <b>transitive closure </b>of a relation \(\rho\) on a set \(A\), denoted \(\rho^*\), is defined as {{c1::\(\rho^* = \bigcup_{n\in\mathbb{N}\setminus \{0\} } \rho^n\)}}.
The Fermat-Euler theorem states that for all \(m\ge 2\) and all \(a\) with \(\gcd(a,m) = 1\),{{c1:: \[a^{\varphi(m)} \equiv_m 1\]and so in particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \(a^{p-1} \equiv_p 1\).}}
The Fermat-Euler theorem states that for all \(m\ge 2\) and all \(a\) with \(\gcd(a,m) = 1\),{{c1:: \[a^{\varphi(m)} \equiv_m 1\]and so in particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \(a^{p-1} \equiv_p 1\).}}
This theorem is used for RSA.
Field-by-field Comparison
Field
Before
After
Text
The Fermat-Euler theorem states that for all \(m\ge 2\) and all \(a\) with \(\gcd(a,m) = 1\),{{c1:: \[a^{\varphi(m)} \equiv_m 1\]and so in particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \(a^{p-1} \equiv_p 1\).}}
A function \(f: A\to B\) from a domain \(A\) to a codomain \(B\) is a relation from \(A\) to \(B\) with the special properties: {{c1::1. (totally defined) \(\forall a\in A \; \exists b \in B \quad a \mathop{f} b\) 2. (well-defined) \(\forall a\in A \; \forall b, b' \in B \quad (a \mathop{f} b \land a\mathop{f}b' \to b = b')\)}}
A function \(f: A\to B\) from a domain \(A\) to a codomain \(B\) is a relation from \(A\) to \(B\) with the special properties: {{c1::1. (totally defined) \(\forall a\in A \; \exists b \in B \quad a \mathop{f} b\) 2. (well-defined) \(\forall a\in A \; \forall b, b' \in B \quad (a \mathop{f} b \land a\mathop{f}b' \to b = b')\)}}
Field-by-field Comparison
Field
Before
After
Text
A <b>function</b> \(f: A\to B\) from a <i>domain</i> \(A\) to a <i>codomain</i> \(B\) is {{c1::a relation from \(A\) to \(B\)}} with the special properties:<br>{{c1::1. (totally defined) \(\forall a\in A \; \exists b \in B \quad a \mathop{f} b\)<br>2. (well-defined) \(\forall a\in A \; \forall b, b' \in B \quad (a \mathop{f} b \land a\mathop{f}b' \to b = b')\)}}
How do polynomials behave under modular reduction? (Corollary 4.15)
Let \(f(x_1, \dots, x_k)\) be a polynomial with integer coefficients, and let \(m \geq 1\). If \(a_i \equiv_m b_i\) for \(1 \leq i \leq k\), then:
\[f(a_1, \dots, a_k) \equiv_m f(b_1, \dots, b_k)\]
Field-by-field Comparison
Field
Before
After
Front
How do polynomials behave under modular reduction? (Corollary 4.15)
Back
Let \(f(x_1, \dots, x_k)\) be a polynomial with integer coefficients, and let \(m \geq 1\). If \(a_i \equiv_m b_i\) for \(1 \leq i \leq k\), then:
\[f(a_1, \dots, a_k) \equiv_m f(b_1, \dots, b_k)\]
The Hasse diagram of a poset \((A; \preceq)\) is the directed graph whose vertices are the elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).
The Hasse diagram of a poset \((A; \preceq)\) is the directed graph whose vertices are the elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).
Field-by-field Comparison
Field
Before
After
Text
The <i>Hasse diagram</i> of a poset \((A; \preceq)\) is {{c1::the directed graph whose vertices are the elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).}}
Special case of constructive existence proofs. By finding a counter example \( x\) such that \(S_x\) is not true, we can prove that \( S_i \) isn't always true.
Field-by-field Comparison
Field
Before
After
Front
Proof method: Proofs by counterexample
Back
Special case of constructive existence proofs. By finding a counter example \( x\) such that \(S_x\) is not true, we can prove that \( S_i \) isn't always true.
Theorem 5.13: \(\langle \mathbb{Z}_m^*; \odot, \text{ }^{-1}, 1 \rangle\) is a group.
Proof idea: For \(a, b \in \mathbb{Z}_m^*\), if \(\gcd(a, m) = 1\) and \(\gcd(b, m) = 1\), then \(\gcd(ab, m) = 1\). Thus the group is closed under multiplication.
Field-by-field Comparison
Field
Before
After
Front
<p>Is \(\mathbb{Z}_m^*\) a group?.</p>
Back
<p><strong>Theorem 5.13</strong>: \(\langle \mathbb{Z}_m^*; \odot, \text{ }^{-1}, 1 \rangle\) is a <strong>group</strong>.</p>
<p><strong>Proof idea</strong>: For \(a, b \in \mathbb{Z}_m^*\), if \(\gcd(a, m) = 1\) and \(\gcd(b, m) = 1\), then \(\gcd(ab, m) = 1\). Thus the group is closed under multiplication.</p>
Basically, show for all cases that they are correct.
Field-by-field Comparison
Field
Before
After
Front
Proof method: "Case Distinction"
Back
1. Find a finite list \( R_1, \ldots, R_k\) of statements (cases)<div>2. Prove that one case applies for the situation (prove one \(R_i\))</div><div>3. Prove \( R_i \implies S\) for \(i = 1, \ldots, k\)</div><div><br></div><div>Basically, show for all cases that they are correct.</div>
The group \(\mathbb{Z}^*_m\) contains all numbers \(a \in \mathbb{Z}_m\) that are coprime to \(m\), that is, \(\gcd(a,m) = 1\).
As they are coprime, they are invertible. Thus its the set of units.
Field-by-field Comparison
Field
Before
After
Text
The group \(\mathbb{Z}^*_m\) contains all numbers \(a \in \mathbb{Z}_m\) that are {{c1::coprime to \(m\), that is, \(\gcd(a,m) = 1\).}}
Extra
As they are coprime, they are invertible. Thus its the set of units.
When is writing \(\top\) or \(\perp\) allowed in formulas (proof steps for example)?
We are not allowed to use \(\top\) or \(\perp\) in formulas, to replace statement that are true or false under our interpretation.
It's only allowed when the formula is actually a tautology (or unsatisfiable), i.e. true or false under all interpretations!
For example, in \(U = \mathbb{N}\), \(x \geq 0 \land x = 5 \implies \top \land x = 5 \implies x = 5\) but this is wrong as \(x \geq 0\) is only equivalent to \(\top\) in this specific universe. We instead can just write the implication directly.
Field-by-field Comparison
Field
Before
After
Front
When is writing \(\top\) or \(\perp\) allowed in formulas (proof steps for example)?
Back
We are not allowed to use \(\top\) or \(\perp\) in formulas, to replace statement that are <b>true</b> or <b>false</b> under our interpretation.<br><br>It's only allowed when the formula is actually a tautology (or unsatisfiable), i.e. true or false under <b>all</b> interpretations!<br><br>For example, in \(U = \mathbb{N}\), \(x \geq 0 \land x = 5 \implies \top \land x = 5 \implies x = 5\) but this is wrong as \(x \geq 0\) is only equivalent to \(\top\) in this specific universe. We instead can just write the implication directly.
When is a decoding function \(t\)-error correcting?
A decoding function \(D\) is \(t\)-error-correcting for encoding function \(E\) if for any \((a_0, \dots, a_{k-1})\): \[D((r_0, \dots, r_{n-1})) = (a_0, \dots, a_{k-1})\] for any \((r_0, \dots, r_{n-1})\) with Hamming distance at most \(t\) from \(E((a_0, \dots, a_{k-1}))\).
In other words, every codeword with a maximum of \(t\) errors, is correctly decoded.
A code is \(t\)-error-correcting if there exists \(E\) and \(D\) with \(C = Im(D)\) where \(D\) is \(t\)-error-correcting.
Field-by-field Comparison
Field
Before
After
Front
<p>When is a decoding function \(t\)-error correcting?</p>
Back
<p>A decoding function \(D\) is \(t\)-error-correcting for encoding function \(E\) if for any \((a_0, \dots, a_{k-1})\): \[D((r_0, \dots, r_{n-1})) = (a_0, \dots, a_{k-1})\] for any \((r_0, \dots, r_{n-1})\) with Hamming distance at most \(t\) from \(E((a_0, \dots, a_{k-1}))\).</p>
<p><em>In other words</em>, every codeword with a maximum of \(t\) errors, is correctly decoded.</p>
<p>A code is \(t\)-error-correcting if there exists \(E\) and \(D\) with \(C = Im(D)\) where \(D\) is \(t\)-error-correcting.</p>
This holds because if \(a(x) = b(x) \cdot c(x)\), then \(a(x) = vb(x) \cdot (v^{-1} c(x))\).
Field-by-field Comparison
Field
Before
After
Front
<p>If \(b(x)\) divides \(a(x)\), then so does:</p>
Back
<p>\(v \cdot b(x)\) for any nonzero \(v \in F\).</p>
<p>This holds because if \(a(x) = b(x) \cdot c(x)\), then \(a(x) = vb(x) \cdot (v^{-1} c(x))\).</p>
What does "unique up to order" mean in the Fundamental Theorem of Arithmetic?
Every integer has exactly one prime factorization if we don't care about the order of factors. For example, \(12 = 2^2 \cdot 3 = 3 \cdot 2 \cdot 2 = 2 \cdot 3 \cdot 2\) are all the same factorization, just written differently.
Field-by-field Comparison
Field
Before
After
Front
What does "unique up to order" mean in the Fundamental Theorem of Arithmetic?
Back
Every integer has exactly one prime factorization if we don't care about the order of factors. For example, \(12 = 2^2 \cdot 3 = 3 \cdot 2 \cdot 2 = 2 \cdot 3 \cdot 2\) are all the same factorization, just written differently.
What is the order of \(\text{ord}(a)\) for \(a \in G\) in a group?
Let \(G\) be a group and let \(a\) be an element of \(G\). The order of \(a\), denoted \(\text{ord}(a)\), is the least \(m \geq 1\) such that \(a^m = e\), if such an \(m\) exists: \[\text{ord}(a) = \min \{n \geq 1 \ | \ a^n = e\} \cup \{\infty\}\]
If no such \(m\) exists, \(\text{ord}(a)\) is said to be infinite, written \(\text{ord}(a) = \infty\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is the order of \(\text{ord}(a)\) for \(a \in G\) in a group?</p>
Back
<p>Let \(G\) be a group and let \(a\) be an element of \(G\). The order of \(a\), denoted \(\text{ord}(a)\), is the least \(m \geq 1\) such that \(a^m = e\), if such an \(m\) exists: \[\text{ord}(a) = \min \{n \geq 1 \ | \ a^n = e\} \cup \{\infty\}\]</p>
<p>If no such \(m\) exists, \(\text{ord}(a)\) is said to be infinite, written \(\text{ord}(a) = \infty\).</p>
State Corollary 5.11 about groups of prime order (what property, what does each element satisfy).
Corollary 5.11: Every group of prime order is cyclic, and in such a group every element except the neutral element is a generator.
Proof: Only \(1 | p\) and \(p | p\) for \(p\) prime. So for \(a \in G\), either \(\text{ord}(a) = 1\) (meaning \(a = e\)) or \(\text{ord}(a) = p\) (meaning \(a\) generates the whole group).
Field-by-field Comparison
Field
Before
After
Front
<p>State Corollary 5.11 about groups of prime order (what property, what does each element satisfy).</p>
Back
<p><strong>Corollary 5.11</strong>: Every group of <strong>prime order</strong> is cyclic, and in such a group <strong>every element except the neutral element is a generator</strong>.</p>
<p><strong>Proof</strong>: Only \(1 | p\) and \(p | p\) for \(p\) prime. So for \(a \in G\), either \(\text{ord}(a) = 1\) (meaning \(a = e\)) or \(\text{ord}(a) = p\) (meaning \(a\) generates the whole group).</p>
Does \( p | a \land q | a \land \gcd(p, q) = 1 \implies pq | a \) hold?
Yes, but this has to be reproven before using.
The proof technique is important. Replacing a neutral element by something it's equal is often a smart move. Proof: This is an important result for the exam:
\[p \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a\]
Which is the same as saying \(\exists k \in \mathbb{Z}\) such that \(a = pq \cdot k\).
Since \(p \mid a\) and \(q \mid a\), we have:
\[\exists k, k' \in \mathbb{Z} \text{ such that } a = pk \land a = qk'\]
Since \(\gcd(p, q) = 1\), by Bézout's identity:
\[\exists u, v \in \mathbb{Z} \text{ such that } 1 = pu + qv\]
Now we can write:
\[\begin{align}
a &= 1 \cdot a \\
&= a \cdot (pu + qv) \\
&= pua + qva \\
&= pu \cdot qk' + qv \cdot pk \\
&= pq(uk' + vk')
\end{align}\]
Thus \(pq \mid a\). \(\square\)
Field-by-field Comparison
Field
Before
After
Front
Does \( p | a \land q | a \land \gcd(p, q) = 1 \implies pq | a \) hold?
Back
Yes, but this has to be reproven before using.<br><br>The proof technique is important. Replacing a neutral element by something it's equal is often a smart move.<br>
<b>Proof:</b> This is an important result for the exam:
<div>\[p \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a\]</div>
Which is the same as saying \(\exists k \in \mathbb{Z}\) such that \(a = pq \cdot k\).
<br>
Since \(p \mid a\) and \(q \mid a\), we have:
<div>\[\exists k, k' \in \mathbb{Z} \text{ such that } a = pk \land a = qk'\]</div>
Since \(\gcd(p, q) = 1\), by Bézout's identity:
<div>\[\exists u, v \in \mathbb{Z} \text{ such that } 1 = pu + qv\]</div>
Now we can write:
<div>\[\begin{align}
a &= 1 \cdot a \\
&= a \cdot (pu + qv) \\
&= pua + qva \\
&= pu \cdot qk' + qv \cdot pk \\
&= pq(uk' + vk')
\end{align}\]</div>
Thus \(pq \mid a\). \(\square\)
When does an element of \(F[x]_{m(x)}\) have an inverse?
Lemma 5.36: The congruence equation \[a(x)b(x) \equiv_{m(x)} 1\] for a given \(a(x)\) has a solution \(b(x) \in F[x]_{m(x)}\) if and only if \(\gcd(a(x), m(x)) = 1\). The solution is unique.
In other words: \[ F[x]_{m(x)}^* = \{a(x) \in F[x]_{m(x)} \ | \ \gcd(a(x), m(x)) = 1\} \]
This is analogous to \(\mathbb{Z}_m^*\).
Field-by-field Comparison
Field
Before
After
Front
<p>When does an element of \(F[x]_{m(x)}\) have an inverse?</p>
Back
<p><strong>Lemma 5.36</strong>: The congruence equation \[a(x)b(x) \equiv_{m(x)} 1\] for a given \(a(x)\) has a solution \(b(x) \in F[x]_{m(x)}\) <strong>if and only if</strong> \(\gcd(a(x), m(x)) = 1\). The solution is <strong>unique</strong>.</p>
<p>In other words: \[ F[x]_{m(x)}^* = \{a(x) \in F[x]_{m(x)} \ | \ \gcd(a(x), m(x)) = 1\} \]</p>
<p>This is analogous to \(\mathbb{Z}_m^*\).</p>
The generators of \(\langle \mathbb{Z}_n; \oplus \rangle\) are all \(g \in \mathbb{Z}_n\) for which \(\gcd(g, n) = 1\)(i.e., \(g\) is coprime to \(n\)).
The generators of \(\langle \mathbb{Z}_n; \oplus \rangle\) are all \(g \in \mathbb{Z}_n\) for which \(\gcd(g, n) = 1\)(i.e., \(g\) is coprime to \(n\)).
Field-by-field Comparison
Field
Before
After
Text
<p>The generators of \(\langle \mathbb{Z}_n; \oplus \rangle\) are all \(g \in \mathbb{Z}_n\) for which {{c1::\(\gcd(g, n) = 1\)(i.e., \(g\) is coprime to \(n\))}}.</p>
A formula of the form \[Q_1 x_1 \ Q_2 x_2 \ \dots \ Q_n x_n G\]where the \(Q_i\) are arbitrary quantifiers and \(G\) is a formula free of quantifiers.
Field-by-field Comparison
Field
Before
After
Front
<b>Prenex</b> form defintion:
Back
A formula of the form \[Q_1 x_1 \ Q_2 x_2 \ \dots \ Q_n x_n G\]where the \(Q_i\) are arbitrary quantifiers and \(G\) is a formula free of quantifiers.
Finding the \(e\)-th root is a hard problem (we have to try all possibilities) as long as we don't know the group order \(|G|\).
If we do, we can find d using the extended euclidean algorithm.
Field-by-field Comparison
Field
Before
After
Front
Why does RSA work, i.e. why can't we break it?
Back
Finding the \(e\)-th root is a hard problem (we have to try all possibilities) <b>as long as we don't know the group order </b>\(|G|\).<br><br>If we do, we can find d using the extended euclidean algorithm.
For any ring elements \(a\) and \(b\) in \(R\) (not both \(0\)), a ring element \(d\) is called a greatest common divisor of \(a\) and \(b\) if:
- \(d\) divides both \(a\) and \(a\)0
- Every common divisor of \(a\)1 and \(a\)2 divides \(a\)3
Formally: \[d \ | \ a \ \land \ d \ | \ b \ \land \ \forall c ((c \ | \ a \ \land \ c \ | \ b) \rightarrow c \ | \ d)\]
Field-by-field Comparison
Field
Before
After
Front
<p>In a ring, \(d\) is a gcd of \(a\) and \(b\) if:</p>
Back
<p>For any ring elements \(a\) and \(b\) in \(R\) (not both \(0\)), a ring element \(d\) is called a greatest common divisor of \(a\) and \(b\) if:<br>
- \(d\) divides both \(a\) and \(a\)0<br>
- Every common divisor of \(a\)1 and \(a\)2 divides \(a\)3</p>
<p>Formally: \[d \ | \ a \ \land \ d \ | \ b \ \land \ \forall c ((c \ | \ a \ \land \ c \ | \ b) \rightarrow c \ | \ d)\]</p>
What is the multiplicative inverse of \(a\) modulo \(m\)?
The unique solution \(x \in \mathbb{Z}_m\) to the congruence equation \(ax \equiv_m 1\), where \(\text{gcd}(a, m) = 1\). Denoted \(a^{-1} \pmod{m}\) or \(1/a \pmod{m}\).
Field-by-field Comparison
Field
Before
After
Front
What is the multiplicative inverse of \(a\) modulo \(m\)?
Back
The unique solution \(x \in \mathbb{Z}_m\) to the congruence equation \(ax \equiv_m 1\), where \(\text{gcd}(a, m) = 1\). Denoted \(a^{-1} \pmod{m}\) or \(1/a \pmod{m}\).
A formula \(F\) is a tautology (or valid) if it is true for all truth assignments of the involved propositional symbols. Denoted as \(\models F\) or \(\top\).
A formula \(F\) is a tautology (or valid) if it is true for all truth assignments of the involved propositional symbols. Denoted as \(\models F\) or \(\top\).
Field-by-field Comparison
Field
Before
After
Text
A formula \(F\) is a {{c1:: tautology (or valid)}} if it {{c2:: is true for <strong>all</strong> truth assignments of the involved propositional symbols}}. Denoted as {{c3:: \(\models F\) or \(\top\)}}.
The Cartesian product \(A \times B\) of sets \(A, B\) is {{c1::the set of all ordered pairs with the first component from \(A\) and the second component from \(B\): \(A\times B = \{(a,b)\mid a\in A \land b \in B\}\)}}.
The Cartesian product \(A \times B\) of sets \(A, B\) is {{c1::the set of all ordered pairs with the first component from \(A\) and the second component from \(B\): \(A\times B = \{(a,b)\mid a\in A \land b \in B\}\)}}.
Field-by-field Comparison
Field
Before
After
Text
The <b>Cartesian product </b>\(A \times B\) of sets \(A, B\) is {{c1::the set of all ordered pairs with the first component from \(A\) and the second component from \(B\): \(A\times B = \{(a,b)\mid a\in A \land b \in B\}\)}}.
What is the relationship between \(\exists x (P(x) \land Q(x))\) and \(\exists x P(x) \land \exists x Q(x)\)?
\(\exists x (P(x) \land Q(x)) \models \exists x P(x) \land \exists x Q(x)\)
(Note: This is logical consequence, NOT equivalence. The reverse doesn't hold!)
Field-by-field Comparison
Field
Before
After
Front
What is the relationship between \(\exists x (P(x) \land Q(x))\) and \(\exists x P(x) \land \exists x Q(x)\)?
Back
\(\exists x (P(x) \land Q(x)) \models \exists x P(x) \land \exists x Q(x)\)
<br>
(Note: This is logical consequence, NOT equivalence. The reverse doesn't hold!)
A function \( f: A \rightarrow B\) is surjective (or onto) if \( \forall b \ \exists a \ , b = f(a)\), i.e. every value is taken
Field-by-field Comparison
Field
Before
After
Text
A function \( f: A \rightarrow B\) is {{c1::surjective (or onto)}} if {{c2::\( \forall b \ \exists a \ , b = f(a)\), i.e. every value is taken}}
The order of an element \(a\) in a group (denoted \(\text{ord}(a)\)) is {{c1::the smallest \(m \ge 1\) such that \(a^m = e\). If such an \(m\) does not exist, \(\text{ord}(a) = \infty\)}}
The order of an element \(a\) in a group (denoted \(\text{ord}(a)\)) is {{c1::the smallest \(m \ge 1\) such that \(a^m = e\). If such an \(m\) does not exist, \(\text{ord}(a) = \infty\)}}
\(\text{ord}(e) = 1\) in any group
Field-by-field Comparison
Field
Before
After
Text
The order of an element \(a\) in a group (denoted \(\text{ord}(a)\)) is {{c1::the smallest \(m \ge 1\) such that \(a^m = e\). If such an \(m\) does not exist, \(\text{ord}(a) = \infty\)}}
Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\).
Then \(a(x)\) is given by Lagrange's Interpolation formula: \[a(x) = \sum_{i=1}^{d+1} \beta_i u_i(x)\] where the polynomial \(u_i(x)\) is: \[u_i(x) = \frac{{{c2::(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}}}{{{c3::(\alpha_i - \alpha_1) \cdots (\alpha_i - \alpha_{i-1})(\alpha_i - \alpha_{i+1}) \cdots (\alpha_i - \alpha_{d+1})}}}\]
Note that for \(u_i(x)\) to be well-defined, all constant terms \(\alpha_i - \alpha_j\) in the denominator must be invertible. This is guaranteed in a field since \(a_i - a_j \neq 0\) for \(i \neq j\) (as they are all distinct).
Field-by-field Comparison
Field
Before
After
Front
<p>Lagrange Interpolation for polynomials in a Field</p>
Back
<p>Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\).</p>
<p>Then \(a(x)\) is given by Lagrange's Interpolation formula: \[a(x) = \sum_{i=1}^{d+1} \beta_i u_i(x)\] where the polynomial \(u_i(x)\) is: \[u_i(x) = \frac{{{c2::(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}}}{{{c3::(\alpha_i - \alpha_1) \cdots (\alpha_i - \alpha_{i-1})(\alpha_i - \alpha_{i+1}) \cdots (\alpha_i - \alpha_{d+1})}}}\]</p>
<p>Note that for \(u_i(x)\) to be well-defined, all constant terms \(\alpha_i - \alpha_j\) in the denominator must be invertible. This is guaranteed in a field since \(a_i - a_j \neq 0\) for \(i \neq j\) (as they are all distinct).</p>
Since \((2^3)^2 \neq 2^{(3^2)}\), exponentiation is not associative.
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of a binary operation that is <strong>not</strong> associative and demonstrate why.</p>
Back
<p><strong>Exponentiation</strong> on the integers is not associative.</p>
<p><strong>Example</strong>:<br>
- \((2^3)^2 = 8^2 = 64\)<br>
- \(2^{(3^2)} = 2^9 = 512\)</p>
<p>Since \((2^3)^2 \neq 2^{(3^2)}\), exponentiation is not associative.</p>
Theorem 5.8 (Lagrange's Theorem): Let \(G\) be a finite group and let \(H\) be a subgroup of \(G\). Then the order of \(H\) divides the order of \(G\), i.e., \(|H|\) divides \(|G|\).
Written: \(|H| \ | \ |G|\)
Field-by-field Comparison
Field
Before
After
Front
<p>State Lagrange's Theorem (Theorem 5.8).</p>
Back
<p><strong>Theorem 5.8 (Lagrange's Theorem)</strong>: Let \(G\) be a finite group and let \(H\) be a subgroup of \(G\). Then the order of \(H\) <strong>divides</strong> the order of \(G\), i.e., \(|H|\) divides \(|G|\).</p>
<p>Written: \(|H| \ | \ |G|\)</p>
What important property do ideals in \(\mathbb{Z}\) have? (Lemma 4.3)
For \(a, b \in \mathbb{Z}\), there exists \(d \in \mathbb{Z}\) such that \((a, b) = (d)\).
Every ideal can be generated by a single integer.
Field-by-field Comparison
Field
Before
After
Front
What important property do ideals in \(\mathbb{Z}\) have? (Lemma 4.3)
Back
For \(a, b \in \mathbb{Z}\), there exists \(d \in \mathbb{Z}\) such that \((a, b) = (d)\).
<br>
<strong>Every ideal</strong> can be generated by a <strong>single integer</strong>.
How does \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) relate to equivalence classes of modulo?
\(\mathbb{Z}_m\) is the set of canonical representatives from \(\mathbb{Z} / \equiv_m\). Each element of \(\mathbb{Z}_m\) represents one of the \(m\) equivalence classes of integers congruent modulo \(m\).
Field-by-field Comparison
Field
Before
After
Front
How does \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) relate to equivalence classes of modulo?
Back
\(\mathbb{Z}_m\) is the set of <strong>canonical representatives</strong> from \(\mathbb{Z} / \equiv_m\). Each element of \(\mathbb{Z}_m\) represents one of the \(m\) equivalence classes of integers congruent modulo \(m\).
Lemma 5.5(i): A group homomorphism \(\psi: G \rightarrow H\) maps the neutral element to the neutral element: \(\psi(e) = e'\).
Field-by-field Comparison
Field
Before
After
Text
<p><strong>Lemma 5.5(i)</strong>: A group homomorphism \(\psi: G \rightarrow H\) maps the neutral element to {{c1::the neutral element: \(\psi(e) = e'\)}}.</p>
The Hamming distance between two strings of equal length over a finite alphabet \(\mathcal{A}\) is the number of positions at which the two strings differ.
The Hamming distance between two strings of equal length over a finite alphabet \(\mathcal{A}\) is the number of positions at which the two strings differ.
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::Hamming distance}} between two strings of equal length over a finite alphabet \(\mathcal{A}\) is the {{c2::number of positions at which the two strings differ}}.</p>
Indirect proof of \( S \implies T \): Assume T is false, prove that S is false.
Follows from \( (\neg B \to \neg A) \models (A \to B) \)
Field-by-field Comparison
Field
Before
After
Front
<i>Proof method:</i> "Indirect Proof of an Implication"
Back
Indirect proof of \( S \implies T \): Assume T is false, prove that S is false.<div><br></div><div>Follows from \( (\neg B \to \neg A) \models (A \to B) \)</div>
Why is Bézout's identity useful for finding modular inverses?
If \(\text{gcd}(a, m) = 1\), then \(ua + vm = 1\) for some \(u, v\). This means \(ua = 1 - vm\), so \(ua \equiv_m 1\), making \(u\) the multiplicative inverse of \(a\) modulo \(m\).
Field-by-field Comparison
Field
Before
After
Front
Why is Bézout's identity useful for finding modular inverses?
Back
If \(\text{gcd}(a, m) = 1\), then \(ua + vm = 1\) for some \(u, v\). This means \(ua = 1 - vm\), so \(ua \equiv_m 1\), making \(u\) the multiplicative inverse of \(a\) modulo \(m\).
State Theorem 5.37 about when \(F[x]_{m(x)}\) is a field.
Theorem 5.37: The ring \(F[x]_{m(x)}\) is a field if and only if \(m(x)\) is irreducible.
Explanation: If \(m(x)\) is irreducible, then \(\gcd(a(x), m(x)) = 1\) for all non-zero \(a(x)\) in \(F[x]_{m(x)}\), so all elements (except \(0\)) are units.
Field-by-field Comparison
Field
Before
After
Front
<p>State Theorem 5.37 about when \(F[x]_{m(x)}\) is a field.</p>
Back
<p><strong>Theorem 5.37</strong>: The ring \(F[x]_{m(x)}\) is a field <strong>if and only if</strong> \(m(x)\) is <strong>irreducible</strong>.</p>
<p><strong>Explanation</strong>: If \(m(x)\) is irreducible, then \(\gcd(a(x), m(x)) = 1\) for all non-zero \(a(x)\) in \(F[x]_{m(x)}\), so all elements (except \(0\)) are units.</p>
Every statement \(s \in \mathcal{S}\) is either true or false as assigned by the {{c2:: truth function \(\tau : \mathcal{S} \rightarrow \{0,1\}\) which assigns to each statement it's truth value}}.
Every statement \(s \in \mathcal{S}\) is either true or false as assigned by the {{c2:: truth function \(\tau : \mathcal{S} \rightarrow \{0,1\}\) which assigns to each statement it's truth value}}.
Field-by-field Comparison
Field
Before
After
Text
Every statement \(s \in \mathcal{S}\) is {{c1:: either true or false}} as assigned by the {{c2:: truth function \(\tau : \mathcal{S} \rightarrow \{0,1\}\) which assigns to each statement it's <b>truth value</b>}}.
\(A\) is countable if and only if \(A \sim \mathbb{N}\) or \(A \sim \mathbf{n}\) for some \(n \in \mathbb{N}\) (i.e., \(A\) is finite or equinumerous with \(\mathbb{N}\)).
Conclusion: No cardinality level exists between finite and countably infinite.
Field-by-field Comparison
Field
Before
After
Front
What are the two types of countable sets?
Back
\(A\) is countable <strong>if and only if</strong> \(A \sim \mathbb{N}\) or \(A \sim \mathbf{n}\) for some \(n \in \mathbb{N}\) (i.e., \(A\) is finite or equinumerous with \(\mathbb{N}\)).
<br>
<strong>Conclusion</strong>: No cardinality level exists between finite and countably infinite.
If \(uv = vu = 1\) for some \(v \in R\) (we write \(v = u^{-1}\)), then \(u\) is a?
Unit.
Example The units of \(\mathbb{Z}\) are \(-1\) and \(1\). Therefore \(\mathbb{Z}^* = \{-1, 1\}\). In contrast, \(\mathbb{R}^* = \mathbb{R} \backslash \{0\}\), as we can divide any two numbers.
The set of units of \(R\) is denoted by \(R^*\).
Field-by-field Comparison
Field
Before
After
Front
<p>If \(uv = vu = 1\) for some \(v \in R\) (we write \(v = u^{-1}\)), then \(u\) is a?</p>
Back
<p>Unit.</p>
<p><strong>Example</strong> The units of \(\mathbb{Z}\) are \(-1\) and \(1\). Therefore \(\mathbb{Z}^* = \{-1, 1\}\). In contrast, \(\mathbb{R}^* = \mathbb{R} \backslash \{0\}\), as we can divide any two numbers.</p>
<p>The set of units of \(R\) is denoted by \(R^*\).</p>
What are the two key properties of the remainder function \(R_m\)? (Lemma 4.16)
(i) \(a \equiv_m R_m(a)\) (the remainder represents the equivalence class) (ii) \(a \equiv_m b \Longleftrightarrow R_m(a) = R_m(b)\) (congruence iff same remainder)
What are the two key properties of the remainder function \(R_m\)? (Lemma 4.16)
(i) \(a \equiv_m R_m(a)\) (the remainder represents the equivalence class) (ii) \(a \equiv_m b \Longleftrightarrow R_m(a) = R_m(b)\) (congruence iff same remainder)
Field-by-field Comparison
Field
Before
After
Text
What are the two key properties of the remainder function \(R_m\)? (Lemma 4.16)<br><br><strong>(i)</strong> {{c1:: \(a \equiv_m R_m(a)\) (the remainder represents the equivalence class)}}<br><b>(ii)</b> {{c2:: \(a \equiv_m b \Longleftrightarrow R_m(a) = R_m(b)\) (congruence iff same remainder)}}
The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the minimum of the Hamming distance between any two codewords.
The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the minimum of the Hamming distance between any two codewords.
Field-by-field Comparison
Field
Before
After
Text
<p>The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the {{c3::minimum of the Hamming distance}} between any two codewords.</p>
What is the greatest lower bound (glb) of a subset \(S\) in a poset?
The greatest element (by the relation, not just integer ordering) of the set of all lower bounds of \(S\). Also called the infimum.
Field-by-field Comparison
Field
Before
After
Front
What is the greatest lower bound (glb) of a subset \(S\) in a poset?
Back
The <strong>greatest element</strong> (by the relation, not just integer ordering) of the set of all lower bounds of \(S\). Also called the <strong>infimum</strong>.
When does an irreducible polynomial exist in \(\text{GF}(p)[x]\)?
For every prime \(p\) and every \(d > 1\), there exists an irreducible polynomial of degree \(d\) in \(\text{GF}(p)[x]\).
In particular, there exists a finite field with \(p^d\) elements.
Field-by-field Comparison
Field
Before
After
Front
<p>When does an irreducible polynomial exist in \(\text{GF}(p)[x]\)?</p>
Back
<p>For every prime \(p\) and every \(d > 1\), there exists an <strong>irreducible polynomial</strong> of degree \(d\) in \(\text{GF}(p)[x]\).</p>
<p>In particular, there exists a <strong>finite field</strong> with \(p^d\) elements.</p>
A group \(\langle G; * \rangle\) (or monoid) is called commutative or abelian if \(a * b = b * a\) for all \(a, b \in G\).
Field-by-field Comparison
Field
Before
After
Text
<p>A group \(\langle G; * \rangle\) (or monoid) is called {{c1::commutative}} or {{c1::abelian}} if {{c2::\(a * b = b * a\)}} for all \({{c3::a, b}} \in G\).</p>
For two groups \(\langle G; *, \widehat{\ \ }, e \rangle\) and \(\langle H; \star, \tilde{\ \ }, e' \rangle\), a function \(\psi: G \rightarrow H\) is called a group homomorphism if for all \(a\) and \(b\): \[.
This means the operation can be applied before or after the function with the same result.
For two groups \(\langle G; *, \widehat{\ \ }, e \rangle\) and \(\langle H; \star, \tilde{\ \ }, e' \rangle\), a function \(\psi: G \rightarrow H\) is called a group homomorphism if for all \(a\) and \(b\): \[.
This means the operation can be applied before or after the function with the same result.
Field-by-field Comparison
Field
Before
After
Text
<p>For two groups \(\langle G; *, \widehat{\ \ }, e \rangle\) and \(\langle H; \star, \tilde{\ \ }, e' \rangle\), a function \(\psi: G \rightarrow H\) is called a {{c1::group homomorphism}} if {{c2:: for all \(a\) and \(b\): \[{{c2::\psi(a * b) = \psi(a) \star \psi(b)}}\]}}.</p>
<p>This means the operation can be applied {{c3::before or after}} the function with the same result.</p>
In a finite group the function \(x \rightarrow x^e\) is a bijection if \(e\) coprime to \(|G|\). For \(x^e = y\), the inverse of \(y\) is the unique \(e\)th root \(x = y^d\).
In a finite group the function \(x \rightarrow x^e\) is a bijection if \(e\) coprime to \(|G|\). For \(x^e = y\), the inverse of \(y\) is the unique \(e\)th root \(x = y^d\).
Field-by-field Comparison
Field
Before
After
Text
In a finite group the function \(x \rightarrow x^e\) is {{c1:: a bijection}} if {{c2:: \(e\) coprime to \(|G|\)}}.<br>For \(x^e = y\), the inverse of \(y\) is {{c3:: the <b>unique</b> \(e\)th root \(x = y^d\)}}.
An irreducible polynomial of degree \(\geq 2\) has no roots in the field.
Proof: If it had a root \(\alpha\), then \((x - \alpha)\) would divide it by Lemma 5.29, contradicting irreducibility.
Field-by-field Comparison
Field
Before
After
Text
<p>An {{c1::irreducible}} polynomial of degree {{c2::\(\geq 2\)}} has {{c3::no roots}} in the field.</p>
<p><strong>Proof</strong>: If it had a root \(\alpha\), then \((x - \alpha)\) would divide it by Lemma 5.29, contradicting irreducibility.</p>
If two sets are countable, what about their Cartesian product?
The Cartesian product \(A \times B\) of two countable sets is also countable:
\[A \preceq \mathbb{N} \land B \preceq \mathbb{N} \Rightarrow A \times B \preceq \mathbb{N}\]
Field-by-field Comparison
Field
Before
After
Front
If two sets are countable, what about their Cartesian product?
Back
The Cartesian product \(A \times B\) of two countable sets is also countable:
\[A \preceq \mathbb{N} \land B \preceq \mathbb{N} \Rightarrow A \times B \preceq \mathbb{N}\]
If \(\psi: G \rightarrow H\) is a bijection and a homomorphism, then it is called an isomorphism, and we say that \(G\) and \(H\) are isomorphic and write \(G \simeq H\).
If \(\psi: G \rightarrow H\) is a bijection and a homomorphism, then it is called an isomorphism, and we say that \(G\) and \(H\) are isomorphic and write \(G \simeq H\).
Field-by-field Comparison
Field
Before
After
Text
<p>If \(\psi: G \rightarrow H\) is a {{c1::bijection}} and a homomorphism, then it is called an {{c2::isomorphism}}, and we say that \(G\) and \(H\) are {{c2::isomorphic}} and write {{c2::\(G \simeq H\)}}.</p>
An integral domain \(D\) is a (nontrivial, \(0 \neq 1\)) commutative ring without zerodivisors (\(ab = 0 \implies a = 0 \lor b = 0\))
Field-by-field Comparison
Field
Before
After
Text
<p>An {{c1::integral domain \(D\)}} is a {{c2::(nontrivial, \(0 \neq 1\)) commutative ring}} without {{c3::zerodivisors (\(ab = 0 \implies a = 0 \lor b = 0\))}}</p>
Is \(\langle \mathbb{Z}_n; \oplus \rangle\) abelian (commutative)?
Yes, \(\langle \mathbb{Z}_n; \oplus \rangle\) is abelian because addition modulo \(n\) is commutative: \[a \oplus b = (a + b) \bmod n = (b + a) \bmod n = b \oplus a\]
<p><strong>Yes</strong>, \(\langle \mathbb{Z}_n; \oplus \rangle\) is <strong>abelian</strong> because addition modulo \(n\) is commutative: \[a \oplus b = (a + b) \bmod n = (b + a) \bmod n = b \oplus a\]</p>
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
Field-by-field Comparison
Field
Before
After
Text
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a {{c2::least upper bound}}, then it is called the {{c1::<b>join </b>of \(a\) and \(b\) (also denoted \(a \lor b\)).}}
In a homomorphism \(\psi: G \rightarrow H\), does it matter whether you apply the operation before or after applying the function?
No, it doesn't matter! That's exactly what defines a homomorphism:
\[\psi(a *_G b) = \psi(a) *_H \psi(b)\]
You get the same result whether you:
- First operate in \(G\), then map to \(H\), OR
- First map both elements to \(H\), then operate in \(H\)
Field-by-field Comparison
Field
Before
After
Front
<p>In a homomorphism \(\psi: G \rightarrow H\), does it matter whether you apply the operation before or after applying the function?</p>
Back
<p><strong>No</strong>, it doesn't matter! That's exactly what defines a homomorphism:</p>
<p>\[\psi(a *_G b) = \psi(a) *_H \psi(b)\]</p>
<p>You get the same result whether you:<br>
- First operate in \(G\), then map to \(H\), OR<br>
- First map both elements to \(H\), then operate in \(H\)</p>
Why does Euclid's algorithm work? (Based on Lemma 4.2)
Because \(\text{gcd}(m, n) = \text{gcd}(m, R_m(n))\). We repeatedly replace the larger number with its remainder when divided by the smaller, preserving the GCD while reducing the problem size. Eventually we reach \(\text{gcd}(d, 0) = d\).
Field-by-field Comparison
Field
Before
After
Front
Why does Euclid's algorithm work? (Based on Lemma 4.2)
Back
Because \(\text{gcd}(m, n) = \text{gcd}(m, R_m(n))\). We repeatedly replace the larger number with its remainder when divided by the smaller, preserving the GCD while reducing the problem size. Eventually we reach \(\text{gcd}(d, 0) = d\).
Why must every common divisor of \(a\) and \(b\) also divide \(\text{gcd}(a,b)\)?
This is part of the definition of GCD - it's not just the largest common divisor by magnitude, but also the one that is divisible by all other common divisors. This makes it "greatest" in the divisibility ordering, not just in size.
Field-by-field Comparison
Field
Before
After
Front
Why must every common divisor of \(a\) and \(b\) also divide \(\text{gcd}(a,b)\)?
Back
This is part of the definition of GCD - it's not just the largest common divisor by magnitude, but also the one that is divisible by all other common divisors. This makes it "greatest" in the divisibility ordering, not just in size.
For a homomorphism \(h: G \rightarrow H\), the kernel \(\ker h\) is the set of all elements mapped to the neutral element (essentially the nullspace).
Field-by-field Comparison
Field
Before
After
Text
<p>For a homomorphism \(h: G \rightarrow H\), the {{c1::kernel \(\ker h\)}} is the set of all elements mapped to the {{c2::neutral element}} (essentially the {{c2::nullspace}}).</p>
Lemma 5.22(2): In \(D[x]\) where \(D\) is an integral domain, the degree of the product of two polynomials is?
The degree of their product is exactly the sum (not just at most) of their degrees.
This holds because \(ab \neq 0\) for all \(a,b \neq 0\) in an integral domain (no zerodivisors).
Field-by-field Comparison
Field
Before
After
Front
<p><strong>Lemma 5.22(2)</strong>: In \(D[x]\) where \(D\) is an integral domain, the degree of the product of two polynomials is?</p>
Back
<p>The degree of their product is exactly the sum (not just at most) of their degrees.</p>
<p>This holds because \(ab \neq 0\) for all \(a,b \neq 0\) in an integral domain (no zerodivisors).</p>
In the poset \((\{2, 3, 4, 5, 6, 7, 8, 9\}; |)\), identify the minimal and maximal elements.
Minimal elements: \(2, 3, 5, 7\) (primes)
Maximal elements: \(5, 6, 7, 8, 9\)
Least or greatest element There is none (not all elements comparable)
Field-by-field Comparison
Field
Before
After
Text
In the poset \((\{2, 3, 4, 5, 6, 7, 8, 9\}; |)\), identify the minimal and maximal elements.<br><ul><li><strong>Minimal elements</strong>: {{c1:: \(2, 3, 5, 7\) (primes)}}</li><li><strong>Maximal elements</strong>: {{c2:: \(5, 6, 7, 8, 9\)}}</li><li><strong>Least or greatest element</strong> {{c3:: There is none (not all elements comparable)}}</li></ul><div><img src="paste-1d2f8dcd3adedbac7c91aff60842c9ece732a3a8.jpg"></div>
In any ring \(\langle R; +, -, 0, \cdot, 1 \rangle\), if it's non trivial (more than one element) \(1 \neq 0\)
If \(1=0\), then for all \(a \in R\) : \(a=1⋅a=0⋅a=0\)
So the ring would be trivial (only contains 0).
Field-by-field Comparison
Field
Before
After
Text
In any ring \(\langle R; +, -, 0, \cdot, 1 \rangle\), if it's non trivial (more than one element) {{c1:: \(1 \neq 0\)}}
Extra
<div>If \(1=0\), then for all \(a \in R\) : \(a=1⋅a=0⋅a=0\)</div><div><br></div><div>So the ring would be trivial (only contains 0). </div>
We can transform every formula into:<br><ul><li>{{c1::<b>prenex</b>}}<br></li><li>{{c2::<b>CNF</b>}}<br></li><li>{{c3::<b>DNF</b>}}</li><li>{{c4::<b>Skolem</b>}}</li></ul>
Let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[F[x]_{m(x)} \ \overset{\text{def}}{=} \ \{a(x) \in F[x] \ | \ \deg(a(x)) < d\}\]
This is the set of all polynomials over \(F\) with degree strictly less than \(d\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is \(F[x]_{m(x)}\)?</p>
Back
<p>Let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[F[x]_{m(x)} \ \overset{\text{def}}{=} \ \{a(x) \in F[x] \ | \ \deg(a(x)) < d\}\]</p>
<p>This is the set of all polynomials over \(F\) with <strong>degree strictly less than \(d\)</strong>.</p>
What is the number of generators of \(\mathbb{Z}_n^*\)?
1. verify that \(\mathbb{Z}_n^*\)is cyclic (iff n = 2, 4, \(p^e\), \(2p^e\), with \(e \ge 1\) and \(p\) is an odd prime) 2. if \(\mathbb{Z}_n^*\) is cyclic then it is isomorphic to \(\mathbb{Z}_{\varphi(n)}^+\) (by lemma) 3. the number of generators of \(\mathbb{Z}_{\varphi(n)}^+\) is \(\varphi(\varphi(n))\) as it is the number of coprime elements of the group
Field-by-field Comparison
Field
Before
After
Front
What is the number of generators of \(\mathbb{Z}_n^*\)?
Back
1. verify that \(\mathbb{Z}_n^*\)is cyclic (iff n = 2, 4, \(p^e\), \(2p^e\), with \(e \ge 1\) and \(p\) is an odd prime)<br>2. if \(\mathbb{Z}_n^*\) is cyclic then it is isomorphic to \(\mathbb{Z}_{\varphi(n)}^+\) (by lemma) <br>3. the number of generators of \(\mathbb{Z}_{\varphi(n)}^+\) is \(\varphi(\varphi(n))\) as it is the number of coprime elements of the group
You can divide as in a field, the multiplicative monoid is also a group (without \(0\), thus \(0\) cannot be divided by - no inverse).
Field-by-field Comparison
Field
Before
After
Front
<p>In a field, you can:</p>
Back
<ul>
<li>add</li>
<li>subtract</li>
<li>multiply</li>
<li><em>divide</em> by any nonzero element.</li>
</ul>
<p>You can divide as in a field, the multiplicative monoid is also a <em>group</em> (without \(0\), thus \(0\) cannot be divided by - no inverse).</p>
What three properties must a relation have to be a partial order: 1. Reflexive 2. Antisymmetric 3. Transitive
Field-by-field Comparison
Field
Before
After
Text
What three properties must a relation have to be a partial order:<br>1. {{c1:: <b>Reflexive</b>}}<br>2. {{c2:: <b>Antisymmetric</b>}}<br>3. {{c3:: <b>Transitive</b>}}
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}.
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}.
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::Euler function}} \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}.</p>
Give the formal definition of the least common multiple \(\text{lcm}(a, b)\).
\[a | l \land b | l \land \forall m \ ((a | m \land b | m) \rightarrow l | m)\]
\(l\) is a common multiple of \(a\) and \(b\) which divides every common multiple of \(a\) and \(b\).
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of the least common multiple \(\text{lcm}(a, b)\).
Back
\[a | l \land b | l \land \forall m \ ((a | m \land b | m) \rightarrow l | m)\]
\(l\) is a common multiple of \(a\) and \(b\) which divides every common multiple of \(a\) and \(b\).
Lemma 5.34: Let \(F\) be a finite field with \(q\) elements and let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[|F[x]_{m(x)}| = q^d\]
Explanation: Each polynomial has \(d\) coefficients, and each coefficient can be any of \(q\) elements from \(F\).
Field-by-field Comparison
Field
Before
After
Front
<p>What is the cardinality of \(F[x]_{m(x)}\)?</p>
Back
<p><strong>Lemma 5.34</strong>: Let \(F\) be a finite field with \(q\) elements and let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[|F[x]_{m(x)}| = q^d\]</p>
<p><strong>Explanation</strong>: Each polynomial has \(d\) coefficients, and each coefficient can be any of \(q\) elements from \(F\).</p>
We are allowed to swap quantifier order in a formula if:
they are of the same type
the variables don't appear nested together
Field-by-field Comparison
Field
Before
After
Text
We are allowed to swap quantifier order in a formula if:<br><ul><li>{{c1:: they are of the same type}}</li><li>{{c2:: the variables don't appear nested together}}</li></ul>
For \(a,b,m\in\mathbb{Z}\) with \(m\ge1\), we say that \(a\) is congruent to \(b\) modulo \(m\) if \(m\) divides \(a-b\). Written as an expression: \(a\equiv_mb \iff m \mid (a-b)\).
For \(a,b,m\in\mathbb{Z}\) with \(m\ge1\), we say that \(a\) is congruent to \(b\) modulo \(m\) if \(m\) divides \(a-b\). Written as an expression: \(a\equiv_mb \iff m \mid (a-b)\).
Field-by-field Comparison
Field
Before
After
Text
For \(a,b,m\in\mathbb{Z}\) with \(m\ge1\), we say that \(a\) is <i>congruent to </i>\(b\) <i>modulo </i>\(m\) if {{c1:: \(m\) divides \(a-b\)}}. Written as an expression:{{c1:: \(a\equiv_mb \iff m \mid (a-b)\).}}
A partial order on a set \(A\) is a relation that is
* reflexive
* antisymmetric
* transitive
Examples: \(\leq, \geq\)
Field-by-field Comparison
Field
Before
After
Text
{{c1::A partial order}} on a set \(A\) is a relation that is<div>{{c2::<div>* reflexive</div><div>* antisymmetric</div><div>* transitive</div>}}<br></div>
A poset \((A; \preceq)\) is called totally ordered (also: linearly ordered) by \(\preceq\) if any two elements of the poset are comparable.
Example: \((\mathbb{Z}; \ge)\)
Field-by-field Comparison
Field
Before
After
Text
A poset \((A; \preceq)\) is called {{c2::<b>totally ordered</b> (also: linearly ordered) by \(\preceq\)}} if {{c1::any two elements of the poset are comparable.}}
\(\mathbb{Z}_m^*\) is useful compared to \(\mathbb{Z}_m\)because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), but we would like to have this for building RSA}}.
\(\mathbb{Z}_m^*\) is useful compared to \(\mathbb{Z}_m\)because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), but we would like to have this for building RSA}}.
Not all element in Zm have an inverse, something which Zm* guarantees by bezout.
Field-by-field Comparison
Field
Before
After
Text
\(\mathbb{Z}_m^*\) is useful compared to \(\mathbb{Z}_m\)because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), but we would like to have this for building RSA}}.
Extra
Not all element in Zm have an inverse, something which Zm* guarantees by bezout.
A relation ρ on a set A is called antisymmetric if {{c1::\( a \ \rho \ b \wedge b \ \rho \ a \implies a = b\) is true, i.e. if \( \rho \cap \hat{\rho} \subseteq \text{id}\)}}
A relation ρ on a set A is called antisymmetric if {{c1::\( a \ \rho \ b \wedge b \ \rho \ a \implies a = b\) is true, i.e. if \( \rho \cap \hat{\rho} \subseteq \text{id}\)}}
Example: \( \le, \ge\) and the division relation: \( a \mid b \wedge b \mid a \implies a = b\)
Field-by-field Comparison
Field
Before
After
Text
A relation ρ on a set A is called {{c2::antisymmetric}} if {{c1::\( a \ \rho \ b \wedge b \ \rho \ a \implies a = b\) is true, i.e. if \( \rho \cap \hat{\rho} \subseteq \text{id}\)}}
Extra
Example: \( \le, \ge\) and the division relation: \( a \mid b \wedge b \mid a \implies a = b\)
1. Basis Step: Prove \(P(0)\) (or \(P(1)\) or \(P(k)\) depending on universe)
2. Induction Step: Prove that for any arbitrary \(n\), \(P(n) \Rightarrow P(n+1)\) (assuming \(P(n)\) as the induction hypothesis)
Field-by-field Comparison
Field
Before
After
Front
What are the two steps of a proof by induction?
Back
1. <strong>Basis Step</strong>: Prove \(P(0)\) (or \(P(1)\) or \(P(k)\) depending on universe)
<br>2. <strong>Induction Step</strong>: Prove that for any arbitrary \(n\), \(P(n) \Rightarrow P(n+1)\) (assuming \(P(n)\) as the induction hypothesis)
This is the set of all elements in \(\mathbb{Z}_m\) that are coprime to \(m\).
Field-by-field Comparison
Field
Before
After
Front
<p>\(\mathbb{Z}_m^*\) is defined as?</p>
Back
<p>\[ \overset{\text{def}}{=} \ \{a \in \mathbb{Z}_m \ | \ \gcd(a, m) = 1\} \]</p><br><p>This is the set of all elements in \(\mathbb{Z}_m\) that are coprime to \(m\).</p>
To show that a newly defined operator can be used to express any formula, we show that:
\(\lnot F\), \(F \lor G\) and \(F \land G\) can be rewritten only in terms of it.
For example NOT, AND, OR can be expressed in NAND form, thus we can rewritten in CNF (or DNF) then NANDs (by simply replacing).
Field-by-field Comparison
Field
Before
After
Front
To show that a newly defined operator can be used to express any formula, we show that:
Back
\(\lnot F\), \(F \lor G\) and \(F \land G\) can be rewritten <b>only</b> in terms of it.<br><br>For example NOT, AND, OR can be expressed in NAND form, thus we can rewritten in CNF (or DNF) then NANDs (by simply replacing).
A proof that \(S_x\) is not true for all \(x \in X\) by exhibiting an \(a\) (called a counterexample) such that \(S_a\) is false.
Field-by-field Comparison
Field
Before
After
Front
What is a proof by counterexample?
Back
A proof that \(S_x\) is <strong>not</strong> true for all \(x \in X\) by exhibiting an \(a\) (called a counterexample) such that \(S_a\) is <strong>false</strong>.
That is, it's hard to find \(x_A\) from \(g^{x_A} \mod p\), knowing \(g\).
Field-by-field Comparison
Field
Before
After
Front
DHKE works because?
Back
The <b>discrete logarithm</b> problem is hard!<br><br>That is, it's hard to find \(x_A\) from \(g^{x_A} \mod p\), knowing \(g\).
Does the uniqueness of the neutral element imply that a group is abelian (commutative)?
I.e. does a*e = e*a mean G is abelian?
No! The uniqueness of the neutral element does not imply commutativity.
Counterexample: The identity matrix \(I_3\) is the unique neutral element for the group of \(3 \times 3\) real matrices under multiplication. We have \(A \cdot I_3 = I_3 \cdot A\) for all matrices \(A\), even though matrix multiplication is not commutative in general.
Field-by-field Comparison
Field
Before
After
Front
<p>Does the uniqueness of the neutral element imply that a group is abelian (commutative)?</p><br><br>I.e. does a*e = e*a mean G is abelian?
Back
<p><strong>No!</strong> The uniqueness of the neutral element does <strong>not</strong> imply commutativity.</p><br><p><strong>Counterexample</strong>: The identity matrix \(I_3\) is the unique neutral element for the group of \(3 \times 3\) real matrices under multiplication. We have \(A \cdot I_3 = I_3 \cdot A\) for all matrices \(A\), even though matrix multiplication is <strong>not commutative</strong> in general.</p>
Theorem 5.42: Let \(\mathcal{A} = \text{GF}(q)\) and let \(\alpha_0, \dots, \alpha_{n-1}\) be arbitrary distinct elements of \(\text{GF}(q)\). Encode by polynomial evaluation: \[E((a_0, \dots, a_{k-1})) = (a(\alpha_0), \dots, a(\alpha_{n-1}))\] where \(a(x)\) is the polynomial with coefficients \((a_0, \dots, a_{k-1})\).
The code has minimum distance \(d_{\min} = n - k + 1\).
Key property: The polynomial can be interpolated from any \(k\) values by Lagrangian interpolation. Two codewords cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.
Field-by-field Comparison
Field
Before
After
Front
<p>What is a polynomial based encoding function?</p>
Back
<p><strong>Theorem 5.42</strong>: Let \(\mathcal{A} = \text{GF}(q)\) and let \(\alpha_0, \dots, \alpha_{n-1}\) be arbitrary distinct elements of \(\text{GF}(q)\). Encode by polynomial evaluation: \[E((a_0, \dots, a_{k-1})) = (a(\alpha_0), \dots, a(\alpha_{n-1}))\] where \(a(x)\) is the polynomial with coefficients \((a_0, \dots, a_{k-1})\).</p>
<p>The code has minimum distance \(d_{\min} = n - k + 1\).</p>
<p><strong>Key property</strong>: The polynomial can be interpolated from any \(k\) values by Lagrangian interpolation. Two codewords cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.</p>
How do you perform polynomial division when the divisor is not monic (e.g., in \(\text{GF}(7)[x]\))?
If dividing by a non-monic polynomial like \(4x + 2\) in \(\text{GF}(7)[x]\):
Find the multiplicative inverse of the leading coefficient in the field
For \(4\) in \(\text{GF}(7)\): \(4 \cdot 2 \equiv_7 1\), so \(4^{-1} = 2\)
Multiply the polynomial by this inverse to make it monic
\(2 \cdot (4x + 2) = 8x + 4 \equiv_7 x + 4\)
Now divide by the monic polynomial
Example: \(3x^2 + 6x + 5\) divided by \(4x + 2\) becomes \(3x^2 + 6x + 5\) divided by \(\text{GF}(7)[x]\)0 (after multiplying by \(\text{GF}(7)[x]\)1).
Field-by-field Comparison
Field
Before
After
Front
<p>How do you perform polynomial division when the divisor is not monic (e.g., in \(\text{GF}(7)[x]\))?</p>
Back
<p>If dividing by a non-monic polynomial like \(4x + 2\) in \(\text{GF}(7)[x]\):</p>
<ol>
<li>Find the multiplicative inverse of the leading coefficient in the field</li>
<li>For \(4\) in \(\text{GF}(7)\): \(4 \cdot 2 \equiv_7 1\), so \(4^{-1} = 2\)</li>
<li>Multiply the polynomial by this inverse to make it monic</li>
<li>\(2 \cdot (4x + 2) = 8x + 4 \equiv_7 x + 4\)</li>
<li>Now divide by the monic polynomial</li>
</ol>
<p><strong>Example</strong>: \(3x^2 + 6x + 5\) divided by \(4x + 2\) becomes \(3x^2 + 6x + 5\) divided by \(\text{GF}(7)[x]\)0 (after multiplying by \(\text{GF}(7)[x]\)1).</p>
\(\text{GF}(q)\) is only finite if and only if \(q\) is a power of a prime, i.e. \(q = p^k\) for \(p\) prime.
Any two fields of the same size \(q\) are isomorphic.
Field-by-field Comparison
Field
Before
After
Front
<p>When is there a finite field with \(q\) elements?</p>
Back
<p>\(\text{GF}(q)\) is only finite <em>if and only if</em> \(q\) is a <em>power</em> of a prime, i.e. \(q = p^k\) for \(p\) prime.</p>
<p>Any two fields of the same size \(q\) are isomorphic.</p>
For the universe \(\mathbb{N}\) and an arbitrary unary predicate \(P\):
\[P(0) \land \forall n (P(n) \rightarrow P(n+1)) \Rightarrow \forall n P(n)\]
(If the base case holds and the induction step holds, then the property holds for all natural numbers)
Field-by-field Comparison
Field
Before
After
Front
What is the Principle of Mathematical Induction?
Back
For the universe \(\mathbb{N}\) and an arbitrary unary predicate \(P\):
\[P(0) \land \forall n (P(n) \rightarrow P(n+1)) \Rightarrow \forall n P(n)\]
<br>
(If the base case holds and the induction step holds, then the property holds for all natural numbers)
\(\langle S; * \rangle\) can have at most one neutral element.
There can be a distinct left and right neutral though.
Field-by-field Comparison
Field
Before
After
Front
<p>Can there be more than one neutral element?</p>
Back
<p>\(\langle S; * \rangle\) can have <strong>at most one neutral element</strong>.</p><p><br></p><p>There can be a distinct left and right neutral though.</p>
For DHKE, both Alice and Bob choose \(x_A, x_B\) (their private keys) at random. They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and with \(y_B\)analogously, which are their public keys}} which is sent over the network to their partner. The other {{c3:: then exponentiates by their private key to get the shared key \(k_{AB} \equiv_p y_B^{x_A} \equiv_p g^{x_B \cdot x_A} \equiv_p y_A^{x_B}\)}}.
For DHKE, both Alice and Bob choose \(x_A, x_B\) (their private keys) at random. They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and with \(y_B\)analogously, which are their public keys}} which is sent over the network to their partner. The other {{c3:: then exponentiates by their private key to get the shared key \(k_{AB} \equiv_p y_B^{x_A} \equiv_p g^{x_B \cdot x_A} \equiv_p y_A^{x_B}\)}}.
Field-by-field Comparison
Field
Before
After
Text
For DHKE, both Alice and Bob {{c1:: choose \(x_A, x_B\) (their private keys) at random}}.<br>They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and with \(y_B\)analogously, which are their public keys}} which is {{c2:: sent over the network to their partner}}.<br>The other {{c3:: then exponentiates by their private key to get the shared key \(k_{AB} \equiv_p y_B^{x_A} \equiv_p g^{x_B \cdot x_A} \equiv_p y_A^{x_B}\)}}.
If a set of \( n \) objects is divided into \( k < n\) sets, then at least one of the sets contains at least \( \left \lceil{\frac{n}{k}}\right \rceil\) objects.
Informally: If there are more objects than sets, there is a set with more than one object in it.
Field-by-field Comparison
Field
Before
After
Front
Proof method: Pigeonhole Principle
Back
If a set of \( n \) objects is divided into \( k < n\) sets, then at least one of the sets contains at least \( \left \lceil{\frac{n}{k}}\right \rceil\) objects.<div><br></div><div>Informally: If there are more objects than sets, there is a set with more than one object in it.</div>
If no \(m\) exists, such that \(a^m = e\) in a group, the order \(\text{ord}(a)\) of \(a\) is {{c1:: said to be infinite, written \(\text{ord}(a) = \infty\)}}.
If no \(m\) exists, such that \(a^m = e\) in a group, the order \(\text{ord}(a)\) of \(a\) is {{c1:: said to be infinite, written \(\text{ord}(a) = \infty\)}}.
Field-by-field Comparison
Field
Before
After
Text
<p>If {{c2:: no \(m\) exists, such that \(a^m = e\) in a group}}, the order \(\text{ord}(a)\) of \(a\) is {{c1:: said to be infinite, written \(\text{ord}(a) = \infty\)}}.</p>
The subset \(f(A)\) of \(B\) is called the image (also: range) of \(f\) and is also denoted \(Im(f)\).
Example: \(f(x) = x^2\), the range of \(f\) is \(\mathbb{R}^{\ge 0}\)
Field-by-field Comparison
Field
Before
After
Text
The {{c2::subset \(f(A)\) of \(B\)}} is called the {{c1::<b>image</b> (also: range) of \(f\)}} and is also denoted {{c1::\(Im(f)\)}}.
Extra
Example: \(f(x) = x^2\), the range of \(f\) is \(\mathbb{R}^{\ge 0}\)
An element \(p \in \mathcal{P}\) is either a valid proof for a statement \(s \in \mathcal{S}\) or it's not. this is defined by the {{c1:: verification function \(\phi : \mathcal{S} \times \mathcal{P} \rightarrow \{0, 1\}\) }}.
An element \(p \in \mathcal{P}\) is either a valid proof for a statement \(s \in \mathcal{S}\) or it's not. this is defined by the {{c1:: verification function \(\phi : \mathcal{S} \times \mathcal{P} \rightarrow \{0, 1\}\) }}.
\(\phi(s, p) = 1\) means that \(p\) is a valid proof for \(s\).
Field-by-field Comparison
Field
Before
After
Text
An element \(p \in \mathcal{P}\) is either a valid proof for a statement \(s \in \mathcal{S}\) or it's not. this is defined by the {{c1:: <b>verification function</b> \(\phi : \mathcal{S} \times \mathcal{P} \rightarrow \{0, 1\}\) }}.
Extra
\(\phi(s, p) = 1\) means that \(p\) is a valid proof for \(s\).
If \(p\) is a prime which divides the product \(x_1 x_2 \dots x_n\) of some integers, then \(p\) divides at least one of them: \[p | (x_1 x_2 \dots x_n) \Rightarrow \exists i \ p | x_i\]
If \(p\) is a prime which divides the product \(x_1 x_2 \dots x_n\) of some integers, then \(p\) divides at least one of them: \[p | (x_1 x_2 \dots x_n) \Rightarrow \exists i \ p | x_i\]
Field-by-field Comparison
Field
Before
After
Text
If \(p\) is a prime which divides the product \(x_1 x_2 \dots x_n\) of some integers, then \(p\) {{c1:: divides at least one of them: \[p | (x_1 x_2 \dots x_n) \Rightarrow \exists i \ p | x_i\]}}<br>
An expression using the propositional symbols \(A, B, C, \dots\) and logical operators \(\land, \lor, \lnot, \ldots\) is called a formula (of propositional logic).
An expression using the propositional symbols \(A, B, C, \dots\) and logical operators \(\land, \lor, \lnot, \ldots\) is called a formula (of propositional logic).
Field-by-field Comparison
Field
Before
After
Text
An {{c2::expression using the propositional symbols \(A, B, C, \dots\) and logical operators \(\land, \lor, \lnot, \ldots\)}} is called a {{c1::<i>formula</i> (of propositional logic)}}.
What is a Hasse diagram of a poset \((A; \preceq)\)?
A directed graph whose vertices are labeled with elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).
Field-by-field Comparison
Field
Before
After
Front
What is a Hasse diagram of a poset \((A; \preceq)\)?
Back
A directed graph whose vertices are labeled with elements of \(A\) and where there is an edge from \(a\) to \(b\) <strong>if and only if</strong> \(b\) <strong>covers</strong> \(a\).
What two properties must a relation \(f: A \to B\) have to be a function?
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\) 2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
What two properties must a relation \(f: A \to B\) have to be a function?
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\) 2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
Field-by-field Comparison
Field
Before
After
Text
What two properties must a relation \(f: A \to B\) have to be a function?<br><br>1. {{c1:: <strong>Totally defined</strong>: \(\forall a \in A \ \exists b \in B : a \ f \ b\) }}<br>2. {{c2:: <strong>Well-defined</strong>: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)}}
What is the transitive closure \(\rho^*\) of a relation \(\rho\)?
\[\rho^{*} = \bigcup_{n \in \mathbb{N} \setminus \{0\}} \rho^n\]
The "reachability relation" - \((a,b) \in \rho^*\) iff there's a path of finite length from \(a\) to \(b\) in \(\rho\).
Field-by-field Comparison
Field
Before
After
Front
What is the transitive closure \(\rho^*\) of a relation \(\rho\)?
Back
\[\rho^{*} = \bigcup_{n \in \mathbb{N} \setminus \{0\}} \rho^n\]
The "reachability relation" - \((a,b) \in \rho^*\) iff there's a path of finite length from \(a\) to \(b\) in \(\rho\).
The smallest subgroup of a group \(G\) containing \(a \in G\) is the group generated by \(a\), \(\langle a \rangle\).
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c2:: smallest}} subgroup of a group \(G\) containing \(a \in G\) is {{c1:: the group <em>generated by \(a\)</em>, \(\langle a \rangle\)}}.</p>
Equivalence relation is a relation on a set \(A\) that is
* reflexive
* symmetric
* transitive
Example: \(\equiv_m \)
Field-by-field Comparison
Field
Before
After
Text
{{c1::Equivalence relation}} is a relation on a set \(A\) that is<div>{{c2::<div>* reflexive</div><div>* symmetric</div><div>* transitive</div>}}<br></div>
A cyclic group of order \(n\) {{c1::is isomorphic to \(\langle \mathbb{Z}_n,\oplus)\), and hence commutative::has which useful property?}}.
Field-by-field Comparison
Field
Before
After
Text
A cyclic group of order \(n\) {{c1::is isomorphic to \(\langle \mathbb{Z}_n,\oplus)\), and hence commutative::has which useful property?}}.
A subgroup \(H\) of a group \(G\) is a subset \(H \subseteq G\) which is a group in itself (closed with respect to all operations, inverses exist).
Trivial subgroups: \(\{e\}, G\)
Field-by-field Comparison
Field
Before
After
Text
A subgroup \(H\) of a group \(G\) is {{c1::a subset \(H \subseteq G\) which is a group in itself (closed with respect to all operations, <b>inverses</b> exist).}}
What property does every finite field \(\text{GF}(q)\) have (and what does \(q\) satisfy)?
Theorem 5.40: The multiplicative group of every finite field \(\text{GF}(q)\) is cyclic (as \(q\) is a power of a prime, if \(\text{GF}(q)\) is cyclic).
This group has order \(q - 1\) and \(\varphi(q-1)\) generators.
Note that even though q is not prime thus not every integer is comprime, GF(q) is not Z_q.
Field-by-field Comparison
Field
Before
After
Front
<p>What property does every finite field \(\text{GF}(q)\) have (and what does \(q\) satisfy)?</p>
Back
<p><strong>Theorem 5.40</strong>: The multiplicative group of every finite field \(\text{GF}(q)\) is cyclic (as \(q\) is a power of a prime, if \(\text{GF}(q)\) is cyclic).</p>
<p>This group has order \(q - 1\) and \(\varphi(q-1)\) generators.</p><p><i>Note that even though q is not prime thus not every integer is comprime, GF(q) is <b>not</b> Z_q.</i></p>
no variable occurs both as a bound and as a free variable
all variables appearing after the quantifiers are distinct
Field-by-field Comparison
Field
Before
After
Text
<b>Rectified</b> form:<br><ul><li>{{c1::<b>no</b> variable occurs <b>both as a bound and as a free</b> variable}}</li><li>{{c2::<b>all</b> variables appearing <b>after the quantifiers</b> are distinct}}</li></ul>
Give an example of an extension field constructed from polynomials.
\(\mathbb{R}[x]_{x^2+1}\) is a field, isomorphic to \(\mathbb{C}\) (the complex numbers).
Explanation: \(x^2 + 1\) is irreducible over \(\mathbb{R}\) (no real roots). Elements of \(\mathbb{R}[x]_{x^2+1}\) are of the form \(a + bx\) where \(x^2 = -1\), which corresponds exactly to complex numbers \(a + bi\).
There are no other extension fields on \(\mathbb{R}\) that aren't isomorphic to \(\mathbb{C}\).
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of an extension field constructed from polynomials.</p>
Back
<p>\(\mathbb{R}[x]_{x^2+1}\) is a field, <strong>isomorphic to \(\mathbb{C}\)</strong> (the complex numbers).</p>
<p><strong>Explanation</strong>: \(x^2 + 1\) is irreducible over \(\mathbb{R}\) (no real roots). Elements of \(\mathbb{R}[x]_{x^2+1}\) are of the form \(a + bx\) where \(x^2 = -1\), which corresponds exactly to complex numbers \(a + bi\).</p>
<p>There are no other extension fields on \(\mathbb{R}\) that aren't isomorphic to \(\mathbb{C}\).</p>
Name the binding strengths of PL tokens in order:<br><ol><li>{{c1:: unary operators (NOT)}}</li><li>{{c2:: quantifiers (for all and exists)}}</li><li>{{c3:: operators (AND, OR)}}</li><li>{{c4:: Implication}}</li></ol>
State Lemma 5.20 about division in integral domains: (The quotient has what property?)
Lemma 5.20: In an integral domain, if \(a | b\) (i.e., \(b = ac\) for some \(c\)), then \(c\) is unique and is denoted by \(c = b/a\) (the quotient).
Explanation: If \(b = ac_1\) and \(b = ac_2\), then \(a(c_1 - c_2) = 0\). Since \(a \neq 0\) in an integral domain, we must have \(c_1 - c_2 = 0\), so \(b = ac\)0.
Field-by-field Comparison
Field
Before
After
Front
<p>State Lemma 5.20 about division in integral domains: (The quotient has what property?)</p>
Back
<p><strong>Lemma 5.20</strong>: In an integral domain, if \(a | b\) (i.e., \(b = ac\) for some \(c\)), then \(c\) is <strong>unique</strong> and is denoted by \(c = b/a\) (the quotient).</p>
<p><strong>Explanation</strong>: If \(b = ac_1\) and \(b = ac_2\), then \(a(c_1 - c_2) = 0\). Since \(a \neq 0\) in an integral domain, we must have \(c_1 - c_2 = 0\), so \(b = ac\)0.</p>
How does the GCD change when we subtract a multiple? (Lemma 4.2)
For any integers \(m, n\) and \(q\):
\[\text{gcd}(m, n - qm) = \text{gcd}(m, n)\]
This is the key property for Euclid's algorithm:
\[\text{gcd}(m, R_m(n)) = \text{gcd}(m, n)\]
Field-by-field Comparison
Field
Before
After
Front
How does the GCD change when we subtract a multiple? (Lemma 4.2)
Back
For any integers \(m, n\) and \(q\):
\[\text{gcd}(m, n - qm) = \text{gcd}(m, n)\]
This is the key property for Euclid's algorithm:
\[\text{gcd}(m, R_m(n)) = \text{gcd}(m, n)\]
An algebra (also: algebraic structure, \( \Omega\)-algebra) is a pair \(\langle S, \Omega \rangle\) where S is a set and \(\Omega = (\omega_1, \ldots, \omega_n)\) is a list of operations on S.
An algebra (also: algebraic structure, \( \Omega\)-algebra) is a pair \(\langle S, \Omega \rangle\) where S is a set and \(\Omega = (\omega_1, \ldots, \omega_n)\) is a list of operations on S.
Field-by-field Comparison
Field
Before
After
Text
{{c1::An algebra (also: algebraic structure, \( \Omega\)-algebra)}} is a pair \(\langle S, \Omega \rangle\) {{c2::where S is a set and \(\Omega = (\omega_1, \ldots, \omega_n)\) is a list of operations on S.}}
3. Assume that \( S \) is false and prove that \( T \) is true (-> contradiction)
Field-by-field Comparison
Field
Before
After
Text
Proof method: Proof by Contradiction<br><br>1. {{c1:: Find a suitable statement \( T\)}}<div>2. {{c2:: Prove that \( T \) is false}}</div><div>3. {{c3:: Assume that \( S \) is false and prove that \( T \) is true (-> contradiction)}}</div>
In a Group:
\(\widehat{(\widehat{a})} =\) \(a\) (inverse of inverse is the original element). This is a property from Lemma 5.3.
Field-by-field Comparison
Field
Before
After
Text
<p>In a Group:<br>
\(\widehat{(\widehat{a})} =\){{c1:: \(a\) }} {{c1:: (inverse of inverse is the original element)}}. This is a property from Lemma 5.3.</p>
Verify that \(\equiv_m\) is reflexive, symmetric, and transitive.
Reflexive: \(a \equiv_m a\) since \(m | (a - a) = 0\) ✓
Symmetric: \(a \equiv_m b \Rightarrow m | (a-b) \Rightarrow m | (b-a) \Rightarrow b \equiv_m a\) ✓
Transitive: If \(m | (a-b)\) and \(m | (b-c)\), then \(m | (a-b+b-c) = (a-c)\) ✓
Field-by-field Comparison
Field
Before
After
Text
Verify that \(\equiv_m\) is reflexive, symmetric, and transitive.<br><ul><li><strong>Reflexive</strong>: {{c1:: \(a \equiv_m a\) since \(m | (a - a) = 0\) ✓}}</li><li><strong>Symmetric</strong>: {{c2:: \(a \equiv_m b \Rightarrow m | (a-b) \Rightarrow m | (b-a) \Rightarrow b \equiv_m a\) ✓}}</li><li><strong>Transitive</strong>: {{c3:: If \(m | (a-b)\) and \(m | (b-c)\), then \(m | (a-b+b-c) = (a-c)\) ✓}}</li></ul>
A right (left) neutral element is an elements such that for all \(a \in G\), \(a*e = a\) (\(e*a = a\)).
Field-by-field Comparison
Field
Before
After
Text
<div>A {{c1::right (left) neutral element}} is an elements such that for all \(a \in G\), {{c2:: \(a*e = a\) (\(e*a = a\))}}.</div>
Find a common factor \((x - \alpha)\) using the roots method:
Try all possible elements of the field to find roots
If \(\alpha\) is a root of both, then \((x - \alpha)\) is a common factor
Use division with remainder to reduce to smaller polynomials
Repeat the process on the smaller polynomials
Important: Don't just find all roots and multiply! A root might be repeated (e.g., \((x+1)^2\)), and you'd miss the higher multiplicity
Example: For \(a(x) = (x+1)(x+1)(x+2)\), the GCD with another polynomial might be \((x+1)^2\), not just \((x+1)\).
Field-by-field Comparison
Field
Before
After
Front
<p>How do you find the GCD of two polynomials?</p>
Back
<p>To find \(\gcd(a(x), b(x))\):</p>
<ol>
<li>Find a common factor \((x - \alpha)\) using the <strong>roots method</strong>:</li>
<li>Try all possible elements of the field to find roots</li>
<li>If \(\alpha\) is a root of both, then \((x - \alpha)\) is a common factor</li>
<li>Use <strong>division with remainder</strong> to reduce to smaller polynomials</li>
<li>Repeat the process on the smaller polynomials</li>
<li><strong>Important</strong>: Don't just find all roots and multiply! A root might be repeated (e.g., \((x+1)^2\)), and you'd miss the higher multiplicity</li>
</ol>
<p><strong>Example</strong>: For \(a(x) = (x+1)(x+1)(x+2)\), the GCD with another polynomial might be \((x+1)^2\), not just \((x+1)\).</p>
We just want to prove that there exists a \( x \) such that a statement \( S_x \) is true. (e.g. There exists a prime number such that \( n - 10\) and \( n + 10\) are also prime.)
constructive: We know the x.
non-constructive: We know that x has to exist, but we don't know its value.
Field-by-field Comparison
Field
Before
After
Front
Proof method: Existence Proof
Back
We just want to prove that there exists a \( x \) such that a statement \( S_x \) is true. (e.g. There exists a prime number such that \( n - 10\) and \( n + 10\) are also prime.) <div><br></div><div><i>constructive: </i>We know the x.</div><div><i>non-constructive: </i>We know that x has to exist, but we don't know its value.</div>
Special elements in posets: \((A; \preceq)\) is a poset.
\(a \in A\) is the least (greatest) element of \(A\) if \(a \preceq b\) (\(a \succeq b) \) for all \(b \in A\)
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset.<div>\(a \in A\) is the {{c1::<b>least (greatest) element</b> of \(A\)}} if {{c2::\(a \preceq b\) (\(a \succeq b) \) for all \(b \in A\)}}</div>
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is the greatest lower (least upper) bound of \(S\) if \(a\) is the greatest (least) element of the set of all lower (upper) bounds of \(S\).
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is the greatest lower (least upper) bound of \(S\) if \(a\) is the greatest (least) element of the set of all lower (upper) bounds of \(S\).
Note that greatest (least) refers to the operation \(\preceq\) and not to order by \(>\) or \(<\) (smaller, bigger).
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).<div>\(a \in A\) is the {{c1::<b>greatest lower (least upper) bound</b> of \(S\)}} if {{c2::\(a\) is the greatest (least) element of the set of all lower (upper) bounds of \(S\). }}</div>
Extra
Note that greatest (least) refers to the operation \(\preceq\) and not to order by \(>\) or \(<\) (smaller, bigger).
A relation ρ on a set A is called symmetric if {{c2::\( a \ \rho \ b \iff b \ \rho \ a\) is true, i.e. if \( \rho = \hat{\rho}\)}}
Examples: \( \equiv_m\), marriage
Field-by-field Comparison
Field
Before
After
Text
A relation ρ on a set A is called {{c1::symmetric}} if {{c2::\( a \ \rho \ b \iff b \ \rho \ a\) is true, i.e. if \( \rho = \hat{\rho}\)}}
A codeword \(c\) of length \(n\) in a polynomial code with degree \(k-1\) can be interpolated from any \(k\) values by Lagrangian interpolation.
Field-by-field Comparison
Field
Before
After
Text
<p>A codeword \(c\) of length \(n\) in a <em>polynomial code</em> with degree \(k-1\) can be interpolated from {{c1:: <em>any \(k\) values</em> by Lagrangian interpolation}}.</p>
Why does the Chinese Remainder Theorem require \(m_1, \dots, m_r\) to be pairwise relatively prime?
If \(\text{gcd}(m_i, m_j) = d > 1\), then the system could be inconsistent (e.g., \(x \equiv 0 \pmod{6}\) and \(x \equiv 1 \pmod{4}\) has no solution) or have multiple solutions (destroying uniqueness).
Field-by-field Comparison
Field
Before
After
Front
Why does the Chinese Remainder Theorem require \(m_1, \dots, m_r\) to be <strong>pairwise relatively prime</strong>?
Back
If \(\text{gcd}(m_i, m_j) = d > 1\), then the system could be <strong>inconsistent</strong> (e.g., \(x \equiv 0 \pmod{6}\) and \(x \equiv 1 \pmod{4}\) has no solution) or have <strong>multiple solutions</strong> (destroying uniqueness).
Eine Gruppe ist eine Menge \(G\) mit Operation \( * \) mit folgenden Eigenschaften:
{{c2::
Assoziativität: \((a * b) * c = a * (b*c)\)
Neutrales Element existiert: \( a * e = e * a = a \)
Jedes Element \(a\in G\) hat eine Inverse: \( a * a^{-1} = a^{-1} * a = e\)
}}
Field-by-field Comparison
Field
Before
After
Text
{{c1::Eine Gruppe}} ist eine {{c1::Menge \(G\) mit Operation \( * \)}} mit folgenden Eigenschaften:<ul>{{c2::<li> Assoziativität: \((a * b) * c = a * (b*c)\)</li><li>Neutrales Element existiert: \( a * e = e * a = a \)</li><li>Jedes Element \(a\in G\) hat eine Inverse: \( a * a^{-1} = a^{-1} * a = e\)</li>}}<br></ul>
\(F \equiv G\) means they correspond to the same function, i.e., their truth values are equal for all truth assignments to the propositional symbols appearing in \(F\) or \(G\).
\(F \equiv G\) means they correspond to the same function, i.e., their truth values are equal for all truth assignments to the propositional symbols appearing in \(F\) or \(G\).
Field-by-field Comparison
Field
Before
After
Text
{{c2::\(F \equiv G\)}} means {{c1:: they correspond to the same function}}, i.e., {{c3:: their truth values are equal for <strong>all</strong> truth assignments to the propositional symbols appearing in \(F\) or \(G\)}}.
What are both distributive laws in propositional logic?
\(A \land (B \lor C) \equiv (A \land B) \lor (A \land C)\) (distributing \(\land\) over \(\lor\))
\(A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)\) (distributing \(\lor\) over \(\land\))
Field-by-field Comparison
Field
Before
After
Front
What are both distributive laws in propositional logic?
Back
<ul>
<li>\(A \land (B \lor C) \equiv (A \land B) \lor (A \land C)\) (distributing \(\land\) over \(\lor\))</li>
<li>\(A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)\) (distributing \(\lor\) over \(\land\))</li>
</ul>
In a group, the equation \(a * x = b\) has a unique solution \(x\) for any \(a\) and \(b\) (So does the equation \(x * a = b\)).
Field-by-field Comparison
Field
Before
After
Text
In a group, the equation \(a * x = b\) has {{c1:: a unique solution \(x\)}} for any \(a\) and \(b\) {{c1:: (So does the equation \(x * a = b\))}}.
Give the formal definitions of union and intersection.
\(A \cup B \overset{\text{def}}{=} \{x \ | \ x \in A \lor x \in B\}\)
\(A \cap B \overset{\text{def}}{=} \{x \ | \ x \in A \land x \in B\}\)
Field-by-field Comparison
Field
Before
After
Front
Give the formal definitions of union and intersection.
Back
<ul>
<li>\(A \cup B \overset{\text{def}}{=} \{x \ | \ x \in A \lor x \in B\}\)</li>
<li>\(A \cap B \overset{\text{def}}{=} \{x \ | \ x \in A \land x \in B\}\)</li>
</ul>
What fundamental property distinguishes finite from infinite sets regarding proper subsets?
A finite set never has the same cardinality as one of its proper subsets. An infinite set can (e.g., \(\mathbb{N} \sim \mathbb{O}\) where \(\mathbb{O}\) is the set of odd numbers).
Field-by-field Comparison
Field
Before
After
Front
What fundamental property distinguishes finite from infinite sets regarding proper subsets?
Back
A <strong>finite</strong> set never has the same cardinality as one of its proper subsets. An <strong>infinite</strong> set can (e.g., \(\mathbb{N} \sim \mathbb{O}\) where \(\mathbb{O}\) is the set of odd numbers).
To prove \(\phi: G \rightarrow H\) is an isomorphism, you must verify two main properties:
- \(\phi\) is a homomorphism
- \(\phi\) is a bijection.
Field-by-field Comparison
Field
Before
After
Text
<p>To prove \(\phi: G \rightarrow H\) is an {{c2:: isomorphism}}, you must verify two main properties:<br>
- \(\phi\) is a {{c1::homomorphism}}<br>
- \(\phi\) is a {{c1::bijection}}.</p>
Theorem 5.24: A field is always an integral domain.
Proof idea: If \(ab = 0\) in a field and \(a \neq 0\), then \(a\) has an inverse \(a^{-1}\). Multiplying both sides by \(a^{-1}\) gives \(b = a^{-1} \cdot 0 = 0\).
Field-by-field Comparison
Field
Before
After
Front
<p>When is a field an integral domain?</p>
Back
<p><strong>Theorem 5.24</strong>: A field is <strong>always</strong> an <strong>integral domain</strong>.</p>
<p><strong>Proof idea</strong>: If \(ab = 0\) in a field and \(a \neq 0\), then \(a\) has an inverse \(a^{-1}\). Multiplying both sides by \(a^{-1}\) gives \(b = a^{-1} \cdot 0 = 0\).</p>
The gcd does not change if we subract a multiple of the first number from the second.
\(\text{gcd}(m, n - qm) = \text{gcd}(m,n) \), which is why reduction modulo \(m\) preserves the gcd, which is what makes Euclid's algorithm work.
Field-by-field Comparison
Field
Before
After
Text
The gcd does <b>not</b> change if we {{c1:: subract a multiple of the first number from the second}}.
Extra
\(\text{gcd}(m, n - qm) = \text{gcd}(m,n) \), which is why reduction modulo \(m\) preserves the gcd, which is what makes Euclid's algorithm work.
The group \(\mathbb{Z}_n\) also only contains the positive numbers up to \(n\) \(\{0, 1, 2, \dots, n-1\}\), as the negatives \(\{-n+1, \dots, -2, -1\}\) are equal to a positive number \(\equiv_n\).
The group \(\mathbb{Z}_n\) also only contains the positive numbers up to \(n\) \(\{0, 1, 2, \dots, n-1\}\), as the negatives \(\{-n+1, \dots, -2, -1\}\) are equal to a positive number \(\equiv_n\).
Field-by-field Comparison
Field
Before
After
Text
<p>The group \(\mathbb{Z}_n\) also {{c3::only contains the positive numbers up to \(n\)}} \(\{0, 1, 2, \dots, n-1\}\), as the negatives \(\{-n+1, \dots, -2, -1\}\) are equal to a positive number \(\equiv_n\).</p>
In EBNF we can write a recursive rule by writing the rule name on both sides e.g. <A> \(\leftarrow\) A[<A>] or by writing a series of rules that result in the same.
Back
ETH::1._Semester::EProg::1._EBNF::6._Recursion
In EBNF we can write a recursive rule by writing the rule name on both sides e.g. <A> \(\leftarrow\) A[<A>] or by writing a series of rules that result in the same.
Field-by-field Comparison
Field
Before
After
Text
In EBNF we can write a recursive rule by {{c1:: writing the rule name on both sides e.g. <A> \(\leftarrow\) A[<A>]}} or by {{c1:: writing a series of rules that result in the same}}.
A vector space \(V\) over a field \(F\) is a set with vector addition (\(V \times V \mapsto V)\) and scalar multiplication (\(F \times V \mapsto V\)) being defined. The elements of \(V\) are then usually called vectors and the elements of \(F\) scalars.
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
A vector space \(V\) over a field \(F\) is a set with vector addition (\(V \times V \mapsto V)\) and scalar multiplication (\(F \times V \mapsto V\)) being defined. The elements of \(V\) are then usually called vectors and the elements of \(F\) scalars.
Example: \(\mathbb{R}^2\) with the usual definitions of \(+, \cdot\) (cartesian vectors)
Field-by-field Comparison
Field
Before
After
Text
A <i>vector space</i> \(V\) over a field \(F\) is {{c1::a set with vector addition (\(V \times V \mapsto V)\) and scalar multiplication (\(F \times V \mapsto V\)) being defined}}. The elements of \(V\) are then usually called {{c1::vectors}} and the elements of \(F\) {{c1::scalars}}<i>.</i>
Extra
Example: \(\mathbb{R}^2\) with the usual definitions of \(+, \cdot\) (cartesian vectors)
If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
Field-by-field Comparison
Field
Before
After
Front
How is the scalar product defined on an angle?
Back
\(\textbf{v} \cdot \textbf{w} = ||\textbf{v}|| \ ||\textbf{w}|| \cdot \cos(\alpha)\).<br><br>If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
the Kronecker delta is a function which is described as follows: \(\delta_{i, j} = \begin{cases} \text{0} &\quad\text{if }i \neq j \\ \text{1} &\quad\text{if }i = j \end{cases}\)
Field-by-field Comparison
Field
Before
After
Front
What is the <b>Kronecker delta?</b>
Back
the Kronecker delta is a function which is described as follows:<br>\(\delta_{i, j} = \begin{cases} \text{0} &\quad\text{if }i \neq j \\ \text{1} &\quad\text{if }i = j \end{cases}\)
Für eine unitäre Matrix gilt \( \mathbf{A^H A = I}_n\), d.h. die komplex-transponierte von A ist die Inverse von A.
Unitär = regulär & quadratisch
Field-by-field Comparison
Field
Before
After
Front
Was ist eine <b>unitäre</b> Matrix?
Back
Für eine unitäre Matrix gilt \( \mathbf{A^H A = I}_n\), d.h. die komplex-transponierte von A ist die Inverse von A. <div>Unitär = regulär & quadratisch </div>
Ein Unterraum ist eine Teilmenge \( U \subseteq \mathbb{V}\) falls \( U \) auch die Eigenschaften eines Vektorraums hat (d.h. abgeschlossen bezüglich Vektoraddition & Skalarmultiplikation). Beispiel: Ebene in \(\mathbb{R}^3\)
Field-by-field Comparison
Field
Before
After
Front
Was ist ein Unterraum?
Back
Ein Unterraum ist eine Teilmenge \( U \subseteq \mathbb{V}\) falls \( U \) auch die Eigenschaften eines Vektorraums hat (d.h. abgeschlossen bezüglich Vektoraddition & Skalarmultiplikation). Beispiel: Ebene in \(\mathbb{R}^3\)
Wann ist eine Matrix <b>skew-symmetric </b>(schiefsymmetrisch)?
Back
Falls \( \mathbf{A}^\top = -\mathbf{A}\)<div><br></div><div>Beispiel:</div><div>\( \begin{pmatrix} 0 & -3 & 5 \\ 3 & 0 & -4 \\ -5 & 4 & 0 \end{pmatrix}\)<br></div>
Gilt für zwei Matrizen \( \mathbf{A}\) und \( \mathbf{B}\), dass {{c2::\( \mathbf{AB} = \mathbf{BA}\)}}, dann kommutieren diese Matrizen.
Field-by-field Comparison
Field
Before
After
Text
Gilt für zwei Matrizen \( \mathbf{A}\) und \( \mathbf{B}\), dass {{c2::\( \mathbf{AB} = \mathbf{BA}\)}}, dann {{c1::kommutieren}} diese Matrizen.
What is the definition of a linear transformation or a linear functional?
a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\) is called a linear transformation or a linear functional if the linearity axiom holds for it
What is the definition of a linear transformation or a linear functional?
Back
a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\) is called a linear transformation or a linear functional if the <b>linearity axiom</b> holds for it <br><br><b>linearity axiom: </b>\(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\)
Für eine orthogonale Matrix gilt \( \mathbf{A^\top A = I}_n\), d.h. die Inverse von A ist A transponiert. Orthogonal = reell, quadratisch, regulär
Field-by-field Comparison
Field
Before
After
Front
Was ist eine <b>orthogonale</b> Matrix?
Back
Für eine orthogonale Matrix gilt \( \mathbf{A^\top A = I}_n\), d.h. die Inverse von A ist A transponiert. Orthogonal = reell, quadratisch, regulär
Give the three definitions for linear independence:
None of the vectors is a linear combination of the other ones.
{{c2::There are no scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) can only be written as a trivial combination of the vectors.}}
None of the vectors is a linear combination of the previous ones.
Give the three definitions for linear independence:
None of the vectors is a linear combination of the other ones.
{{c2::There are no scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) can only be written as a trivial combination of the vectors.}}
None of the vectors is a linear combination of the previous ones.
Field-by-field Comparison
Field
Before
After
Text
Give the three definitions for linear independence:<br><ol><li>{{c1::None of the vectors is a linear combination of the other ones.}}</li><li>{{c2::There are no scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) can only be written as a trivial combination of the vectors.}}<br></li><li>{{c3::None of the vectors is a linear combination of the previous ones.}}</li></ol>
What does the linearity axiom say and how can it be interpreted for a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\):
What does the linearity axiom say and how can it be interpreted for a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\):
What does the linearity axiom say and how can it be interpreted for a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\):<br><br>i) {{c1:: \(T(x+x') = T(x) + T(x')\)}}<br>ii) {{c2:: \(T(\lambda x) = \lambda T(x)\)}}
Formula for the cosine of the angle between vectors v and w
If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
Field-by-field Comparison
Field
Before
After
Front
Formula for the cosine of the angle between vectors v and w
Back
<img src="paste-f59da43aa9991b8ecc2f19c7a1f37d6e4e44107c.jpg"><br><br>If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
If columns \(v_1, v_2, ..., v_n\) of \(A\) are linearly independent and \(A\lambda = A\mu = x\) are two ways of writing vector x as a linear combination of the vectors v then:
If columns \(v_1, v_2, ..., v_n\) of \(A\) are linearly independent and \(A\lambda = A\mu = x\) are two ways of writing vector x as a linear combination of the vectors v then:
\(\lambda \ \text{and} \ \mu\) are the same vector.
Linear combinations are unique if all vectors are independent.
Field-by-field Comparison
Field
Before
After
Front
If columns \(v_1, v_2, ..., v_n\) of \(A\) are linearly independent and \(A\lambda = A\mu = x\) are two ways of writing vector x as a linear combination of the vectors v then:
Back
\(\lambda \ \text{and} \ \mu\) are the same vector.<div><br></div><div>Linear combinations are unique if all vectors are independent.</div>
At least one of the vectors is a linear combination of the other ones.
{{c2::There are scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) is a nontrivial combination of the vectors.}}
At least one of the vectors is a linear combination of the previous ones.
At least one of the vectors is a linear combination of the other ones.
{{c2::There are scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) is a nontrivial combination of the vectors.}}
At least one of the vectors is a linear combination of the previous ones.
Field-by-field Comparison
Field
Before
After
Text
Give the three definitions of linear dependence:<br><ol><li>{{c1::At least one of the vectors is a linear combination of the other ones.}}</li><li>{{c2::There are scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) is a nontrivial combination of the vectors.}}<br></li><li>{{c3::At least one of the vectors is a linear combination of the previous ones.}}</li></ol>
given a vector \(\mathbf{d} \in \mathbb{R}^n\) \(\mathbf{d} \neq \mathbf{0}\), \(H_{\mathbf{d}} = \{\mathbf{v} \in \mathbb{R}^n : \mathbf{v} \cdot \mathbf{d} = \mathbf{0} \}\) or in other words, it is the set of vectors orthogonal to a given vector
Since 0 is orthogonal to every vector \(0 \in H_d\).
Field-by-field Comparison
Field
Before
After
Front
What is the definition of a hyperplane?
Back
given a vector \(\mathbf{d} \in \mathbb{R}^n\) \(\mathbf{d} \neq \mathbf{0}\), \(H_{\mathbf{d}} = \{\mathbf{v} \in \mathbb{R}^n : \mathbf{v} \cdot \mathbf{d} = \mathbf{0} \}\) <br>or in other words, it is the set of vectors orthogonal to a given vector<br><br>Since 0 is orthogonal to every vector \(0 \in H_d\).
The LU (Lower-Upper, also sometimes called LR) decomposition factors a matrix \(A\) as the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\).
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
The LU (Lower-Upper, also sometimes called LR) decomposition factors a matrix \(A\) as the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\).
(so \(A = LU\))
Field-by-field Comparison
Field
Before
After
Text
The LU ({{c1::Lower-Upper}}, also sometimes called {{c1::LR}}) decomposition factors a matrix \(A\) as {{c2::the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\)}}.
This equality holds exactly if one vector is the scalar multiple of the other.
This essentially means that: the length of the projecton of v onto w is smaller than the both of their lengths multiplied.
This explains the equality part: if they are already aligned, their projection doesn't lose any length...
Field-by-field Comparison
Field
Before
After
Front
The Cauchy-Schwarz Inequality tells us that for \(\textbf{v}, \textbf{w} \in \mathbb{R}^m\)
Back
\(|\textbf{v} \cdot \textbf{w}| \leq ||\textbf{v}|| \ ||\textbf{w}||\).<br><br>This equality holds exactly if one vector is the scalar multiple of the other.<br><br>This essentially means that: the length of the projecton of v onto w is smaller than the both of their lengths multiplied.<br><br>This explains the equality part: if they are already aligned, their projection doesn't lose any length...
The scalar product of \(\textbf{v} \cdot \textbf{v}\) is \(\leq or \geq\) to what?
\(\textbf{v} \cdot \textbf{v} \geq 0\) with equality exactly if \(\textbf{v} = \textbf{0}\).
This is because we essentially square the entries and thus can't get negatives.
Field-by-field Comparison
Field
Before
After
Front
The <b>scalar product</b> of \(\textbf{v} \cdot \textbf{v}\) is \(\leq or \geq\) to what?
Back
\(\textbf{v} \cdot \textbf{v} \geq 0\) with equality exactly if \(\textbf{v} = \textbf{0}\).<br><br>This is because we essentially square the entries and thus can't get negatives.
it is the number of independent columns, where independence is defined such that given a column vector \(v_j\) then \(v_j\) is not a linear combination of \(v_1, v_2 ... v_{j-1}\)
Field-by-field Comparison
Field
Before
After
Front
What is the rank of a matrix?
Back
it is the number of independent columns, where independence is defined such that given a column vector \(v_j\) then \(v_j\) is not a linear combination of \(v_1, v_2 ... v_{j-1}\)
An important difference between a field \(F\) and a vector space \(V\) is that multiplication in the field is \(F\times F\mapsto F\), whereas it is \(F\times V\mapsto V\) in the vector space.
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
An important difference between a field \(F\) and a vector space \(V\) is that multiplication in the field is \(F\times F\mapsto F\), whereas it is \(F\times V\mapsto V\) in the vector space.
Field-by-field Comparison
Field
Before
After
Text
An important difference between a field \(F\) and a vector space \(V\) is that {{c1::multiplication in the field is \(F\times F\mapsto F\), whereas it is \(F\times V\mapsto V\) in the vector space}}.
Since 0 is orthogonal to every vector \(0 \in H_d\).
Field-by-field Comparison
Field
Before
After
Front
What is a hyperplane through the origin?
Back
<img src="paste-668e9356fe68198a22a939d45f03e5d4e9db8bdd.jpg"><br>Is called a hyperplane through the origin.<br><br>Since 0 is orthogonal to every vector \(0 \in H_d\).
Für alle Vektorpaare \( \mathbf{x,y} \in \mathbb{E}^n \) gilt die Cauchy-Schwarz-Ungleichung: {{c1::\( | \langle \mathbf{x, y} \rangle | \le ||\mathbf{x}|| \ ||\mathbf{y}||\)}}
Back
ETH::1._Semester::LinAlg PlsFix::DUPLICATE
Für alle Vektorpaare \( \mathbf{x,y} \in \mathbb{E}^n \) gilt die Cauchy-Schwarz-Ungleichung: {{c1::\( | \langle \mathbf{x, y} \rangle | \le ||\mathbf{x}|| \ ||\mathbf{y}||\)}}
Field-by-field Comparison
Field
Before
After
Text
Für alle Vektorpaare \( \mathbf{x,y} \in \mathbb{E}^n \) gilt die Cauchy-Schwarz-Ungleichung: {{c1::\( | \langle \mathbf{x, y} \rangle | \le ||\mathbf{x}|| \ ||\mathbf{y}||\)}}
Wenn \(\mathbf{A}\) eine komplexe Matrix ist, dann ist \(\overline{\mathbf{A}}\) mit \( (\overline{\mathbf{A}})_{ij} = \overline{(\mathbf{A})_{ij}}\) die konjugiert-komplexe Matrix.
Field-by-field Comparison
Field
Before
After
Front
Was ist eine <b>konjugiert-komplexe </b>Matrix?
Back
Wenn \(\mathbf{A}\) eine komplexe Matrix ist, dann ist \(\overline{\mathbf{A}}\) mit \( (\overline{\mathbf{A}})_{ij} = \overline{(\mathbf{A})_{ij}}\) die konjugiert-komplexe Matrix.
Eine symmetrische Matrix erfüllt \(A^\top = A\) (d.h. eine "Spiegelachse" an der Hauptdiagonale). Hauptdiagonale selber unwichtig!<div>Beispiel:</div><div>\( \begin{pmatrix} 0 & 5 & 1 \\ 5 & 2 & 4 \\ 1 & 4 & 0 \end{pmatrix} \)<br></div>
Eine Linearkombination (LK) der Vektoren \( a_1, \ldots, a_n\) ist {{c2::ein Ausdruck der Form \( \alpha_1 a_1 + \cdots + \alpha_n a_n\) wobei \( \alpha_1, \ldots, \alpha_n \in \mathbb{R}\)}}
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
Eine Linearkombination (LK) der Vektoren \( a_1, \ldots, a_n\) ist {{c2::ein Ausdruck der Form \( \alpha_1 a_1 + \cdots + \alpha_n a_n\) wobei \( \alpha_1, \ldots, \alpha_n \in \mathbb{R}\)}}
Field-by-field Comparison
Field
Before
After
Text
Eine {{c1::Linearkombination (LK)}} der Vektoren \( a_1, \ldots, a_n\) ist {{c2::ein Ausdruck der Form \( \alpha_1 a_1 + \cdots + \alpha_n a_n\) wobei \( \alpha_1, \ldots, \alpha_n \in \mathbb{R}\)}}
The LU decomposition is useful because (among other things) it is computationally more efficient when solving multiple \(Ax = b\) having the same \(A\) and different \(b\) .
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
The LU decomposition is useful because (among other things) it is computationally more efficient when solving multiple \(Ax = b\) having the same \(A\) and different \(b\) .
Field-by-field Comparison
Field
Before
After
Text
The LU decomposition is useful because (among other things) {{c1::it is computationally more efficient when solving multiple \(Ax = b\) having the same \(A\) and different \(b\) }}.
In a directed graph we call a (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle a directed (gerichtet) (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle.
In a directed graph we call a (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle a directed (gerichtet) (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a directed graph we call a (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle a {{c1::directed (<i>gerichtet</i>)}} (\(\epsilon\)/Eulerian/Hamiltonian) walk/closed walk/path/cycle.
\(O(n+m)\)
In an Adjacency Matrix: runtime is \(O(n^2)\) as looping over all edges is \(O(n)\).
In an Adjacency List: we loop \(n\) times over \(O(1 + \deg(u))\). Using the handshake lemma: \(\sum_{u \in V} (1 + \deg(u)) = n + \sum_{u \in V} \deg(u) = n + 2m\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Find Closed Eulerian Path
Runtime
\(O(n+m)\)
Approach
We want to be able to find closed walks in a graph. We can then merge them together to form a single closed walk, by exploiting shared vertices.<br><br>Algo:<br><ol><li>Start at vertex \(u_0\) arbitrary</li><li>For loop over edges. If not marked, mark and recurse.</li><li>Append vertex to list after execution</li></ol> Returns a list of vertices in order of a closed walk if there is one.<br><br>Example:<br><img src="paste-a669de30c7bc4a38d788fb96b6b5551a4781ec71.jpg"><br>Output:<br><img src="paste-b453826818903aa4da2ac10897e9dc0e177229b6.jpg">
In an Adjacency Matrix: runtime is \(O(n^2)\) as looping over all edges is \(O(n)\).<br><br>In an Adjacency List: we loop \(n\) times over \(O(1 + \deg(u))\).<br>Using the handshake lemma: \(\sum_{u \in V} (1 + \deg(u)) = n + \sum_{u \in V} \deg(u) = n + 2m\)
A graph \(G\) is bipartite if {{c2:: it's possible to partition the vertices into two sets \(V_1\) and \(V_2\) that are disjoint and cover the graph. Any edge \(\{u, v\}\) has to have one endpoint in \(V_1\) and the other in \(V_2\)}}.
A graph \(G\) is bipartite if {{c2:: it's possible to partition the vertices into two sets \(V_1\) and \(V_2\) that are disjoint and cover the graph. Any edge \(\{u, v\}\) has to have one endpoint in \(V_1\) and the other in \(V_2\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is {{c1:: <b>bipartite</b>}} if {{c2:: it's possible to partition the vertices into two sets \(V_1\) and \(V_2\) that are disjoint and cover the graph. Any edge \(\{u, v\}\) has to have one endpoint in \(V_1\) and the other in \(V_2\)}}.
Name the impossible cases in DFS pre/post ordering for edge \((u, v)\):
Overlapping but not Nested Intervals:
{{c2:: \(\text{pre}(u)<\text{pre}(v)<\text{post}(u)<\text{post}(v)\): as visit(u) would call visit(v) before the recursive call ends}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Name the impossible cases in DFS pre/post ordering for edge \((u, v)\):<br><ul><li>{{c1::Overlapping but not Nested Intervals: <img src="paste-b7976dbbff12de2b44594553e0c91633f59e9c05.jpg">}}</li><li>{{c2:: \(\text{pre}(u)<\text{pre}(v)<\text{post}(u)<\text{post}(v)\): <img src="paste-a6fc070f96de8bd2b8148e3891cf956fd611a0a2.jpg"> as visit(u) would call visit(v) before the recursive call ends}}</li></ul>
push(k, S): push a new object k to the top of the stack S
pop(S): remove and return the top element of the stack S
top(S): get the top element of the stack S without deleting it
Other operations might be isEmpty or emptystack which produces and emtpy stack.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>stack</b> has the following operations:<br><ul><li>{{c1:: <b>push(k, S)</b>}}: {{c2:: push a new object <b>k</b> to the top of the stack <b>S</b>}}</li><li>{{c3:: <b>pop(S)</b>}}: {{c4:: remove and return the top element of the stack <b>S</b>}}</li><li>{{c5:: <b>top(S)</b>}}: {{c6:: get the top element of the stack <b>S</b> without deleting it}}</li></ul>
Extra
Other operations might be <b>isEmpty</b> or <b>emptystack</b> which produces and emtpy stack.
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but not tree edge: Forward edge
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but not tree edge: Forward edge
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br>\(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but <b>not tree edge</b>: {{c1:: Forward edge}}
Prim’s algorithm starts with a single vertex and grows the MST outwards from that seed.
Initialisation:
Select and arbitrary starting vertex \(s\) and empty set \(F\)
Set \(S = {s}\) tracks the vertices in the MST
Each vertex gets a key[v] = representing the cheapest known connection cost to \(v\):
\(\infty\) if no edge connects \(s\) to \(v\)
\(w(s, v)\) if edge \((s, v)\) exists
Use a priority queue \(Q\) (Min-Heap) to store the vertices, in order of lowest key cost
Iteration:
Select and add Extract the vertex \(u\) with the minimum key from \(Q\). This is the cheapest to connected to the current MST. Add \(u\) to \(S\).
Update Neighbours For each neighbour \(v\) of \(u\) not in \(S\):
If \(w(u, v) < \text{key}[v]\) update key[v] = w(u, v) and update the priority in $Q$.
This discovers potentially cheaper connections to vertices outside the current MST. If a cheaper edge to \(v\) is found, the current value in key[v] cannot be part of the MST
Termination: When \(Q\) is empty, all vertices are in \(S\) and connected, and the edges chosen are in the MST (tracked in the set \(F\) through updates).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Describe the steps of <b>Prim's Algorithm</b>:
Back
<div>Prim’s algorithm starts with a single vertex and grows the MST outwards from that seed.</div>
<ol>
<li><strong>Initialisation:</strong><ul>
<li>Select and arbitrary starting vertex \(s\) and empty set \(F\)</li>
<li>Set \(S = {s}\) tracks the vertices in the MST</li>
<li>Each vertex gets a <code>key[v] =</code> representing the cheapest known connection cost to \(v\):<ul>
<li>\(\infty\) if no edge connects \(s\) to \(v\)</li>
<li>\(w(s, v)\) if edge \((s, v)\) exists</li>
</ul>
</li>
<li>Use a priority queue \(Q\) (<em>Min-Heap</em>) to store the vertices, in order of lowest <code>key</code> cost</li>
</ul>
</li>
<li><strong>Iteration:</strong><ul>
<li><em>Select and add</em> Extract the vertex \(u\) with the minimum <code>key</code> from \(Q\). This is the cheapest to connected to the current MST. Add \(u\) to \(S\).</li>
<li><em>Update Neighbours</em> For each neighbour <b>\(v\) </b>of \(u\) <em>not</em> in \(S\):<ul>
<li>If \(w(u, v) < \text{key}[v]\) update <code>key[v] = w(u, v)</code> and update the priority in $Q$.<ul>
<li>This discovers potentially cheaper connections to vertices outside the current MST. If a <em>cheaper edge</em> to \(v\) is found, the current value in <code>key[v]</code> cannot be part of the MST</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><strong>Termination:</strong> When \(Q\) is empty, all vertices are in \(S\) and connected, and the edges chosen are in the MST (tracked in the set \(F\) through updates).</li></ol>
Boruvka's Algorithm has a runtime of \(O((|V| + |E|) \log |V|)\).
During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):
Run DFS to find the connected components: \(O(|V| + |E|)\)
Find the cheapest one \(O(|E|)\)
We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>Boruvka's Algorithm</b> has a runtime of {{c1:: \(O((|V| + |E|) \log |V|)\)}}.
Extra
During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):<br><ol><li>Run DFS to find the connected components: \(O(|V| + |E|)\)</li><li>Find the cheapest one \(O(|E|)\)</li></ol>We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
<div style="text-align: center;"><b>DFS</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| + |V|) \)}}</div><div><br></div><div><b>Approach</b>: {{c2::Explore as far as possible along each branch before backtracking. Potentially keep track of pre- / post-numbers to make edge classifications.}}</div><div><br></div><div><b>Uses</b>: {{c3::Detect cycles (if backward edge), <b>topological sorting </b>(reverse post-ordering), test if bipartite, mazes, ...}}</div>
For an array A[1..n] <b>longest</b> subsequence (non-continuous) that is ascending.<br><br>DP Table with entry \(M(l) = a\) where a ist the smallest possible ending of a LAT with length \(l\).<br><ul><li>Base Cases: \(M[*] = \infty\)</li><li>Recursion: set \(M[k]\) to \(A[i]\) where \(k\) is the index of the next smallest + 1 in \(M\).</li></ul>We can find the smaller with binary search, thus \(\log n \) search for \(n\) elements -> \(\Theta(n \log n)\).<br><img src="paste-1b9069bf0a881a3cd3900a4de699cac89f0498b8.jpg"><br>
In a doubly linked list, we store a pointer to the previous and next element for each key.
This increases memory usage as a trade-off for speed.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a <b>doubly linked list</b>, we store a pointer to the {{c1:: previous and next element}} for each key.<br><br>This increases {{c2::memory usage}} as a trade-off for {{c2:: speed}}.
If \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = C \in \mathbb{R}^{+}\cup\set0\) or \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = \infty\), then:
\[\lim_{x \rightarrow \infty} \frac{f(x)}{g(x)} = \lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)}\]The ratio of the derivatives tend to the same limit.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is L'Hôpital's Rule?
Back
<div>If \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = C \in \mathbb{R}^{+}\cup\set0\) or \(\lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)} = \infty\), then:</div> <div>\[\lim_{x \rightarrow \infty} \frac{f(x)}{g(x)} = \lim_{x \rightarrow \infty} \frac{f’(x)}{g’(x)}\]The ratio of the <b>derivatives</b> tend to the <b>same limit.</b><br></div>
dequeue(S): remove and return the first element of the queue
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>quue</b> has the following operations:<br><ul><li>{{c1:: <b>enqueue(k, S)</b>}}: {{c2:: append at the end of the queue}}</li><li>{{c3:: <b>dequeue(S)</b>}}: {{c4:: remove and return the first element of the queue}}</li></ul>
A graph \(G\) is called a directed acyclic graph (DAG) (gerichteter azyklischer Graph) if there is no directed cycles (gerichteter Kreis).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is called a {{c1::directed acyclic graph (DAG) (<i>gerichteter azyklischer Graph</i>)}} if there is {{c2::no directed cycles (<i>gerichteter Kreis</i>)}}.
You start in the middle and if the middle element is not the one you're searching, you recurse on the left OR right side (depending on the middle elements size).
\(O(|V| \cdot (|V| + |E|) \log |V|)\) (running dijkstra's n times, but allows negatives)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Johnson's Algorithm
Runtime
\(O(|V| \cdot (|V| + |E|) \log |V|)\) (running dijkstra's n times, but allows negatives)<br><img src="paste-b0103885454d02688fec99eb8383f57710d89f68.jpg">
Requirements
No negative cycles
Approach
<ol><li><b>Add a New Vertex:</b><ul><li>Add a new vertex s to the graph and connect it to all vertices with zero-weight edges. </li>
</ul></li><li><b>Run Bellman-Ford</b>:<ul><li>Use the Bellman-Ford algorithm starting from s to compute the shortest distance h[v] from s to each vertex v.</li><li>If a negative-weight cycle is detected, stop.</li></ul></li><li><b>Reweight Edges</b>: <ul><li>For each edge u → v with weight w(u, v), reweight it as: w′(u, v) = w(u, v) + h[u] − h[v]</li><li>This ensures all edge weights are non-negative.</li>
</ul> </li><li><b>Run Dijkstra’s Algorithm:</b><ul><li>For each vertex v, use Dijkstra’s algorithm to compute the shortest paths to all other vertices.</li>
</ul></li><li><b>Adjust Back</b>:<ul><li>Convert the distances back to the original weights using: d′(u, v) = d′(u, v) − h[u] + h[v]</li>
</ul></li><li><b>End:</b></li><ul><li>The resulting shortest path distances between all pairs of vertices are valid.</li></ul></ol><div>The overall higher cost allows us to run pre-computation steps like B-F for "free"</div>
A Minimum Spanning Tree is a subgraph of a connected, undirected, weighted Graph with that fullfills:
spanning, it connects all vertices
acylic, it's a tree
minimal, the sum of all edge weights in the Tree is minimal
Back
ETH::1._Semester::A&D::11._Minimum_Spanning_Trees
A Minimum Spanning Tree is a subgraph of a connected, undirected, weighted Graph with that fullfills:
spanning, it connects all vertices
acylic, it's a tree
minimal, the sum of all edge weights in the Tree is minimal
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <b>Minimum Spanning Tree</b> is a subgraph of a {{c1:: connected, undirected, weighted}} Graph with that fullfills:<br><ul><li>{{c3:: spanning, it connects all vertices}}</li><li>{{c3:: acylic, it's a tree}}</li><li>{{c3:: minimal, the sum of all edge weights in the Tree is minimal}}</li></ul>
What does the Master theorem state when it comes to the upper bound on the asymptotic runtime of a function?
Let \(a, C > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\) \(T(n) \leq aT(\frac{n}{2}) + Cn^b\). Then for all \(n = 2^k\) the following statements hold: 1. if \(b > \log_2a\), \(T(n) \leq O(n^b)\) 2. if \(b = \log_2a\), \(T(n) \leq O(n^{log_2a}\log n)\) 3. if \(b < \log_2a\), \(T(n) \leq O(n^{\log_2a})\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does the Master theorem state when it comes to the upper bound on the asymptotic runtime of a function?
Back
Let \(a, C > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\)<br>\(T(n) \leq aT(\frac{n}{2}) + Cn^b\). <br>Then for all \(n = 2^k\) the following statements hold:<br>1. if \(b > \log_2a\), \(T(n) \leq O(n^b)\)<br>2. if \(b = \log_2a\), \(T(n) \leq O(n^{log_2a}\log n)\)<br>3. if \(b < \log_2a\), \(T(n) \leq O(n^{\log_2a})\)<br>
The {{c1::In-degree \(\deg_{\text{in} }(v)\) (Eingangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the end-vertex.
The {{c1::In-degree \(\deg_{\text{in} }(v)\) (Eingangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the end-vertex.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c1::In-degree \(\deg_{\text{in} }(v)\) (<i>Eingangsgrad</i>)}} of a vertex in a directed graph is the {{c2::number of edges that have \(v\) as the end-vertex}}.
insert(k, L): insert the key K at the end of the list L
get(i, L): return the memory address of the i-th key in list L
delete(k, L): remove the key k from the list L
insertAfter(k, k', L): inserts the key k' after the key k in the list L
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>List</b> defines the following operations:<br><ul><li>{{c1:: <b>insert(k, L)</b>}}: {{c2:: insert the key <b>K</b> at the end of the list <b>L</b>}}</li><li>{{c3:: <b>get(i, L)</b>}}: {{c4:: return the memory address of the i-th key in list <b>L</b> }}</li><li>{{c4:: <b>delete(k, L)</b>}}: {{c5:: remove the key <b>k</b> from the list <b>L</b>}}</li><li>{{c6::<b>insertAfter(k, k', L)</b>}}: {{c7:: inserts the key <b>k'</b> after the key <b>k</b> in the list <b>L</b>}}</li></ul>
Explain how unions works in the optimised Union-Find:
Arrays:
rep, where rep[v] gives the representative of \(v\).
members, where members[rep[v]] which contains all members of the ZHK of \(v\)
rank, where rank[rep[v]] contains the size of the ZHK of \(v\).
We always merge the smaller ZHK into the bigger to minimise updates.
We update the reps, then the membership lists and finally the size
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Explain how unions works in the optimised <b>Union-Find:</b>
Back
Arrays:<br><ul><li><b>rep</b>, where <b>rep[v]</b> gives the representative of \(v\).</li><li><b>members</b>, where <b>members[rep[v]] </b>which contains all members of the ZHK of \(v\)<br></li><li><b>rank</b>, where <b>rank[rep[v]]</b> contains the size of the ZHK of \(v\).</li></ul><div>We always merge the smaller ZHK into the bigger to minimise updates.</div><img src="paste-5129796b3ae6c46edebbaae726a47f0c892c2435.jpg"><br>We update the reps, then the membership lists and finally the size
The ADT queue can be efficiently implemented using a singly linked list with a pointer to the end:
push: \(O(1)\) insert at the end, with pointer to the end
pop: \(O(1)\) remove the first element like in a stack
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>queue</b> can be efficiently implemented using a {{c1:: <b>singly linked list with a pointer to the end</b>}}:<br><ul><li><b>push</b>: {{c2:: \(O(1)\) insert at the end, with pointer to the end}}<br></li><li><b>pop</b>: {{c3:: \(O(1)\) remove the first element like in a stack}}</li></ul>
Approach: Add all vertices to the set of components (so every vertex has its own component). As long as the size of the components set is greater than 1, connect each component to the one with the cheapest edge.
Uses: Find MST in weighted, undirected graph
?
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
<div style="text-align: center;"><b>Boruvka</b></div><div><br></div><div><b>Runtime</b>: </div><div><br></div><div><b>Approach</b>: Add all vertices to the set of components (so every vertex has its own component). As long as the size of the components set is greater than 1, connect each component to the one with the cheapest edge.</div><div><br></div><div><b>Uses</b>: Find MST in weighted, undirected graph</div>
Approach
<ol><li>For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the <em>isolated vertices</em> of the graph as it’s <em>own connected component</em>.</li><li>Each vertex marks it’s cheapest outgoing edge as a <em>safe edge</em> (making use of the cut property). We add these to \(F\).</li></ol><ul><li>Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.<br><img src="paste-053ccf0acc6d560628bd8518b928a0d6c2687cb1.jpg"></li></ul><ol><li>Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.</li><li>\(F\) constitutes the edges of the MST.</li></ol>
Let \(W\) be a walk and let \(u\) be a vertex, what is \(\text{deg}_W(u)\)? (generally)
it is the degree of \(u\) in \(W\), which is the number of edges incident to \(u\) which are part of \(W\) but repetitions are included, therefore it is possible that \(\text{deg}(u) < \text{deg}_W(u)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Let \(W\) be a walk and let \(u\) be a vertex, what is \(\text{deg}_W(u)\)? (generally)
Back
it is the degree of \(u\) in \(W\), which is the number of edges incident to \(u\) which are part of \(W\) but <b>repetitions are included</b>, therefore it is possible that \(\text{deg}(u) < \text{deg}_W(u)\)
The {{c1::Out-degree \(\deg_{\text{out} }(v)\) (Ausgangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the start-vertex.
The {{c1::Out-degree \(\deg_{\text{out} }(v)\) (Ausgangsgrad)}} of a vertex in a directed graph is the number of edges that have \(v\) as the start-vertex.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c1::Out-degree \(\deg_{\text{out} }(v)\) (<i>Ausgangsgrad</i>)}} of a vertex in a directed graph is the {{c2::number of edges that have \(v\) as the start-vertex}}.
What is a sufficient condition to show that \(f = \Theta(g)\)?
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: \mathbb{N} \rightarrow \mathbb{R}^+\) and \(g: \mathbb{N} \rightarrow \mathbb{R}^+\) then \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = C \in \mathbb{R}^+\) then \(f = \Theta(g)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a sufficient condition to show that \(f = \Theta(g)\)?
Back
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: \mathbb{N} \rightarrow \mathbb{R}^+\) and \(g: \mathbb{N} \rightarrow \mathbb{R}^+\)<br>then \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = C \in \mathbb{R}^+\) then \(f = \Theta(g)\)
DFS Runtime: In a sparse graph adjacency list better, in a dense graph adjacency matrix is better.
\(|E| \geq |V|^2 / 10\), then DFS has the same runtime in the worst-case using adjacency matrices or lists as \(|V| + |E| \leq |V| + |V|^2 \)which is \(O(n^2)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
DFS Runtime: In a sparse graph {{c1:: adjacency list better}}, in a dense graph {{c1:: adjacency matrix is better}}.
Extra
\(|E| \geq |V|^2 / 10\), then DFS has the same runtime in the worst-case using adjacency matrices or lists as \(|V| + |E| \leq |V| + |V|^2 \)which is \(O(n^2)\).
In graph theory, a Hamiltonian path (Hamiltonpfad) is a path (Pfad) that contains every vertex (every vertex exactly once as it's a path).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In graph theory, a {{c2::Hamiltonian path (<i>Hamiltonpfad</i>)}} is a {{c1::path (<i>Pfad</i>) that contains every vertex (every vertex exactly once as it's a path)}}.
Search for the correct node under which the key is inserted: \(O(\log_2 n)\)
Insert the new key value as a separator
Rebalance (if necessary, i.e. more than 3 keys)
split node into two nodes (each gets 2 children and 1 seps)
the middle sep is pushed to the parent level (and propagate)
The rebalancing being recursively pushed to the parent limits the operations at the height \(h\) thus we get \(O(\log n)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>2-3 Tree</b>: Inserting Steps:<br><ol><li>{{c1::Search for the correct node under which the key is inserted: \(O(\log_2 n)\)}}</li><li>{{c2::Insert the new key value as a <b>separator</b>}}</li><li>{{c3::<b>Rebalance</b> (if necessary, i.e. more than 3 keys)<br></li></ol><ul><li>split node into two nodes (each gets 2 children and 1 seps)</li><li>the middle sep is pushed to the parent level (and propagate)}}</li></ul>
Extra
The rebalancing being recursively pushed to the parent limits the operations at the height \(h\) thus we get \(O(\log n)\).
Insert in \(O(1)\) as we know the first empty cell in the array and can just write the key there
Get in \(O(1)\) as we know the offset for each key
InsertAfter in \(\Theta(l)\), since we have to shift the entire contents of the array behind the newly inserted element by 1.
Delete in \(\Theta(l)\) as in the worst case (Delete first element) we need to shift all to the left by 1.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In an array we can:<br><ul><li><b>Insert</b> in {{c1:: \(O(1)\) as we know the first empty cell in the array and can just write the key there}}</li><li><b>Get</b> in {{c2::\(O(1)\) as we know the offset for each key}}</li><li><b>InsertAfter</b> in {{c3::\(\Theta(l)\), since we have to shift the entire contents of the array behind the newly inserted element by 1.}}<br></li><li><b>Delete</b> in {{c4::\(\Theta(l)\) as in the worst case (Delete first element) we need to shift all to the left by 1.}}<br></li></ul>
Take a limited number of terms, which is then automatically lower than the sum. \[ \frac{n^4}{2^4} = \frac{n}{2} \cdot (\frac{n}{2})^3 = \sum_{i = \frac{n}{2}}^n (\frac{n}{2})^3 \leq \sum_{i = 1}^n i^3 = 1^3 + \ ... \ + (\frac{n}{2})^3 + \ ... \ + n^3 \] Here we take only the n/2 term.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we derive a <b>lower</b> limit for a sum?
Back
Take a <b>limited number of terms</b>, which is then automatically <b>lower</b> than the sum.<br>\[ \frac{n^4}{2^4} = \frac{n}{2} \cdot (\frac{n}{2})^3 = \sum_{i = \frac{n}{2}}^n (\frac{n}{2})^3 \leq \sum_{i = 1}^n i^3 = 1^3 + \ ... \ + (\frac{n}{2})^3 + \ ... \ + n^3 \]<br>Here we take only the n/2 term.
Sei \(G\) ein ungerichteter, gewichteter und zusammenhängender Graph. Nehmen Sie an, dass es eine eindeutige Kante mit Gewicht \(1\) gibt und, dass das Gewicht aller anderen Kanten strikt größer als \(1\) ist.
Dann enthält jeder minimale Spannbaum von die Kante \(e\).
Back
ETH::1._Semester::A&D::11._Minimum_Spanning_Trees
Sei \(G\) ein ungerichteter, gewichteter und zusammenhängender Graph. Nehmen Sie an, dass es eine eindeutige Kante mit Gewicht \(1\) gibt und, dass das Gewicht aller anderen Kanten strikt größer als \(1\) ist.
Dann enthält jeder minimale Spannbaum von die Kante \(e\).
True
Wir wählen immer die Kante \(e\), weil sie die günstigste Art die ZHK's zu verbinden ist.
Siehe Cut Property.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Sei \(G\) ein ungerichteter, gewichteter und zusammenhängender Graph. <br>Nehmen Sie an, dass es eine eindeutige Kante mit Gewicht \(1\) gibt und, dass das Gewicht aller anderen Kanten strikt größer als \(1\) ist.<div>Dann enthält jeder minimale Spannbaum von die Kante \(e\).</div>
Back
True<br><br>Wir wählen immer die Kante \(e\), weil sie die günstigste Art die ZHK's zu verbinden ist.<br><br>Siehe Cut Property.
In an undirected graph, what is special about pre/post-ordering:
back-edges = forward-edges
cross edges are not possible
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In an undirected graph, what is special about pre/post-ordering:<br><ul><li><div>{{c2::back-edges = forward-edges}}</div></li><li><div><div>cross edges {{c1::are not possible}}</div></div></li></ul>
Prim's Algorithm Invariants: \(\forall v \not \in S, v \neq s\), \(d[v] = \) {{c1:: \(\min \{ w(u, v) \ | \ (u, v) \in E, u \in S \}\)(\(\infty\) if no such edge exists)}}.
Prim's Algorithm Invariants: \(\forall v \not \in S, v \neq s\), \(d[v] = \) {{c1:: \(\min \{ w(u, v) \ | \ (u, v) \in E, u \in S \}\)(\(\infty\) if no such edge exists)}}.
The 3rd invariant \[d[v] = \begin{cases} 0, & \text{if } v = s \text{ (the starting vertex)} \\ \min_{(u,v) \in E : u \in S} {w(u,v)}, & \text{if } v \in V \setminus S \text{ and } \exists (u,v) \in E \text{ with } u \in S \\ \infty, & \text{if } v \in V \setminus S \text{ and } \nexists (u,v) \in E \text{ with } u \in S \end{cases}\]ensures that d[v] always reflects the minimum cost to reach vertex v from the current MST.
We always want to add the vertex with the cheapest edge connecting it to the MST, thus this invariant has to hold in order for the algorithm to be correct.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Prim's Algorithm Invariants:<br>\(\forall v \not \in S, v \neq s\), \(d[v] = \) {{c1:: \(\min \{ w(u, v) \ | \ (u, v) \in E, u \in S \}\)(\(\infty\) if no such edge exists)}}.
Extra
<div>The 3rd invariant \[d[v] = \begin{cases} 0, & \text{if } v = s \text{ (the starting vertex)} \\ \min_{(u,v) \in E : u \in S} {w(u,v)}, & \text{if } v \in V \setminus S \text{ and } \exists (u,v) \in E \text{ with } u \in S \\ \infty, & \text{if } v \in V \setminus S \text{ and } \nexists (u,v) \in E \text{ with } u \in S \end{cases}\]ensures that d[v] always reflects the minimum cost to reach vertex v from the current MST.</div><div><br></div> <div>We always want to add the vertex with the cheapest edge connecting it to the MST, thus this invariant has to hold in order for the algorithm to be correct.</div>
How can we quickly check if an Eulerian walk exists?
we can check the degrees of the vertices, an Eulerian walk exists only if at most 2 vertices have an odd degree
this is because if a vertex has an odd degree, it must either be the start point or the endpoint as otherwise we would not be able to leave from it
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can we quickly check if an Eulerian walk exists?
Back
we can check the degrees of the vertices, an Eulerian walk exists only if at most 2 vertices have an odd degree<br><br>this is because if a vertex has an odd degree, it must either be the start point or the endpoint as otherwise we would not be able to leave from it
Differences between Subarray vs. Subsequence vs. Subset:
subarray: continous partition of the original
subsequence: non-continous partition
subset any subset (order does not matter)
Back
ETH::1._Semester::A&D::06._Dynamic_Programming
Differences between Subarray vs. Subsequence vs. Subset:
subarray: continous partition of the original
subsequence: non-continous partition
subset any subset (order does not matter)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Differences between Subarray vs. Subsequence vs. Subset:<br><ul><li><b>subarray</b>: {{c1:: continous partition of the original}}</li><li><b>subsequence</b>: {{c2:: non-continous partition}}</li><li><b>subset</b> {{c3:: any subset (order does not matter)}}</li></ul>
In a directed graph, for the edge \(e = (u, v)\), \(u\) is the direct predecessor (Vorgänger) of \(v\) and \(v\) the direct successor (Nachfolger of \(u\).
In a directed graph, for the edge \(e = (u, v)\), \(u\) is the direct predecessor (Vorgänger) of \(v\) and \(v\) the direct successor (Nachfolger of \(u\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a directed graph, for the edge \(e = (u, v)\), \(u\) is the {{c1::direct predecessor (<i>Vorgänger</i>)}} of \(v\) and \(v\) the {{c1::direct successor (<i>Nachfolger</i>}} of \(u\).
The ADT Dictionary implements the following methods:
search(x, W) returns the position of the key x in memory
insert(x, W) Insert the key x into W, as long as it’s not saved there yet
delete(x, W) find and delete the key x from W
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT Dictionary implements the following methods:<br><ul><li>{{c1::<b>search(x, W)</b> returns the position of the key x in memory}}</li><li>{{c2::<b>insert(x, W)</b> Insert the key <b>x</b> into <b>W</b>, as long as it’s not saved there yet}}<br></li><li>{{c3::<b>delete(x, W)</b> find and delete the key <b>x</b> from <b>W</b>}}<br></li></ul>
For \(u, v \in V\) we say that \(u\) reaches \(v\) (erreicht) if there is a walk with endpoints \(u\) and \(v\) (or a path).
Reachability is an equivalence relation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(u, v \in V\) we say that {{c1::\(u\) <b>reaches</b> \(v\) (<i>erreicht</i>)}} if {{c2::there is a walk with endpoints \(u\) and \(v\) (or a path)}}.
<div style="text-align: center;"><b>Johnson</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| \cdot |V| + |V|^2 \cdot \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::Idea: Make all edges positive and then perform Dijkstra \(n\) times. To do this, create an additional node that is linked to each node with edge weight 0 and store for each node a height \(h(x)\), where \(h(x)\) is equal to the shortest path from the new node n to the node x (might be negative). The new weights are calculated with \(w'(u,v) = w(u,v) + h(u) - h(v)\).}}</div><div><br></div><div><b>Uses</b>: {{c3::All-to-all shortest paths in directed graphs without negative cycles.}}</div>
While traversing the tree, in each layer, we colour all vertices with the same. If we then encounter a vertex with the same colour during traversal, it's not two-colourable.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Bipartite Test with BFS:
Back
We substitute bipartite for two-colourable. <br><br>While traversing the tree, <b>in each layer</b>, we <b>colour all vertices with the same</b>. If we then <b>encounter </b>a vertex with the<b> same colour</b> during traversal, it's <b>not two-colourable</b>.<br><br><img src="paste-c8749f8e54bcf6eb4c7cd1ac37ca03ea43e15fd6.jpg">
Base Case: Let \(n = 5\) .... So the property holds for \(n = 5\). Induction Hypothesis: We assume the property is true for some \(k \geq 5\) Induction Step: We must show that the property holds for \(k + 1\).
By the principle of mathematical induction ... is true for all \(n \geq 5\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give the outline of an induction proof:
Back
We want to prove that ... for \(n \geq 5\)<br><br><b>Base Case: </b>Let \(n = 5\) .... So the property holds for \(n = 5\).<br><b>Induction Hypothesis:</b> We assume the property is true for some \(k \geq 5\)<br><b>Induction Step:</b> We must show that the property holds for \(k + 1\).<br><br>By the principle of mathematical induction ... is true for all \(n \geq 5\).
We want to find the subset \(I \subseteq \{1, \dots, n\}\) such that \(\sum_{i \in I} A[i] = b\) (must not exist for all \(b\)).<br><br>\(T(i,s)\) is 1 if there exists a subset from 1 to i that sums to s<br><ul><li>Base Case: T(0, 0) = 1 as we can use </li><li>Recursion: \( T(i, s) = T(i - 1, s) \ \lor \ T(i - 1, s - A[i]) \)</li></ul><div>Either we use A[i] or we don't.</div>
The ADT priorityQueue has the following operations:
insert: insert with priority p
extractMax: removes and returns element with highest priority.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>priorityQueue</b> has the following operations:<br><ul><li><b>{{c1:: insert}}</b>: {{c2::insert with priority <b>p}}</b><br></li><li><b>{{c3:: extractMax}}</b>: {{c4::removes and returns element with highest priority.}}<br></li></ul>
For insertion sort, we start at the left-side and create our sorted array there. We take the next element from the unsorted ones and insert it at the correct place in our sorted array.<br><img src="paste-5c36171852af92d3caae178195f26449be038802.jpg"><br>Insertion sort is slowly sorting in the elements from the right side into the left side sorted array.<br><br><i>This insertion is not constant time! We have to swap it with each previous element!</i>
<i>This insertion is not constant time! We have to swap it with each previous element!</i>
Invariant
Nach \(j\) Durchläufen der äusseren Schleife ist das Teilarray \(A[1, \dots, j]\) sortiert (es enthält aber nicht zwangsläufig die \(j\) kleinsten Elemente des Arrays)
Subset problem choosing the maximum staying under a weight \(W\).<br>The greedy algorithm fails as a local optimum is not global here.<br><br>Base Cases: \(dp[0][w] = 0, \quad dp[i][0] = 0\)<br>If item weight > max allowed left, don't take it. Otherwise get the max from using it or not:<br>\(dp[i][w] = \begin{cases} dp[i-1][w], & w_i > w \\ \max(dp[i-1][w], dp[i-1][w-w_i] + v_i), & \text{sonst} \end{cases}\)
A connected component of \(G\) is a equivalence class of the relation defined as follows: \(u = v\) if \(u\) reaches \(v\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A {{c1::connected component}} of \(G\) is a {{c2::equivalence class of the relation defined as follows: \(u = v\) if \(u\) reaches \(v\)}}.
In an edge \(e = \{u, v\}\), we call \(u\) adjacent (Adjazent oder Benachbart) to \(v\) (and the other way around) and \(e\) incident (Inzident oder Anliegen) to \(u, v\).
In an edge \(e = \{u, v\}\), we call \(u\) adjacent (Adjazent oder Benachbart) to \(v\) (and the other way around) and \(e\) incident (Inzident oder Anliegen) to \(u, v\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In an edge \(e = \{u, v\}\), we call \(u\) {{c1::adjacent (<i>Adjazent</i> oder <i>Benachbart</i>)}} to \(v\) (and the other way around) and \(e\) {{c2::incident (<i>Inzident</i> oder <i>Anliegen</i>)}} to \(u, v\).
1. Check if \(uv \in E \): \(O(1 + \min\{\text{deg}(u), \text{deg}(v) \})\) (we have to check the smaller of the two adjacency lists 2. Vertex \(u\), find all adjacent vertices: \(O(1+\text{deg}(u) )\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<b>Runtime</b>: Operations in an Adjacency <b>List</b>:
Back
1. Check if \(uv \in E \): \(O(1 + \min\{\text{deg}(u), \text{deg}(v) \})\) (we have to check the smaller of the two adjacency lists<br>2. Vertex \(u\), find all adjacent vertices: \(O(1+\text{deg}(u) )\)
Best Case: \(O(n \log n)\) Worst Case: \(O(n \log n)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Merge Sort
Runtime
Best Case: \(O(n \log n)\)<br>Worst Case: \(O(n \log n)\)
Approach
Merge sort works by divide-and-conquering the array into smaller chunks. it then merges them together slowly.<br><br>The merging works by having two indices showing the current position in the left and right array that we are merging.<br>We then compare the elements at the indices and take the smaller one. We then increase the counter on that array, while the other stays the same.<br><br>As soon as one array has been merged in completely, we can just append the second one (as it's already sorted).<br><br><img src="merge-sort-example_0.png">
<div>Merge sort always sorts correctly when called for a sub-array shorter than \(r - l + 1\).</div><div>This means that merge has to correctly merge the two sub-arrays into a complete array.</div>
Worst Case Scenario
The worst-case scenario for Mergesort is an array that has alternating small and big elements, thus they will always have to be compared during the merge.
Attributes
not in place, thus the space complexity is \(K(n)\). (can be made in place)<br><b>Stable</b>
The ADTs stack and queue behave similarly to a list, but with more constrained operations that allow more efficient computation.
Back
ETH::1._Semester::A&D::05._Data_Structures
The ADTs stack and queue behave similarly to a list, but with more constrained operations that allow more efficient computation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADTs {{c2::<b>stack</b> and <b>queue</b>}} behave similarly to a {{c1:: list}}, but with {{c3:: more constrained operations that allow more efficient computation}}.
Search for the correct node under which the key is inserted: \(O(\log_2 n)\)
Remove the leaf with the value and one separator
Rebalance (if necessary, i.e. now 1 key)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>2-3 Tree</b>: Deleting Steps:<br><ol><li>{{c1::Search for the correct node under which the key is inserted: \(O(\log_2 n)\)}}</li><li>{{c2::Remove the leaf with the value and one separator}}</li><li>{{c3::<b>Rebalance</b> (if necessary, i.e. now 1 key)}}</li></ol>
A vertex in a connected graph is a cut vertex if the subgraph obtained after removing it and all it's incident edges is disconnected.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A vertex in a connected graph is a {{c1::cut vertex}} if {{c2::the subgraph obtained after removing it and all it's incident edges is <b>disconnected</b>}}.
In a singly and doubly linked list, the operation:
Insert is \(\Theta(1)\) as we know the memory address of the final element in the list and just have to set the null pointer to the new keys address. Without this pointer it's \(\Theta(l)\).
Get is \(\Theta(i)\) very slow as we need to traverse the entire list up to i
insertAfter is \(O(1)\) if we get the memory address of the element to insert after.
delete is: SLL: {{c4::\(\Theta(l)\) as we need to find the previous element and change it's pointer.} DLL: \(O(1)\) we know the address of the previous element and then just edit it's pointer.
In a singly and doubly linked list, the operation:
Insert is \(\Theta(1)\) as we know the memory address of the final element in the list and just have to set the null pointer to the new keys address. Without this pointer it's \(\Theta(l)\).
Get is \(\Theta(i)\) very slow as we need to traverse the entire list up to i
insertAfter is \(O(1)\) if we get the memory address of the element to insert after.
delete is: SLL: {{c4::\(\Theta(l)\) as we need to find the previous element and change it's pointer.} DLL: \(O(1)\) we know the address of the previous element and then just edit it's pointer.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a <b>singly</b> and <b>doubly linked list</b>, the operation:<br><ul><li><b>Insert</b> is {{c1::\(\Theta(1)\) as we know the memory address of the final element in the list and just have to set the null pointer to the new keys address. Without this pointer it's \(\Theta(l)\). }}<br></li><li><b>Get</b> is {{c2::\(\Theta(i)\) very slow as we need to traverse the entire list up to <b>i</b>}}<br></li><li><b>insertAfter</b> is {{c3:: \(O(1)\) if we get the memory address of the element to insert after.}}<br></li><li><b>delete</b> is:<br> SLL: {{c4::\(\Theta(l)\) as we need to find the previous element and change it's pointer.}<br> DLL: {{c5:: \(O(1)\) we know the address of the previous element and then just edit it's pointer.}}</li></ul>
Steps of giving a DP solution:<br><ol><li>{{c1::Define the DP table (dimensions, index, range; meaning of entry): ex: <b>DP[1..n+1][1..k+1]</b>}}</li><li>{{c2::Computation of Entry (Base Case, recursive formula, pay attention to bounds!)}}</li><li>{{c3::Calculation Order (what depends on what entries, what variable incremented first)}}</li><li>{{c4::Extract Solution (How to get final solution out)}}</li><li>{{c5::Running time proof}}</li></ol>
During the recursive call, if we find an adjacent vertex without a post-number, there's a back-edge (\(\implies\)the recursive call for that edge is still active...)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Check for cycles in DFS algo:
Back
During the recursive call, if we find an adjacent vertex <b>without a post-number</b>, there's a back-edge (\(\implies\)the recursive call for that edge is still active...)
What is a sufficient condition to show that \(f \geq \Omega(g)\)?
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: N \rightarrow \mathbb{R}^+\) and \(g: N \rightarrow \mathbb{R}^+\) then if \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = \infty\), \(f \geq \Omega(g)\) but \(f \neq \Theta(g)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a sufficient condition to show that \(f \geq \Omega(g)\)?
Back
Let \(N\) be an infinite subset of \(\mathbb{N}\) and \(f: N \rightarrow \mathbb{R}^+\) and \(g: N \rightarrow \mathbb{R}^+\)<br>then if \(\lim_{n\rightarrow \infty} \frac{f(n)}{g(n)} = \infty\), \(f \geq \Omega(g)\) but \(f \neq \Theta(g)\)
the nodes \(u\) and \(v\) are merged to form one new node with 3 children.
The separator from the parent node is pulled down to be the new \(s_2\).
Parent may lose child -> rebalance there (can go up to the root). If root has 1 child -> root replaced by child.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
2-3 Tree: Deleting Steps if neighbour has 2 keys:
Back
<ol><li>the nodes \(u\) and \(v\) are <b>merged</b> to form one new node with <b>3 children</b>.</li><li>The separator from the parent node is pulled down to be the new \(s_2\).</li></ol>Parent may lose child -> rebalance there (can go up to the root).<br>If root has 1 child -> root replaced by child.<br><img src="paste-fcffee6f619138677fc86eb74beebfaa266c8cfe.jpg">
Outer loop: Iterate \(|E|\) times at most: Inner loop: find and union take \(O(\log |V|)\) per call amortised, thus \(O(|V| \log |V|)\) total.
This requires the Union Find Datastructure
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Kruskal's Algorithm
Runtime
\(O(|E| \log |E| + |V| \log |V|)\)<br><br><b>Outer loop: </b>Iterate \(|E|\) times at most:<br><b>Inner loop: </b>find and union take \(O(\log |V|)\) per call <b>amortised</b>, thus \(O(|V| \log |V|)\) total.
Requirements
Undirected, weighted, connected graph
Approach
<ol><li><b>Initialisation</b>: Start with an empty set \(F = \emptyset\) to represent the MST edges. Initially each vertex is it’s own seperate ZHK. </li><li><b>Iteration</b>: Sort all edges in the graphs by weight in increasing order. For each edge \((u, v)\) in sorted order: <br>If adding \((u, v)\) does not create a cycle (i.e. \(u\) and \(v\) in different ZHKs) <br>Add \((u, v)\) to \(F\). Merge the ZHKs of \(u\) and \(v\)</li><li>Stop: once we have \(n-1\) edges</li></ol><div>The operation of checking if there is no cycle can be done efficiently using the check of \(u\) and \(v\) being in different ZHKs. </div><div>This can be done efficiently using the <b>Union-Find datastructure</b>.</div>
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\): tree edge, as \(v\) is a descendant of \(u\)
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\): tree edge, as \(v\) is a descendant of \(u\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br>\(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\): {{c1:: tree edge, as \(v\) is a descendant of \(u\)}}
In an acyclic graph, topological sorting is already an algorithm that gives us the most-efficient order to calculate the cost in.
Because we can be sure that any predecessors already have the correct \(l\)-good bound distance (guaranteed by topo-sort, no backedges), we can simply relax once.
Thus we can compute the correct cheapest path in one "relaxation": \(O(|E|)\). Therefore with toposort: \(O(|V| + |E|)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Bellman-Ford optimisation in a DAG?
Back
In an acyclic graph, <b>topological sorting</b> is already an algorithm that gives us the most-efficient order to <b>calculate the cost in</b>.<br><br>Because we can be sure that any predecessors already have the correct \(l\)-good bound distance (guaranteed by topo-sort, no backedges), we can simply relax once.<br><br>Thus we can compute the correct cheapest path in one "relaxation": \(O(|E|)\).<br>Therefore with toposort: \(O(|V| + |E|)\)
Why does naively adding the lowest-edge weight not work for Johnson's?
We need the cost of the paths to stay the same relative to each other.
If we add a constant to each edge, long (length-wise) paths are penalised more. This means that the ordering of all paths by cost changes.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does naively adding the lowest-edge weight not work for Johnson's?
Back
We need the cost of the paths to stay the same relative to each other.<br><br>If we add a constant to each edge, long (length-wise) paths are penalised more. This means that the ordering of all paths by cost changes.
An edge in a connected graph is a cut edge if the subgraph obtained after removing it (keeping the vertices) is disconnected.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An edge in a connected graph is a {{c1::cut edge}} if {{c2::the subgraph obtained after removing it (keeping the vertices) is <b>disconnected</b>}}.
By plugging in previous terms into a recursive definition we can get a feel for it's asymptotic runtime. This is only for intuiton, not a proof
\(M(n + 1) = 3 \cdot M(n)\) turns into \(M(n + 1) = 3 \cdot (3 \cdot M(n - 1))\) and so on and so forth.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is telescoping?
Back
By plugging in previous terms into a recursive definition we can get a feel for it's asymptotic runtime. <i>This is only for intuiton, not a proof</i> <br><br>\(M(n + 1) = 3 \cdot M(n)\) turns into \(M(n + 1) = 3 \cdot (3 \cdot M(n - 1))\) and so on and so forth.
Insert the node \(v\) at the next free space in the tree, i.e. first to the left, then right (to conserve the tree structure).
Then we restore the heap condition by reverse-“versickern” the element until it’s restored.
You swap it with it’s parent nodes until the condition is restored.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we create a maxHeap?
Back
<div>Insert the node \(v\) at the next free space in the tree, i.e. first to the left, then right (to conserve the tree structure).</div><div><br></div> <div>Then we restore the heap condition by reverse-“<b>versickern</b>” the element until it’s restored.</div><div>You swap it with it’s parent nodes until the condition is restored.</div>
<div style="text-align: center;"><b>Prim</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}((|E| + |V|) \cdot \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::We start at a given vertex. To this subtree we add one-by-one the cheapest edge connecting the subtree to another component until all vertices are connected. The implementation is very similar to Dijkstra.}}</div><div><br></div><div><b>Uses</b>: {{c3::Find MST in weighted, undirected graph}}<b>Runtime</b>: {{c1::</div><div>\( \mathcal{O}((|E| + |V|) \cdot \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::We start at a given vertex. To this subtree we add one-by-one the cheapest edge connecting the subtree to another component until all vertices are connected. The implementation is very similar to Dijkstra.}}</div><div><br></div><div><b>Uses</b>: {{c3::Find MST in weighted, undirected graph}}</div>
Best Case: \(O(n \log n)\)<br>Worst Case: \(O(n^2)\)
Approach
Quicksort works by taking an element as the "pivot". We then split the array in to two parts: one smaller than the pivot and the other bigger.<br>We then swap the pivot into the middle of that.<br>Repeat for each of the smaller subdivisions, until you arrive at single-array elements.
Elemente links des pivots sind kleiner und Elemente rechts des Pivots sind größer als das Pivot-Element selbst.
Worst Case Scenario
<div>Already sorted array.</div><div>We usually choose the <b>last element</b> (element r) as the pivot. Then we only split the array into one part, with size \(n-1\).</div><div>If we instead randomly choose the pivot, we avoid the worst-case pitfalls.</div><div><br></div><div>In the best case the pivot is exactly in the middle and we can perfectly recurse with \(\log(n)\).</div>
Attributes
Not In-Place (but can be implemented as such)<br>Not Stable
During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):
Run DFS to find the connected components: \(O(|V| + |E|)\)
Find the cheapest one \(O(|E|)\)
We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Boruvka's Algorithm
Runtime
\(O((|V| + |E|) \cdot \log |V|)\)<br><br>During each iteration, we examine all edges to find the cheapest one: \(O(|V| + |E|)\):<br><ol><li>Run DFS to find the connected components: \(O(|V| + |E|)\)</li><li>Find the cheapest one \(O(|E|)\)</li></ol>We iterate a total of \(\log_2 |V|\) times as each iteration halves the number of connected components.
Requirements
undirected, connected, weighted Graph.
Approach
<ol><li>For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the <em>isolated vertices</em> of the graph as it’s <em>own connected component</em>.</li><li>Each vertex marks it’s cheapest outgoing edge as a <em>safe edge</em> (making use of the cut property). We add these to \(F\).</li></ol><ul><li>Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.<br><img src="paste-053ccf0acc6d560628bd8518b928a0d6c2687cb1.jpg"></li></ul><ol><li>Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.</li><li>\(F\) constitutes the edges of the MST.</li></ol>
<div style="text-align: center;"><b>Dijkstra</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}((|E| + |V|) \cdot \log|V|) \)}}</div><div><br></div><div><b>Approach</b>: {{c2::Put the starting node into the queue, take it out, and set the distance for all adjacent nodes and put them into the queue. Repeat (we always take cheapest vertex from the queue first, min heap), update distances and only put nodes into the queue if they weren't visited before.}}</div><div><br></div><div><b>Uses</b>: {{c3::Minimal-cost paths in non-negative weighted directed graphs}}</div>
<b>Union-Find</b> datastructure methods:<br><ul><li>{{c1::<b>make(u, v)</b> creates the DS for \(F = \emptyset\)}}<br></li><li>{{c2::<b>same(u,v) </b>test if \(u, v\) in the same component}}</li><li>{{c3::<b>union(u,v)</b> merge ZHKs of \(u, v\)}}<br></li></ul>
What can we learn by running DFS on a directed graph?
while running DFS we can keep a counter and each time we visit a vertex we denote the current counter value as the PRE value for that vertex and once we finish the recursive call on that vertex and return we denote the current counter as the POST value for that vertex.
This way we are able to reconstruct how the recursive calls overlap and construct the recursion call tree (also the depth-search tree/forest). Also, by reverse-sorting the nodes by their POST-value we get a topological sort.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What can we learn by running DFS on a directed graph?
Back
while running DFS we can keep a counter and each time we visit a vertex we denote the current counter value as the PRE value for that vertex and once we finish the recursive call on that vertex and return we denote the current counter as the POST value for that vertex.<br><br>This way we are able to reconstruct how the recursive calls overlap and construct the recursion call tree (also the depth-search tree/forest). Also, by reverse-sorting the nodes by their POST-value we get a topological sort.
We relax the edges one more time after \(n-1\) times. If the distance to an edge decreased, there's a negative cycle reachable from \(s\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does Bellman-Ford detect negative cycles?
Back
We relax the edges one more time after \(n-1\) times. If the distance to an edge decreased, there's a negative cycle reachable from \(s\).
The extract max operation works by taking the root node, the biggest element in the heap by it’s definition and restoring the heap condition.
We remove the root and replace it by the element that is most to the right (last element in the array storing the heap). Then we "versickern" this small element, until the heap condition is restored.
We swap it with the larger of the child nodes, until it's bigger than both of it's children.
This takes \(O(\log(n))\) time as the tree has maximum \(O(\log(n))\) levels.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does <b>extract_max</b> work for a maxHeap?
Back
<div>The extract max operation works by taking the root node, the biggest element in the heap by it’s definition and restoring the <b>heap condition</b>.</div><div><br></div><div>We remove the root and replace it by the element that is most to the right (last element in the array storing the heap).<br>Then we "versickern" this small element, until the heap condition is restored. </div><div>We <i>swap it with the larger of the child nodes</i>, until it's bigger than both of it's children. </div><div><br></div><div>This takes \(O(\log(n))\) time as the tree has maximum \(O(\log(n))\) levels.</div><div><br></div><div><img src="paste-bbcbf147dcbf6bb7fed164a5949034f0184f9017.jpg"></div>
How can I get the lower bound on the function \(n!\) ?
I can only take for example the largest 90% of elements \(n! \geq 1 \cdot 2 \cdot ... \cdot n \geq n/10 \cdot ... \cdot n\)
\(\geq (n/10)^{0.9n}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can I get the lower bound on the function \(n!\) ?
Back
I can only take for example the largest 90% of elements \(n! \geq 1 \cdot 2 \cdot ... \cdot n \geq n/10 \cdot ... \cdot n\)<div>\(\geq (n/10)^{0.9n}\)</div>
How do we know if a walk \(W=(v_0, ..., v_n)\) is closed using the degree of \(v_n\) in \(W\)?
it is closed if and only if \(\text{deg}_W(v_n)\) is even
every occurrence of \(v_n\) within the walk increases its degree by 2, so it does not affect parity so if the degree is even then \(v_n\) is both the first and the last node
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we know if a walk \(W=(v_0, ..., v_n)\) is closed using the degree of \(v_n\) in \(W\)?
Back
it is closed if and only if \(\text{deg}_W(v_n)\) is even<br><br>every occurrence of \(v_n\) within the walk increases its degree by 2, so it does not affect parity so if the degree is even then \(v_n\) is both the first and the last node
Minimum amount of edits (insert, delete, replace) to go from s1 to s2 -> LGT gives us the ED.<br><br>Three cases for \(a_i\) last char of \(a\):<br><ul><li>deleted: \(ED(i, j) = 1 + ED(i - 1, j)\) (if deleted, it doesn't matter when)<br><img src="paste-254e45a17676954472f6aebe7c8c4f0517b3d6b5.jpg"></li><li>ends up in \(1, \dots, j-1\): no char \(a_k, k < i\) can be behind \(a_i\) (suboptimal as it would cost 2): \(E1+ ED(i, j -1)\)<br><img src="paste-fae70ea53a12531dc9ac1ac30b00512b6f0c150e.jpg"></li><li>ends up at \(b_j\): cannot insert char behind \(a_i\) thus: \(ED(i-1, j -1) \) if \(a_i = b_j\) else \(1 + ED(i-1, k-1)\) <br><img src="paste-3027dc66600e0cb2f8e3a1b12c8a1be248f13f5c.jpg"> </li></ul>
In very dense graphs\(|E| > \frac{|V|^2}{\log |V|}\), Dijkstra's is faster on an array than in a minHeap.
Extract_min takes \(O(|V|)\) with an array (\(O(\log |V|)\) in a MinHeap) -> array implementation runtime: \(O(|V|^2 + |E|) = O(|V|^2)\) for \(|E| = \Theta(|V|^2)\) (there are at most \(|V|^2\) edges in a graph).
If we plug in |E| > ... into the log runtime we see it's faster.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
When do we want Dijkstra's with an array?
Back
In very dense graphs\(|E| > \frac{|V|^2}{\log |V|}\), Dijkstra's is <b>faster on an array than in a minHeap</b>.<br><br><div>Extract_min takes \(O(|V|)\) with an array (\(O(\log |V|)\) in a MinHeap) -> array implementation runtime: \(O(|V|^2 + |E|) = O(|V|^2)\) for \(|E| = \Theta(|V|^2)\) (there are at most \(|V|^2\) edges in a graph).</div><div><br></div><div>If we plug in |E| > ... into the log runtime we see it's faster.</div>
To join a set of disjoint connected components, we need to use an edge to join two of their vertices. The idea is that the cheapest such edge is always a safe edge.
This is true only for distinct edge weights!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the Cut-Property (Schnittprinzip)?
Back
To join a set of disjoint connected components, we need to use an edge to join two of their vertices. The idea is that the <i>cheapest</i> such edge is always a <i>safe edge.</i><div><i><br></i></div><div><b>This is true only for distinct edge weights!</b></div>
<ol><li><b>Initialise</b>: distance matrix D D[i][j] is the weight of the edge from \(i \rightarrow j\) if it exists, \(\infty\) otherwise<br></li><li><b>Iterate over intermediate</b>: for each vertex \(k\) update D[i][j] = min(D[i][j], D[i][k] + D[k][j]). for all intermediate k from 1,...,n</li></ol><div><br></div><div>The final distance matrix D contains the shortest path from any i to j.</div><div><br></div><div><i>Note that this can also be done using a 3d DP table, the 2d is just optimised.</i><br></div>
Pseudocode
<img src="paste-f6965d427f4a2df5b61ba8dd2ee9c0f0a90baaf6.jpg"><br><div><b>Important</b>: Use a value like 10000 instead of Integer.MAX_VALUE in Java, as you get <b>overflows</b> otherwise.</div>
We add a vertex \(s\) and add a 0 cost edge from it to all vertices.
We then run B-F which determines the height of each vertex by the d[v] from start vertex \(s\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Reweighting in Johnson's algorithm:<br><ol><li>We {{c1::add a vertex \(s\)}} and {{c1::add a 0 cost edge from it to all vertices}}.</li><li>We then {{c2::run B-F which determines the height of each vertex by the d[v] from start vertex \(s\)}} </li></ol>
The amortised runtime of union in the Union-Find DS is \(O(|V| \log |V|)\).
union takes \(\Theta(\min \{ |ZHK(u)| , |ZHK(v)| \}\). In the worst case, the minimum is \(|V| / 2\) as both have the same size.
Therefore over all loops, this would take \(O(|V| \log |V|)\) time, as on average we only take \(O(\log |V|)\) time. The graph stays worst case, this is the average of the calls in the worst case.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The amortised runtime of <b>union</b> in the Union-Find DS is {{c1:: \(O(|V| \log |V|)\)}}.
Extra
union takes \(\Theta(\min \{ |ZHK(u)| , |ZHK(v)| \}\). In the worst case, the minimum is \(|V| / 2\) as both have the same size.<br><br>Therefore over all loops, this would take \(O(|V| \log |V|)\) time, as <i>on average</i> we only take \(O(\log |V|)\) time.<br><i>The graph stays worst case, this is the average of the calls in the worst case.</i>
A graph \(G\) is transitive when for {{c2:: any two edges \(\{u, v\} \text{ and } \{v, w\}\) in \(E\), the edge \(\{u, w\}\) is also in \(E\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is {{c1:: <b>transitive</b>}} when for {{c2:: any two edges \(\{u, v\} \text{ and } \{v, w\}\) in \(E\), the edge \(\{u, w\}\) is also in \(E\)}}.
Is it possible to use the master theorem to get \(\Theta(f)\)? How?
for a recursive function if both the Master theorem for the upper bound on the runtime and the lower bound on the runtime hold, then \(T(n) = \Theta(n^b), \Theta(n^{\log_2 a}\log n), \Theta(n^{\log_2 a})\) respectively for the three cases
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Is it possible to use the master theorem to get \(\Theta(f)\)? How?
Back
for a recursive function if both the Master theorem for the upper bound on the runtime and the lower bound on the runtime hold, then \(T(n) = \Theta(n^b), \Theta(n^{\log_2 a}\log n), \Theta(n^{\log_2 a})\) respectively for the three cases
A graph \(G\) is connected (Zusammenhängend) if for every two vertices \(u, v \in V\) \(u\) reaches \(v\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A graph \(G\) is {{c1::connected (<i>Zusammenhängend</i>)}} if {{c2::for every two vertices \(u, v \in V\) \(u\) reaches \(v\)}}.
Backtracking can find the solution of the problem from the DP table. From the recursion and it's behaviour we find the "path"
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Backtracking in DP Problems
Back
Backtracking can find the solution of the problem from the DP table. From the recursion and it's behaviour we find the "path"<br><br><img src="paste-c186a33203c3cb874cfeb7870ee1a4c5d52bf205.jpg">
Approach: Initiate all distances with \(\infty\) . Then go \(|V| - 1\) times through every edge, and test for all (u,v) in E if \(\text{dist}[v] > \text{dist}[u] + w(u,v)\). If yes, update the distance. If after \(|V| - 1\) iterations an edge can still be relaxed (in a last iteration), then there exists a negative cycle
Uses: Detect negative cycles, find minimal-cost paths in weighted graphs with negative weights}}
?
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
<div style="text-align: center;"><b>Bellman-Ford</b></div><div style="text-align: center; "><br></div><div><b>Runtime</b>: :\( \mathcal{O}(|E| \cdot |V|)\)}}</div><div><br></div><div><b>Approach</b>: Initiate all distances with \(\infty\) . Then go \(|V| - 1\) times through every edge, and test for all (u,v) in E if \(\text{dist}[v] > \text{dist}[u] + w(u,v)\). If yes, update the distance. If after \(|V| - 1\) iterations an edge can still be relaxed (in a last iteration), then there exists a negative cycle</div><div><br></div><div><b>Uses</b>: Detect negative cycles, find minimal-cost paths in weighted graphs with negative weights}}</div>
<div style="text-align: center;"><b>Kruskal</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| \log |E| + |E| \log|V|)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::Sort the edges by weight and add them one-by-one as long as they are in different components (which can be checked efficiently with Union Find).}}</div><div><br></div><div><b>Uses</b>: {{c3::Find MST in weighted, undirected graph}}</div>
Same as with pre-/postordering, we can use enter-/leave-ordering here:
enter step at which vertex \(v\) is first encountered.
leave step at which vertex \(v\) is dequeued
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Pre- and Postordering in BFS:
Back
<div>Same as with <strong>pre-/postordering</strong>, we can use <strong>enter-/leave-ordering</strong> here: </div><div><ul><li><code>enter</code> step at which vertex \(v\) is first encountered.</li><li><code>leave</code> step at which vertex \(v\) is dequeued<br></li></ul><div><img src="paste-19431b32f9a8ad33704854b76596be9edd8629d5.jpg"></div></div>
It's a \(G = (V, E)\) with \(V\) the set of all vertices (Knotenmenge) and \(E\) the set of all edges (Kantenmenge).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the mathematical definition of a Graph?
Back
It's a \(G = (V, E)\) with \(V\) the set of all vertices (<i>Knotenmenge</i>) and \(E\) the set of all edges (<i>Kantenmenge</i>).
Explore as far as possible along each branch before backtracking. Potentially keep track of pre- / post-numbers to make edge classifications.<br><br>We want to find a sink, add it to the list, then backtrack and find the next one.<br><br>The reversed post-order then gives us a toposort.<br><br>Example output:<br><img src="paste-f6163ccea9c72dbfdc9cb9045b600a5a41b8aa6b.jpg">
Our current node adopts one of the children. The separators have to be updated (one is given with the adopted child)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<b>2-3 Tree</b>: Deleting Steps if neighbour has 3 keys:
Back
Our current node adopts one of the children. The separators have to be updated (one is given with the adopted child)<br><img src="paste-bd8f4c10d3d0aaa08619b4e358673f9ff6b134a0.jpg">
set the inner loop variable to be the array's inner variable:
for j in ...: for i in ...: DP[j][i]
Otherwise we have to jump DP[i].length elements each time we want to access the next element
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
how to speed up array access to DP-Array
Back
<b>Row-Major</b> vs. <b>Column Major</b> Access:<br><br>set the inner loop variable to be the array's inner variable:<br><br>for j in ...:<br> for i in ...:<br> DP[j][i]<br><br>Otherwise we have to jump DP[i].length elements each time we want to access the next element
For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the isolated vertices of the graph as it’s own connected component.
Each vertex marks it’s cheapest outgoing edge as a safe edge (making use of the cut property). We add these to \(F\).
Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.
Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.
\(F\) constitutes the edges of the MST.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Describe the steps of <b>Boruvka's Algorithm</b>:
Back
<ol><br><li>For Boruvka, we start with the set of edges \(F = \emptyset\). We treat each of the <em>isolated vertices</em> of the graph as it’s <em>own connected component</em>.</li><li>Each vertex marks it’s cheapest outgoing edge as a <em>safe edge</em> (making use of the cut property). We add these to \(F\).</li></ol><ul><li>Note that some of the edges might be chosen by both adjacent vertices, we still only add them once.<br><img src="paste-053ccf0acc6d560628bd8518b928a0d6c2687cb1.jpg"></li></ul><ol><li>Now, repeat by finding the cheapest outgoing edge for each component. Do this until all are connected.</li><li>\(F\) constitutes the edges of the MST.</li></ol>
<div>Prim’s algorithm starts with a single vertex and grows the MST outwards from that seed.</div>
<ol>
<li><strong>Initialisation:</strong><ul>
<li>Select and arbitrary starting vertex \(s\) and empty set \(F\)</li>
<li>Set \(S = {s}\) tracks the vertices in the MST</li>
<li>Each vertex gets a <code>key[v] =</code> representing the cheapest known connection cost to \(v\):<ul>
<li>\(\infty\) if no edge connects \(s\) to \(v\)</li>
<li>\(w(s, v)\) if edge \((s, v)\) exists</li>
</ul>
</li>
<li>Use a priority queue \(Q\) (<em>Min-Heap</em>) to store the vertices, in order of lowest <code>key</code> cost</li>
</ul>
</li>
<li><strong>Iteration:</strong><ul>
<li><em>Select and add</em> Extract the vertex \(u\) with the minimum <code>key</code> from \(Q\). This is the cheapest to connected to the current MST. Add \(u\) to \(S\).</li>
<li><em>Update Neighbours</em> For each neighbour <b>\(v\) </b>of \(u\) <em>not</em> in \(S\):<ul>
<li>If \(w(u, v) < \text{key}[v]\) update <code>key[v] = w(u, v)</code> and update the priority in \(Q\).<ul>
<li>This discovers potentially cheaper connections to vertices outside the current MST. If a <em>cheaper edge</em> to \(v\) is found, the current value in <code>key[v]</code> cannot be part of the MST</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><strong>Termination:</strong> When \(Q\) is empty, all vertices are in \(S\) and connected, and the edges chosen are in the MST (tracked in the set \(F\) through updates).</li></ol>
Explain how to find a topological order (high-level):
it is a sorting of the vertices of a directed graph, which we can build from the back by always finding a vertex which has no succeeding vertices, remove it from the graph and add it to the front of our topologically sorted list.
This is not possible if there is a directed cycle in the graph.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Explain how to find a topological order (high-level):
Back
it is a sorting of the vertices of a directed graph, which we can build from the back by always finding a vertex which has no succeeding vertices, remove it from the graph and add it to the front of our topologically sorted list.<br><br>This is not possible if there is a directed cycle in the graph.
We can use a binary search tree to implement the dictionary. The tree-condition is for every node, all keys in the left child are smaller than those in the right child.
We can use a binary search tree to implement the dictionary. The tree-condition is for every node, all keys in the left child are smaller than those in the right child.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We can use a binary search tree to implement the dictionary. The tree-condition is {{c1::for every node, all keys in the left child are smaller than those in the right child}}.
In BFS enter/leave ordering, the FIFO queue guarantees that the enter order = leave order within a given level.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In BFS enter/leave ordering, the FIFO queue guarantees that {{c1:: the <b>enter</b> order = <b>leave</b> order}} within a given level.
The ADT stack can be efficiently implemented using a singly linked list:
push: \(\Theta(1)\)
pop: \(\Theta(1)\) as this removes the first element. This means we just copy the pointer next from the first element to be the first pointer of the list.
The ADT stack can be efficiently implemented using a singly linked list:
push: \(\Theta(1)\)
pop: \(\Theta(1)\) as this removes the first element. This means we just copy the pointer next from the first element to be the first pointer of the list.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>stack</b> can be efficiently implemented using a {{c1:: <b>singly linked list</b>}}:<br><ul><li><b>push</b>: {{c2:: \(\Theta(1)\)}}<br></li><li><b>pop</b>: {{c3:: \(\Theta(1)\) as this removes the first element. This means we just copy the pointer next from the first element to be the first pointer of the list.}}<br></li></ul>
<div>Heapsort works like selection sort by always selecting the largest element and placing it at the end of the sorted array, but instead of having to do an expensive linear search for the largest element, we make it \(O(\log(n))\).</div><div><br></div> <div>This is done by converting the array into a <b>MaxHeap</b> before sorting.</div><div>This Heap is a tree that has the property that children are always smaller than their parents.</div>
<div style="text-align: center;"><b>Floyd-Warshall</b></div><div style="text-align: center; "><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|V|^3)\)}}</div><div><br></div><div><b>Approach</b>: {{c2::3D DP: It is based on a triple-nested <code>for</code>-loop with the following recursion: \(d[u][v] = \min(d[u][v], d[u][i] + d[i][v])\).}}</div><div><br></div><div><b>Uses</b>: {{c3::All-to-all shortest path in directed graph without negative cycles.}}</div>
Best Case: \(O(n^2)\) (\(O(n)\) if checking for swaps and aborting early) Worst Case: \(O(n^2)\)
We use \(\Theta(n^2)\) comparisons and \(O(n^2)\) switches.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Bubble Sort
Runtime
Best Case: \(O(n^2)\) (\(O(n)\) if checking for swaps and aborting early)<br>Worst Case: \(O(n^2)\)
Approach
It goes through the array \(n\) times, each time "bubbling up" the biggest element to the end, by swapping it.<br><br>During each inner iteration, high elements are swapped with their right neighbours until they hit a higher one. The algorithm then continues after that.<br><img src="paste-77ff59065d5ea6786b5452097dc4c319413d239e.jpg">
<div>DP-Table: <code>DP[0..n][0..m]</code> for \(n, m\) lengths of the strings</div><div><br></div><div><div>longest common subsequence that two strings share. For example TIGER and ZIEGE share IGE as a LGT.</div></div><div><br></div><div>
<div>This gives us the following recursion: \[L(i,j) = \begin{cases} 0, & i = 0 \text{ oder } j = 0 \\ L(i-1, j-1) + 1, & X_i = Y_j \\ \max(L(i-1,j), L(i,j-1)), & X_i \neq Y_j \end{cases}\]</div></div>
There exists a negative cycle \(\Leftrightarrow \exists v \in V \ : \ d^n_{v \rightarrow v} < 0\)
In words: If there exists a path from a vertex to itself with negative weight (passing through any other vertex, i.e. \(n\)th iteration of the outer loop), then there exists a negative cycle that contains this vertex.
We can perform a negative cycle check at the end, by going over all diagonals.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Floyd-Warshall, when is there a negative cycle?
Back
<div>There exists a negative cycle \(\Leftrightarrow \exists v \in V \ : \ d^n_{v \rightarrow v} < 0\)</div><div><br></div> <div>In words: If there exists a path from a vertex to itself with negative weight (passing through any other vertex, i.e. \(n\)th iteration of the outer loop), then there exists a negative cycle that contains this vertex.</div><br><div>We can perform a negative cycle check at the end, by going over all diagonals.</div>
The upper limit can be expressed as the highest term, times the amount of terms:\[ \sum_{i = 1}^n i^3 = 1^3 + 2^3 + 3^3 + \ ... \ + n^3 \leq n \cdot \sum_{i = 1}^n n^3 = n^4 \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we derive an upper limit for a sum?
Back
The upper limit can be expressed as the <b>highest term</b>, times the <b>amount of terms</b>:\[ \sum_{i = 1}^n i^3 = 1^3 + 2^3 + 3^3 + \ ... \ + n^3 \leq n \cdot \sum_{i = 1}^n n^3 = n^4 \]<br>
runtime dependent on a number \(W\) (like in knapsack) which is not correlated polynomially to input length but exponentially.
The DP-table get's 10x for \(W = 10 \rightarrow 100\) but the input size (binary) only grows from \(\log_2(10) \approx 3 \rightarrow \approx 6\) so x2.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is pseudo-polynomial time?
Back
runtime dependent on a number \(W\) (like in knapsack) which is not correlated polynomially to input length but exponentially.<br><br>The DP-table get's 10x for \(W = 10 \rightarrow 100\) but the input size (binary) only grows from \(\log_2(10) \approx 3 \rightarrow \approx 6\) so x2.
In every iteration of insertion sort, we take the first element from the unsorted input and place it correctly in the sorted output.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In every iteration of <b>insertion sort</b>, we {{c1::take the first element from the unsorted input and place it correctly in the sorted output}}.
We "relax" an edge when \(d[u] + c(u, v) < d[v]\). In other words, we currently say that there is a path from \(s \rightarrow u\) and \(u \rightarrow v\) such that it's shorter than \(s \rightarrow v\).
This means that our current upper-bound for the shortest distance to \(v\) (\(d[v]\)), is too high as it violates the triangle inequality. Thus we updated ("relax") the edge.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a relaxation in Bellman-Ford?
Back
We "relax" an edge when \(d[u] + c(u, v) < d[v]\). In other words, we currently say that there is a path from \(s \rightarrow u\) and \(u \rightarrow v\) such that it's shorter than \(s \rightarrow v\).<br><br>This means that our <b>current upper-bound</b> for the shortest distance to \(v\) (\(d[v]\)), is too high as it violates the triangle inequality. Thus we updated ("relax") the edge.
How can we make Knapsack polynomial using approximation?
round the profits and solve the Knapsack problem for these rounded profits:\(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\). We then only have to compute every K'th entry to the DP-table.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can we make Knapsack polynomial using approximation?
Back
round the profits and solve the Knapsack problem for these rounded profits:\(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\). We then only have to compute every K'th entry to the DP-table.
Every iteration, selection sort goes through the "unsorted part" of the array, searches for the biggest element and puts it at the end.<br><br>Thus on the right-side (or left-side if inverted), we have a list of sorted integers slowly growing, while we only compare the unsorted ones to findest the next biggest to put at the beginning of the sorted list.<br><br><img src="paste-6a66b1206f7de5b79d25af683f5dd409004852c0.jpg">
Pseudocode
<img src="paste-e41e8fe78828c54643b03175043cfb7610ff04df.jpg"><div>(This has the sorted list at the start thus searches the smallest element)</div>
Invariant
Nach \(j\) Durchläufen der äusseren Schleife sind die \(j\) grössten Elemente am richtigen Ort. (Same as for Bubblesort)
How can we use the Master theorem to get a lower bound on the asymptotic runtime of a recursive function?
Let \(a, C' > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\) \(T(n) \geq aT(\frac{n}{2}) + C'n^b\) . Then for all \(n = 2^k\) the following statements hold: 1. if \(b > \log_2a\), \(T(n) \geq \Omega(n^b)\) 2. if \(b = \log_2a\), \(T(n) \geq \Omega (n^{\log_2a}\log n)\) 3. if \(b < \log_2a\), \(T(n) \geq \Omega(n^{\log_2 a})\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can we use the Master theorem to get a lower bound on the asymptotic runtime of a recursive function?
Back
Let \(a, C' > 0\) and \(b \geq 0\) be constants and let \(T: \mathbb{N} \rightarrow \mathbb{R}^+\) a function such that for all even \(n \in \mathbb{N}\) <br> \(T(n) \geq aT(\frac{n}{2}) + C'n^b\) . <br>Then for all \(n = 2^k\) the following statements hold:<br>1. if \(b > \log_2a\), \(T(n) \geq \Omega(n^b)\)<br>2. if \(b = \log_2a\), \(T(n) \geq \Omega (n^{\log_2a}\log n)\)<br>3. if \(b < \log_2a\), \(T(n) \geq \Omega(n^{\log_2 a})\)
In Dijkstra's after visiting vertex \(v\), the distance \(d(v)\) is never updated anymore.
No negative edges means there's no shorter way (we consider in increasing distance order).
With negative weights, a longer path through an unvisited vertex could later turn out to be shorter due to a negative edge.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In Dijkstra's after visiting vertex \(v\), the distance \(d(v)\) is {{c1:: never updated anymore}}.
Extra
No negative edges means there's no shorter way (we consider in increasing distance order).<br><br>With negative weights, a longer path through an unvisited vertex could later turn out to be shorter due to a negative edge.
Table: DP[1..n]<br>Define the "randmax": \( R_j := \max_{1 \leq i \leq j} \sum_{k = i}^j A[k] \) (maximale summe eines teilarrays das an j endet.<br><ul><li>Base Case: \(R_1 = A[1]\)</li><li>Recursion is \(R_j = \max \{ A[j], R_{j - 1} + A[j]
\}\)<br>Thus either our current subarray contains the element at j, or not and we start with it again.</li></ul>
Pre-/Post-Ordering Classification for an edge \((u, v)\): \(\text{pre}(v) < \text{pre}(u) < \text{post}(u) < \text{post}(v)\): back edge
exists a cycle!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br>\(\text{pre}(v) < \text{pre}(u) < \text{post}(u) < \text{post}(v)\): {{c1:: back edge}}
In a linked list, the keys don't appear in order in memory. They each contain {c2::a pointer to the start of the next element in the list instead}}.
We also have an extra pointer to the end in practice.
The last pointer of the list is a null pointer to indicate the end.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a <b>linked list</b>, the keys {{c1::don't appear in order in memory}}. They each contain {c2::a pointer to the start of the next element in the list instead}}.<br><br>We also have {{c3::an extra pointer to the end in practice}}.
Extra
The last pointer of the list is a null pointer to indicate the end.
Set the distance to all vertices to \(\infty\) in the d[v] array. Set the d[s] = 0.
Initialise a Queue \(Q\) with \(s\)
Set the dictionary parent = {}
Exploration:
Dequeue the first element in the queue $v$
For all adjacent nodes \(u\) with distance \(= \infty\) (not visited yet):
Set the distance d[u] = d[v] + 1
add \(u\) to the queue
Set the parent[u] = v.
Return: We return the distances and the shortest path tree
The queue ensures that we don't mix up the order.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Describe the steps in <b>BFS</b>:
Back
BFS is a <b>shortest path algorithm</b>.<br><ol><li><strong>Initialisation:</strong> <ul>
<li>Set the distance to all vertices to \(\infty\) in the <code>d[v]</code> array. Set the <code>d[s] = 0</code>.</li>
<li>Initialise a Queue \(Q\) with \(s\)</li>
<li>Set the dictionary <code>parent = {}</code></li>
</ul>
</li>
<li><strong>Exploration:</strong><ul>
<li>Dequeue the first element in the queue $v$</li>
<li>For all <em>adjacent nodes</em> \(u\) with distance \(= \infty\) (not visited yet):<ul>
<li>Set the distance <code>d[u] = d[v] + 1</code></li>
<li>add \(u\) to the queue</li>
<li>Set the <code>parent[u] = v</code>.</li>
</ul>
</li>
</ul>
</li>
<li><strong>Return:</strong> We return the distances and the <em>shortest path tree</em></li></ol><div><br></div><div>The queue ensures that we don't mix up the order.</div>
A PriorityQueue is like a queue, with the difference that every key is associated with a natural number which indicates the importance.
The elements are then returned in the order of this importance.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <b>PriorityQueue</b> is like a queue, with the difference that {{c1:: every key is associated with a natural number which indicates the importance}}.
Extra
The elements are then returned in the order of this importance.
How does Depth-first-search work and what is its runtime for the two implementations of a graph?
a depth first search marks the vertices it visits, at each vertex it looks for a vertex it has not yet visited and if there are none, it tracks back to a vertex which still has some unvisited adjacent nodes
its runtime in an adjacency matrix is \(O(n^2)\) as it has to visit each vertex once and search through all \(n\) potential neighbors
implemented using adjacency lists, the runtime is \(O(n+m)\) as we still have to visit each vertex once but we only have to search through at most \(\text{deg}_{out}(u)\) vertices at each step, which adds up to searching through all the edges
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does Depth-first-search work and what is its runtime for the two implementations of a graph?
Back
a depth first search marks the vertices it visits, at each vertex it looks for a vertex it has not yet visited and if there are none, it tracks back to a vertex which still has some unvisited adjacent nodes<br><br>its runtime in an adjacency matrix is \(O(n^2)\) as it has to visit each vertex once and search through all \(n\) potential neighbors<br><br>implemented using adjacency lists, the runtime is \(O(n+m)\) as we still have to visit each vertex once but we only have to search through at most \(\text{deg}_{out}(u)\) vertices at each step, which adds up to searching through all the edges
The ADT priorityQueue can be efficiently implemented using a MaxHeap. This guarantees \(O(\log n)\) for both operations.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>The ADT <b>priorityQueue</b> can be efficiently implemented using a {{c1:: <b>MaxHeap</b>}}. This guarantees {{c2:: \(O(\log n)\)}} for both operations.</div>
We iterate over all edges in the "relaxation" thus the time complexity of that step is \(O(m)\) (the actual check is \(O(1)\)). As we relax \(n - 1\) (or \(n\) for negative cycle check) times, the total runtime is \(O(n \cdot m)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Bellman-Ford
Runtime
\(O(|V| \cdot |E|)\) (uses DP)<br><br>We iterate over all edges in the "relaxation" thus the time complexity of that step is \(O(m)\) (the actual check is \(O(1)\)).<br>As we relax \(n - 1\) (or \(n\) for negative cycle check) times, the total runtime is \(O(n \cdot m)\).
Requirements
Negative-edges allowed (neg. cycles detected) in a directed, weighted graph.
Approach
<ol>
<li><b>Initialize</b>:<br>Set the distance to the source vertex as 0 and to all other vertices as infinity.</li>
<li><b>Relax Edges</b>: <br>Repeat for V − 1 iterations (where V is the number of vertices):<br>For each edge, update the distance to its destination vertex if the distance through the edge
is smaller than the current distance.</li>
<li><b>Check for Negative Cycles</b>: <br>Check all edges to see if a shorter path can still be found. If so, the graph contains a negative-
weight cycle.</li>
<li><b>End</b>: <br>If no negative-weight cycle is found, the algorithm outputs the shortest paths.</li></ol><img src="paste-95017d19365697a9f94b52394c6bdb999dfc81d1.jpg"><br><br>(quicker to implement the edge-based approach, but there's also a vertex based approach)
Binary trees are not balanced possible that \(h >> \log_2 n\) Worst case example if inserted in ascending order:
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<b>Worst case</b> for <b>search</b> in a <b>binary tree</b>?
Back
Binary trees are not <b>balanced</b> possible that \(h >> \log_2 n\)<br>Worst case example if inserted in ascending order:<br><b></b><img src="paste-201c49e27928e7a814e89e8de667e07e5c7789ce.jpg">
Minimal jumps to get from beginning of array to the end.<br><br>Variable switch: cells which we can reach in \(k\) jumps. Solution is smallest \(k\) for which \(M[k] \geq n\).<br><br>We look at all \(i\) we can reach with exactly \(k-1\) jumps:<br><ul><li>Base Case: \(M[0] = A[0]\), \(M[1] = A[1] + 1\)</li><li>Recursion: \( M[k] = \max \{i + A[i] \ | \ M[k - 2] \leq i \leq M[k - 1]\} \)</li></ul><div>We look exactly 1 at every \(i\), thus \(O(n)\)</div>
<div style="text-align: center;"><b>BFS</b></div><div><br></div><div><b>Runtime</b>: {{c1::\( \mathcal{O}(|E| + |V|) \)}}</div><div><br></div><div><b>Approach</b>: {{c2::First go through all direct successors of an edge, then move to a level deeper.}}</div><div><br></div><div><b>Uses</b>: {{c3::Shortest path in unweighted graphs, cycle detection, test if graph is bipartite, path finding}}</div>
A cheapest path in a weighted graph (without negative cycles) has the optimal substructure property: any subpath is itself the cheapest path between it's endpoints.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Optimal substructure of cheapest paths:
Back
A cheapest path in a weighted graph (without negative cycles) has the optimal substructure property: <i>any subpath is itself the cheapest path between it's endpoints</i>.
The length of a walk \((v_0, v_1, \dots, v_k)\) is \(k\), i.e. the number of vertices minus 1.
A walk of length \(l\) connects \(l + 1\) vertices.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the length of a walk?
Back
The length of a walk \((v_0, v_1, \dots, v_k)\) is \(k\), i.e. the number of vertices minus 1.<br><br>A walk of length \(l\) connects \(l + 1\) vertices.
The distances "d[.] = " in the distance array are the values of the vertices in the priority queue (see line decrease_key(H, v, d[v])).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Prim's Algorithm Invariants:<br><br><div>The distances "d[.] = " in the distance array are {{c1::the values of the vertices in the priority queue (see line decrease_key(H, v, d[v]))}}.</div>
Prim's Algorithm is similar to Dijkstra's with the difference that \(d[v]\) is the minimum between current value and \(w(v*, v)\) instead of \(d[v^*] + w(v^*, v)\) .
Prim's Algorithm is similar to Dijkstra's with the difference that \(d[v]\) is the minimum between current value and \(w(v*, v)\) instead of \(d[v^*] + w(v^*, v)\) .
Dijkstra's find the shortest distance to each vertex, thus it tracks the total.
Prim's needs to build the MST, thus it only cares about which vertex to choose next to find a (cheapest) safe-edge.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>Prim's Algorithm</b> is similar to {{c1:: Dijkstra's}} with the difference that {{c1:: \(d[v]\) is the minimum between current value and \(w(v*, v)\) instead of \(d[v^*] + w(v^*, v)\) }}.
Extra
Dijkstra's find the shortest distance to each vertex, thus it tracks the total.<br><br>Prim's needs to build the MST, thus it only cares about which vertex to choose next to find a (cheapest) safe-edge.
Prim's Algorithm Invariants: The priority queue \(H = V \setminus S\) (\(V\) set of all vertices, \(S\) vertices currently in the MST) never contains a vertex already in the MST.
Prim's Algorithm Invariants: The priority queue \(H = V \setminus S\) (\(V\) set of all vertices, \(S\) vertices currently in the MST) never contains a vertex already in the MST.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Prim's Algorithm Invariants: <br>The priority queue \(H = V \setminus S\) (\(V\) set of all vertices, \(S\) vertices currently in the MST) {{c1::never contains a vertex already in the MST}}.
If \(\frac{f(n)}{g(n)}\) tends to {{c1::\(C \in \mathbb{R}^+\)}}, then \(f \leq O(g)\) and \(g \leq O(f) \Leftrightarrow f = \Theta(g)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(\frac{f(n)}{g(n)}\) tends to {{c1::\(C \in \mathbb{R}^+\)}}, then {{c2::\(f \leq O(g)\) and \(g \leq O(f) \Leftrightarrow f = \Theta(g)\)}}.
\(O(|V|+|E|)\) (Adjacency List)
The runtime of BFS:
each loop we take \(O(1 + \deg(u))\) time (go through the vertex \(u\)'s edges
We loop a total of \(|V|\) times (we visit each edge max. 1 time)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
BFS (Breadth First Search)
Runtime
\(O(|V|+|E|)\) (Adjacency List)
Requirements
Directed Graph ((negative) cycles accepted, as "shortest" (not cheapest) path not affected)
Approach
<b>BFS</b> looks for the shortest paths (not cheapest) in a graph.<br><ol><li><b>Initialisation:</b> <ul>
<li>Set the distance to all vertices to \(\infty\) in the <code>d[v]</code> array. Set the <code>d[s] = 0</code>.</li>
<li>Initialise a Queue \(Q\) with \(s\)</li>
<li>Set the dictionary <code>parent = {}</code></li>
</ul>
</li>
<li><b>Exploration:</b><ul>
<li>Dequeue the first element in the queue \(v\)</li>
<li>For all <em>adjacent nodes</em> \(u\) with distance \(= \infty\) (not visited yet):<ul>
<li>Set the distance <code>d[u] = d[v] + 1</code></li>
<li>add \(u\) to the queue</li>
<li>Set the <code>parent[u] = v</code>.</li>
</ul>
</li>
</ul>
</li>
<li><b>Return:</b> We return the distances and the <i>shortest path tree</i></li></ol>
The runtime of BFS:<br><ol><li>each loop we take \(O(1 + \deg(u))\) time (go through the vertex \(u\)'s edges</li><li>We loop a total of \(|V|\) times (we visit each edge max. 1 time)</li></ol>
The triangle inequality in a weighted graph is \(d(u, v) \leq d(u, w) + d(w, v)\)
Back
ETH::1._Semester::A&D::10._Shortest_Paths
The triangle inequality in a weighted graph is \(d(u, v) \leq d(u, w) + d(w, v)\)
This holds as if the path through \(w\) was actually cheaper, then \(d(u, v)\) would be wrong.
Does not hold in graphs with negative cycles.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c1::<b>triangle inequality</b>}} in a weighted graph is {{c2::\(d(u, v) \leq d(u, w) + d(w, v)\)}}
Extra
This holds as if the path through \(w\) was actually cheaper, then \(d(u, v)\) would be wrong.<br><br>Does not hold in graphs with negative cycles.
The runtime is calculated from \(O(n + (\#\text{extract-min} + \#\text{decrease-key}) \cdot \log n)\) which gives \(O((n + m) \cdot \log n)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Name
Dijkstra's Algorithm
Runtime
\(O((|E| + |V|) \log |V|)\) (or \(O(|V|^2)\)<br><br>The runtime is calculated from \(O(n + (\#\text{extract-min} + \#\text{decrease-key}) \cdot \log n)\) which gives \(O((n + m) \cdot \log n)\).
Requirements
No negative edge-weights (to make sure that we don't need to go back)
Approach
Vertices are considered in <i>increasing</i> order of their distances from the source.<br><br>Recurrence:\[ d(s, v_k) = \min_{(v_i, v_k) \in E, i < k} \{ d(s, v_i) + c(v_i, v_k) \} \]<br><ol><li>Add start vertex \(s\) to prioqueue with dist 0 and set all other dists to \(\infty\)</li><li>Pop Cheapest Vertex \(v\) from Priority Queue</li><li>For each neighbour \(u\): if distance (= current_distance + \(w(v\rightarrow u)\)) < distance to \(u\) then overwrite and push new distance to queue.<br>Current vertex is marked as visited and not revisited again.</li></ol>
In any ring \(\langle R; +, -, 0, \cdot, 1 \rangle\), and for all \(a, b \in R\) \(a0 =\) {{c1::\(0a = 0\)}}.
Extra
The zero (neutral of additive group) pulls all other elements to 0 by multiplication.<br><br>\(0a=(0+0)a=0a+0a\) and thus \(0a - 0a = 0a \implies 0 = 0a\)
A subset \(H \subseteq G\) of a group is called a subgroup if \(H\) is: closed with respect to all operations (operation, neutral, inverse).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>A subset \(H \subseteq G\) of a group is called a {{c1::subgroup}} if \(H\) is: {{c2::closed with respect to all operations (operation, neutral, inverse)}}.</p>
Are the rational numbers \(\mathbb{Q}\) countable?
Yes, the rational numbers \(\mathbb{Q}\) are countable. They correspond to (a, b) tuples which can be mapped bijectively to the natural numbers.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Are the rational numbers \(\mathbb{Q}\) countable?
Back
Yes, the rational numbers \(\mathbb{Q}\) are <strong>countable</strong>. They correspond to (a, b) tuples which can be mapped bijectively to the natural numbers.
A polynomial \(a(x)\) over a commutative ring \(R\) in the indeterminate \(x\) is a formal expression of the form: \[ a(x) = {{c2::a_d x^d + a_{d-1}x^{d-1} + \cdots + a_1 x + a_0}} = \sum_{i=0}^d a_i x^i \] for some non-negative integer \(d\), with \(a_i \in R\).
The set of polynomials in \(x\) over \(R\) is denoted \(R[x]\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is a polynomial over a commutative ring?</p>
Back
<p>A polynomial \(a(x)\) over a commutative ring \(R\) in the indeterminate \(x\) is a formal expression of the form: \[ a(x) = {{c2::a_d x^d + a_{d-1}x^{d-1} + \cdots + a_1 x + a_0}} = \sum_{i=0}^d a_i x^i \] for some non-negative integer \(d\), with \(a_i \in R\).</p>
<p>The set of polynomials in \(x\) over \(R\) is denoted \(R[x]\).</p><p><br></p>
Steps to proving an isomorphism \(\phi: G \rightarrow H\):
Back
We have to prove the map is:<br><ul><li>well-defined</li><li>The image of \(\phi\) lies entirely within \(H\)</li><li>homomorphism-property \(\phi(g_1 \cdot g_2) = \phi(g_1) \cdot \phi(g_2)\)</li><li>injectivity</li><li>surjectivity</li></ul>
For a poset \((A;\preceq)\), two elements \(a,b\) are comparable if \(a \preceq b\) or \(b \preceq a\), otherwise they are incomparable.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a poset \((A;\preceq)\), two elements \(a,b\) are <b>comparable</b> if {{c1::\(a \preceq b\) or \(b \preceq a\),}} otherwise they are <b>incomparable</b>.
For any \(i\) and \(k\), if \(t_1, \dots, t_k\) are terms, then {{c1::\(P_i^{(k)}(t_1, \dots, t_k)\) is a formula}}, called an atomic formula.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For any \(i\) and \(k\), if \(t_1, \dots, t_k\) are terms, then {{c1::\(P_i^{(k)}(t_1, \dots, t_k)\) is a formula}}, called an {{c2::<i>atomic formula</i>}}.
What does it mean intuitively for two groups to be isomorphic?
Two groups are isomorphic if they have the same structure - they "behave identically" even if they look different.
Analogy: Like two jigsaw puzzles that look completely different, but use the same cutout pattern. The same piece goes into the same place on both puzzles.
The bijection between them preserves all group operations and relationships.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What does it mean intuitively for two groups to be isomorphic?</p>
Back
<p>Two groups are isomorphic if they have the <strong>same structure</strong> - they "behave identically" even if they look different.</p>
<p><strong>Analogy</strong>: Like two jigsaw puzzles that look completely different, but use the same cutout pattern. The same piece goes into the same place on both puzzles.</p>
<p>The bijection between them preserves all group operations and relationships.</p>
For a homomorphism \(h: G \rightarrow H\), the {{c1::image \(\text{im} h\)}} is the set of all elements in \(H\) that are mapped to by some element in \(G\).
For a homomorphism \(h: G \rightarrow H\), the {{c1::image \(\text{im} h\)}} is the set of all elements in \(H\) that are mapped to by some element in \(G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>For a homomorphism \(h: G \rightarrow H\), the {{c1::image \(\text{im} h\)}} is the {{c2::set of all elements in \(H\) that are mapped to by some element in \(G\)}}.</p>
For every \(k\) we have:
\[(A_1 \lor \dots \lor A_k) \land (A_1 \rightarrow B) \land \dots \land (A_k \rightarrow B) \models B\]
(If at least one case occurs, and all cases imply \(B\), then \(B\) holds)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the logical rule for case distinction?
Back
For every \(k\) we have:
\[(A_1 \lor \dots \lor A_k) \land (A_1 \rightarrow B) \land \dots \land (A_k \rightarrow B) \models B\]
<br>
(If at least one case occurs, and all cases imply \(B\), then \(B\) holds)
Ein Körper ist eine Menge {{c1::\( \mathbb{K}\) mit Operationen \(+ , *\)}} mit folgenden Eigenschaften:
{{c2::
- \( (\mathbb{K}, +)\) ist eine abelsche Gruppe
- \( (\mathbb{K} \backslash \{0\}, *)\) ist eine abelsche Gruppe
- Distributivität: \( a * (b+c) = a*b + a*c\)
}}
Beispiel: \( \mathbb{Q}, \mathbb{R}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::Ein Körper}} ist eine Menge {{c1::\( \mathbb{K}\) mit Operationen \(+ , *\)}} mit folgenden Eigenschaften:<div>{{c2::<div>- \( (\mathbb{K}, +)\) ist eine abelsche Gruppe</div><div>- \( (\mathbb{K} \backslash \{0\}, *)\) ist eine abelsche Gruppe</div><div>- Distributivität: \( a * (b+c) = a*b + a*c\)</div>}}<br></div>
Give the formal definition of a greatest common divisor \(d\) of integers \(a\) and \(b\) (not both 0).
\[d | a \land d | b \land \forall c \ ((c | a \land c | b) \rightarrow c | d)\]
\(d\) divides both \(a\) and \(b\), AND every common divisor of \(a\) and \(b\) divides \(d\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of a greatest common divisor \(d\) of integers \(a\) and \(b\) (not both 0).
Back
\[d | a \land d | b \land \forall c \ ((c | a \land c | b) \rightarrow c | d)\]
\(d\) divides both \(a\) and \(b\), AND every common divisor of \(a\) and \(b\) divides \(d\).
A proof system is sound if no false statement has a proof: \(\phi(s, p) = 1 \implies \tau(s) = 1\).
Note that the use of \(\implies\)is not the correct formalism.
For all \(s \in \mathcal{S}\) for which there exists a \(p \in \mathcal{P}\) with \(\phi(s, p) = 1\), we have \(\tau(s) = 1\) is the correct formal definition.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A proof system is {{c2:: <b>sound</b>}} if {{c1:: no false statement has a proof: \(\phi(s, p) = 1 \implies \tau(s) = 1\)}}.
Extra
<i>Note that the use of </i>\(\implies\)<i>is not the correct formalism.<br></i><br>For all \(s \in \mathcal{S}\) for which there exists a \(p \in \mathcal{P}\) with \(\phi(s, p) = 1\), we have \(\tau(s) = 1\) is the correct formal definition.
What is the logical rule for proof by contradiction?
\((\lnot A \rightarrow B) \land \lnot B \models A\)
Alternative: \((A \lor B) \land \lnot B \models A\)
(If assuming \(\lnot A\) leads to something false, then \(A\) must be true)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the logical rule for proof by contradiction?
Back
<ul>
<li>\((\lnot A \rightarrow B) \land \lnot B \models A\)</li>
<li>Alternative: \((A \lor B) \land \lnot B \models A\)</li>
</ul>
<br>
(If assuming \(\lnot A\) leads to something false, then \(A\) must be true)
An interpretation is suitable for a formula \(F\) if it assigns a value to all symbols \(\beta \in \Lambda\) occurring free in \(F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An interpretation is {{c1::<i>suitable</i>}} for a formula \(F\) if it {{c2::assigns a value to all symbols \(\beta \in \Lambda\) occurring free in \(F\)}}.
Theorem 5.25: Let \(F\) be a field. For any \(a(x)\) and \(b(x) \neq 0\) in \(F[x]\), there exists a unique \(q(x)\) (quotient) and unique \(r(x)\) (remainder) such that: \[ a(x) = b(x) \cdot q(x) + r(x) \quad \text{and} \quad \deg(r(x)) < \deg(b(x)) \]
This is analogous to integer division with remainder.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Euclidian Division of polynomials in a Field:</p>
Back
<p><strong>Theorem 5.25</strong>: Let \(F\) be a field. For any \(a(x)\) and \(b(x) \neq 0\) in \(F[x]\), there exists a <strong>unique</strong> \(q(x)\) (quotient) and <strong>unique</strong> \(r(x)\) (remainder) such that: \[ a(x) = b(x) \cdot q(x) + r(x) \quad \text{and} \quad \deg(r(x)) < \deg(b(x)) \]</p>
<p>This is analogous to integer division with remainder.</p>
A partial function \(A \to B\) is a relation from \(A\) to \(B\) such that{{c1::\(\forall a \in A \; \forall b,b' \in B \; (a \mathop{f} b \land a\mathop{f} b' \to b = b')\) (well-defined).}}
A partial function \(A \to B\) is a relation from \(A\) to \(B\) such that{{c1::\(\forall a \in A \; \forall b,b' \in B \; (a \mathop{f} b \land a\mathop{f} b' \to b = b')\) (well-defined).}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <b>partial function </b>\(A \to B\) is a relation from \(A\) to \(B\) such that{{c1::\(\forall a \in A \; \forall b,b' \in B \; (a \mathop{f} b \land a\mathop{f} b' \to b = b')\) (well-defined).}}
Why is a polynomial of degree \(d\) uniquely determined by \(d + 1\) values of \(a(x)\)?
This \(a(x)\) is unique since if there was another \(a'(x)\) then \(a(x) - a'(x)\) would have at most degree \(d\) and thus at most \(d\) roots. But since \(a(x) - a'(x)\) has the same \(d + 1\) roots, it's \(0 \implies a(x) = a'(x)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Why is a polynomial of degree \(d\) <strong>uniquely</strong> determined by \(d + 1\) values of \(a(x)\)?</p>
Back
<p>This \(a(x)\) is unique since if there was another \(a'(x)\) then \(a(x) - a'(x)\) would have at most degree \(d\) and thus at most \(d\) roots. But since \(a(x) - a'(x)\) has the same \(d + 1\) roots, it's \(0 \implies a(x) = a'(x)\).</p>
A polynomial \(a(x) \in F[x]\) of degree at most \(d\) is uniquely determined by:
By any \(d + 1\) values of \(a(x)\), i.e., by \(a(\alpha_1), \dots, a(\alpha_{d+1})\) for any distinct \(\alpha_1, \dots, \alpha_{d+1} \in F\).
This is the basis for polynomial interpolation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>A polynomial \(a(x) \in F[x]\) of degree <strong>at most \(d\)</strong> is <strong>uniquely determined</strong> by:</p>
Back
<p>By any \(d + 1\) values of \(a(x)\), i.e., by \(a(\alpha_1), \dots, a(\alpha_{d+1})\) for any <strong>distinct</strong> \(\alpha_1, \dots, \alpha_{d+1} \in F\).</p>
<p>This is the basis for polynomial interpolation.</p>
Is \(\mathbb{N}\) well-ordered by \(\leq\)? What about \(\mathbb{Z}\)?
\(\mathbb{N}\): YES (every non-empty subset has a least element)
\(\mathbb{Z}\): NO (e.g., \(\mathbb{Z}\) itself has no least element)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Is \(\mathbb{N}\) well-ordered by \(\leq\)? What about \(\mathbb{Z}\)?
Back
<ul>
<li><strong>\(\mathbb{N}\)</strong>: YES (every non-empty subset has a least element)</li>
<li><strong>\(\mathbb{Z}\)</strong>: NO (e.g., \(\mathbb{Z}\) itself has no least element)</li>
</ul>
Group axiom G3 states that {{c1::every element \(a\) in \(G\) has an inverse element \(\widehat{a}\) such that \(a * \widehat{a} = \widehat{a} * a = e\)}}.
Group axiom G3 states that {{c1::every element \(a\) in \(G\) has an inverse element \(\widehat{a}\) such that \(a * \widehat{a} = \widehat{a} * a = e\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>Group axiom {{c2::<strong>G3</strong>}} states that {{c1::every element \(a\) in \(G\) has an inverse element \(\widehat{a}\) such that \(a * \widehat{a} = \widehat{a} * a = e\)}}.</p>
Give an example of a group homomorphism involving the logarithm function.
The logarithm function is a group homomorphism from \(\langle \mathbb{R}^{>0}; \cdot \rangle\) to \(\langle \mathbb{R}; + \rangle\) because: \[\log(a \cdot b) = \log a + \log b\]
It's also an isomorphism because the logarithm is bijective on positive reals.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of a group homomorphism involving the logarithm function.</p>
Back
<p>The logarithm function is a group homomorphism from \(\langle \mathbb{R}^{>0}; \cdot \rangle\) to \(\langle \mathbb{R}; + \rangle\) because: \[\log(a \cdot b) = \log a + \log b\]</p>
<p>It's also an <strong>isomorphism</strong> because the logarithm is bijective on positive reals.</p>
How many equivalence classes does \(\equiv_m\) have, and what are they?
There are \(m\) equivalence classes: \([0], [1], \dots, [m-1]\).
The set \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) contains the canonical representative from each class.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How many equivalence classes does \(\equiv_m\) have, and what are they?
Back
There are \(m\) equivalence classes: \([0], [1], \dots, [m-1]\).
<br>
The set \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) contains the canonical representative from each class.
For any group \(G\), there exist two trivial subgroups:
- {{c2::The set \(\{e\}\) (containing only the neutral element)}}
- \(G\) itself
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<!-- Card 38: Trivial Subgroups (Cloze) -->
<p>For any group \(G\), there exist two trivial subgroups:<br>
- {{c2::The set \(\{e\}\) (containing only the neutral element)}}<br>
- {{c3::\(G\) itself}}</p>
What happens when a formula in predicate logic has a free variable (no quantifier)?
The variable must be replaced by a specific constant from the universe for any interpretation. Without a quantifier, \(x\) is not bound and requires a concrete value.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What happens when a formula in predicate logic has a free variable (no quantifier)?
Back
The variable must be replaced by a <strong>specific constant</strong> from the universe for any interpretation. Without a quantifier, \(x\) is not bound and requires a concrete value.
If \(F\) is a formula in predicate logic, then for any \(i\):
\(\forall x_i F\)
\(\exists x_i F\)
are formulas.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(F\) is a formula in predicate logic, then for any \(i\):<br><ul><li>{{c1::\(\forall x_i F\)}}</li><li>{{c2::\(\exists x_i F\)}} </li></ul>are formulas.
Lemma 5.2: In a monoid \(\langle M; *, e \rangle\), if \(a \in M\) has a left inverse and a right inverse, then they are equal. In particular, \(a\) has at most one inverse.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Lemma about uniqueness of the inverse:</p>
Back
<p><strong>Lemma 5.2</strong>: In a monoid \(\langle M; *, e \rangle\), if \(a \in M\) has a left inverse and a right inverse, then they are <strong>equal</strong>. In particular, \(a\) has <strong>at most one inverse</strong>.</p>
For \(a, b \in \mathbb{Z}\) (not both 0), there exist \(u, v \in \mathbb{Z}\) such that:
\[\text{gcd}(a, b) = ua + vb\]
The GCD can be expressed as an integer linear combination.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
State Bézout's identity (Corollary 4.5).
Back
For \(a, b \in \mathbb{Z}\) (not both 0), there exist \(u, v \in \mathbb{Z}\) such that:
\[\text{gcd}(a, b) = ua + vb\]
The GCD can be expressed as an integer linear combination.
State Corollary 5.9 about the relationship between element order and group order for a finite group \(G\).
Corollary 5.9: For a finite group \(G\), the order of every element divides the group order, i.e., \(\text{ord}(a)\) divides \(|G|\) for every \(a \in G\).
Proof: \(\langle a \rangle\) is a subgroup of \(G\) of order \(\text{ord}(a)\), which by Lagrange's Theorem must divide \(|G|\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Corollary 5.9 about the relationship between element order and group order for a finite group \(G\).</p>
Back
<p><strong>Corollary 5.9</strong>: For a finite group \(G\), the order of every element <strong>divides</strong> the group order, i.e., \(\text{ord}(a)\) divides \(|G|\) for every \(a \in G\).</p>
<p><strong>Proof</strong>: \(\langle a \rangle\) is a subgroup of \(G\) of order \(\text{ord}(a)\), which by Lagrange's Theorem must divide \(|G|\).</p>
When is a polynomial of degree \(2\) or \(3\) irreducible?
Corollary 5.30: A polynomial \(a(x)\) of degree \(2\) or \(3\) over a field \(F\) is irreducible if and only if it has no root.
Important: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>When is a polynomial of degree \(2\) or \(3\) irreducible?</p>
Back
<p><strong>Corollary 5.30</strong>: A polynomial \(a(x)\) of degree \(2\) or \(3\) over a field \(F\) is irreducible <strong>if and only if</strong> it has <strong>no root</strong>.</p>
<p><strong>Important</strong>: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.</p>
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is a lower (upper) bound of \(S\) if \(b \preceq a\) (\(b \succeq a) \) for all \(b \in S\)
Note that a is not necessarily in the subset S (difference to the least and greatest elements).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).<div>\(a \in A\) is a {{c1::<b>lower (upper) bound</b> of \(S\)}} if {{c2::\(b \preceq a\) (\(b \succeq a) \) for all \(b \in S\)}}</div>
Extra
Note that a is not necessarily in the subset S (difference to the least and greatest elements).
If in a sound calculus \(K\) one can derive \(G\) from the set of formulas \(F\) (\(F \vdash_K G\)), then one has proved that \(F \rightarrow G\) is a tautology and thus that \(F \models G\).
If in a sound calculus \(K\) one can derive \(G\) from the set of formulas \(F\) (\(F \vdash_K G\)), then one has proved that \(F \rightarrow G\) is a tautology and thus that \(F \models G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If in a sound calculus \(K\) one can <i>derive</i> \(G\) from the set of formulas \(F\) (\(F \vdash_K G\)), then one has proved that {{c1::\(F \rightarrow G\) is a <i>tautology</i> and thus that \(F \models G\)}}.
For formulas \(F\) and \(H\), where \(x\) does not occur free in \(H\), we have: - \((\forall x \, F) \land H\) \( \equiv\) \( \forall x \, (F \land H)\) - \((\forall x \, F) \lor H \) \(\equiv\) \(\forall x \, (F \lor H)\) - \((\exists x \, F) \land H \) \(\equiv\) \(\exists x \, (F \land H)\) - \((\exists x \, F) \lor H\) \(\equiv\) \(\exists x \, (F \lor H)\)
For formulas \(F\) and \(H\), where \(x\) does not occur free in \(H\), we have: - \((\forall x \, F) \land H\) \( \equiv\) \( \forall x \, (F \land H)\) - \((\forall x \, F) \lor H \) \(\equiv\) \(\forall x \, (F \lor H)\) - \((\exists x \, F) \land H \) \(\equiv\) \(\exists x \, (F \land H)\) - \((\exists x \, F) \lor H\) \(\equiv\) \(\exists x \, (F \lor H)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For formulas \(F\) and \(H\), where \(x\) <b>does not occur free</b> in \(H\), we have:<br>- {{c1::\((\forall x \, F) \land H\)}} \( \equiv\) {{c2::\( \forall x \, (F \land H)\)}}<br>- {{c3::\((\forall x \, F) \lor H \)}} \(\equiv\) {{c4::\(\forall x \, (F \lor H)\)}}<br>- {{c5::\((\exists x \, F) \land H \)}} \(\equiv\) {{c6:: \(\exists x \, (F \land H)\)}}<br>- {{c7::\((\exists x \, F) \lor H\)}} \(\equiv\) {{c8:: \(\exists x \, (F \lor H)\)}}
For a subset \(T\) of \(B\), the {{c1::preimage (in Linalg: Urbild) of \(T\), denoted \(f^{-1}(T)\)}}, is the set of values in \(A\) that map into \(T\).
For a subset \(T\) of \(B\), the {{c1::preimage (in Linalg: Urbild) of \(T\), denoted \(f^{-1}(T)\)}}, is the set of values in \(A\) that map into \(T\).
Example: \(f(x) = x^2\), the preimage of \([4,9]\) is \([-3,-2] \cup [2,3]\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a subset \(T\) of \(B\), the {{c1::<b>preimage </b>(in Linalg: Urbild) of \(T\), denoted \(f^{-1}(T)\)}}, is {{c2::the set of values in \(A\) that map into \(T\).}}
Extra
Example: \(f(x) = x^2\), the preimage of \([4,9]\) is \([-3,-2] \cup [2,3]\)
As \(9^{10} \equiv_{11} 1\) (see Fermat little theorem and 11 prime), we can reduce the exponent modulo $10$ (see Lagrange's theorem in chapter 5). Thus \(R_{11}(9^{2024}) = R_{11}(9^{4}) = R_{11}(-2^{4}) = 5\).
For this to work however, we need the *number and the order of the group* (modulo remainder) to be coprime, i.e. \(\gcd(9, 11) = 1\).
If the modulus itself is prime then it always works and the order of the element can be used to reduce the exponent as \(9^{11-1} = 1\) by FLT.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Reduce \(R_{11}(9^{2024})\)
Back
As \(9^{10} \equiv_{11} 1\) (see Fermat little theorem and 11 prime), we can reduce the exponent modulo $10$ (see Lagrange's theorem in chapter 5). Thus \(R_{11}(9^{2024}) = R_{11}(9^{4}) = R_{11}(-2^{4}) = 5\).<br><br>For this to work however, we need the *number and the order of the group* (modulo remainder) to be <i>coprime</i>, i.e. \(\gcd(9, 11) = 1\).<div>If the modulus itself is prime then it always works and the order of the element can be used to reduce the exponent as \(9^{11-1} = 1\) by FLT.</div>
Yes, there exist uncomputable functions \(\mathbb{N} \to \{0, 1\}\).
Proof idea: Programs are finite bitstrings (\(\{0,1\}^*\) is countable), but functions \(\mathbb{N} \to \{0,1\}\) are uncountable.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Do uncomputable functions exist?
Back
Yes, there exist <strong>uncomputable</strong> functions \(\mathbb{N} \to \{0, 1\}\).
<br>
<strong>Proof idea</strong>: Programs are finite bitstrings (\(\{0,1\}^*\) is countable), but functions \(\mathbb{N} \to \{0,1\}\) are uncountable.
Sketch step-by-step how Cantor's diagonalization argument can be used to prove that the set \(\{0,1\}^\infty\) is uncountable.
Proof by contradiction: Assume a bijection to \(\mathbb{N}\) exists.
That means there exists for each \(n\in \mathbb{N}\) a corresponding sequence of 0 and 1s, and vice-versa.
We now construct a new sequence \(\alpha\) of 0s and 1s, by always taking the \(i\)-th bit from the \(i\)-th sequence, and inverting it.
This new sequence does not agree with every existing sequence in at least one place.
However, there is no \(n\in\mathbb{N}\) such that \(\alpha = f(n)\) since \(\alpha\) disagrees with every \(f(n)\) in at least one place.
Thus, no bijection to \(\mathbb{N}\) exists, which means \(\{0,1\}^\infty\) is uncountable.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Sketch step-by-step how <b>Cantor's diagonalization argument</b> can be used to prove that the set \(\{0,1\}^\infty\) is uncountable.
Back
<ul><li>Proof by contradiction: Assume a bijection to \(\mathbb{N}\) exists.</li><li>That means there exists for each \(n\in \mathbb{N}\) a corresponding sequence of 0 and 1s, and vice-versa.</li><li>We now construct a new sequence \(\alpha\) of 0s and 1s, by always taking the \(i\)-th bit from the \(i\)-th sequence, and inverting it.</li><li>This new sequence does not agree with every existing sequence in at least one place.</li><li>However, there is no \(n\in\mathbb{N}\) such that \(\alpha = f(n)\) since \(\alpha\) disagrees with every \(f(n)\) in at least one place.</li><li>Thus, no bijection to \(\mathbb{N}\) exists, which means \(\{0,1\}^\infty\) is uncountable.</li></ul>
YES! Quantifier order matters for nestedvariables.
\(\exists x \forall y P(x, y)\) is NOT equivalent to \(\forall y \exists x P(x, y)\)!
Example: \(\exists x \forall y (x < y)\) means "there exists a smallest element", while \(\forall y \exists x (x < y)\) means "for every element, there exists a smaller one".
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Does quantifier order matter?
Back
<b>YES!</b> Quantifier order matters for <b>nested</b> <b>variables</b>.<br><br>\(\exists x \forall y P(x, y)\) is <b>NOT</b> equivalent to \(\forall y \exists x P(x, y)\)!<br><br>Example: \(\exists x \forall y (x < y)\) means "there exists a smallest element", while \(\forall y \exists x (x < y)\) means "for every element, there exists a smaller one".
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is a minimal (maximal) element of \(A\) if there exists no \(b \in A\) with \(b \prec a\) (\(b \succ a \) )
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).<div>\(a \in A\) is a {{c1::<b>minimal (maximal) element</b> of \(A\)}} if {{c2::there exists no \(b \in A\) with \(b \prec a\) (\(b \succ a \) )}}<br></div>
If a set of \(n\) objects is partitioned into \(k < n\) sets, then at least one of those sets contains at least \(\lceil \frac{n}{k} \rceil\) objects.
(If you have more pigeons than holes, at least one hole must contain multiple pigeons)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the Pigeonhole Principle?
Back
If a set of \(n\) objects is partitioned into \(k < n\) sets, then at least one of those sets contains at least \(\lceil \frac{n}{k} \rceil\) objects.
<br>
(If you have more pigeons than holes, at least one hole must contain multiple pigeons)
Is the projection of points from \(\mathbb{R}^3\) to \(\mathbb{R}^2\) a homomorphism? Is it an isomorphism?
The projection is a homomorphism (it preserves the group operation of vector addition).
However, it is not an isomorphism because it's not a bijection (not injective - many 3D points project to the same 2D point).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Is the projection of points from \(\mathbb{R}^3\) to \(\mathbb{R}^2\) a homomorphism? Is it an isomorphism?</p>
Back
<p>The projection is a <strong>homomorphism</strong> (it preserves the group operation of vector addition).</p>
<p>However, it is <strong>not an isomorphism</strong> because it's not a bijection (not injective - many 3D points project to the same 2D point).</p>
State Fermat's Little Theorem (Corollary 5.14) (both totient and prime):
Corollary 5.14 (Fermat's Little Theorem): For all \(m \geq 2\) and all \(a\) with \(\gcd(a, m) = 1\): \[a^{\varphi(m)} \equiv_m 1\]
In particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \[a^{p-1} \equiv_p 1\]
Proof: This follows from Corollary 5.10 (\(a^{|G|} = e\)) since the order of \(\mathbb{Z}_m^*\) is \[a^{p-1} \equiv_p 1\]0 (and \[a^{p-1} \equiv_p 1\]1 for prime \[a^{p-1} \equiv_p 1\]2).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Fermat's Little Theorem (Corollary 5.14) (both totient and prime):</p>
Back
<p><strong>Corollary 5.14 (Fermat's Little Theorem)</strong>: For all \(m \geq 2\) and all \(a\) with \(\gcd(a, m) = 1\): \[a^{\varphi(m)} \equiv_m 1\]</p>
<p>In particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \[a^{p-1} \equiv_p 1\]</p>
<p><strong>Proof</strong>: This follows from Corollary 5.10 (\(a^{|G|} = e\)) since the order of \(\mathbb{Z}_m^*\) is \[a^{p-1} \equiv_p 1\]0 (and \[a^{p-1} \equiv_p 1\]1 for prime \[a^{p-1} \equiv_p 1\]2).</p>
In a poset \( ( A; \preceq )\), \(b\) covers \(a\) if \(a \prec b\) and there does not exist a \(c\) with \(a \prec c \land c \prec b \), so no elements are between \(a\) and \(b\).
In a poset \( ( A; \preceq )\), \(b\) covers \(a\) if \(a \prec b\) and there does not exist a \(c\) with \(a \prec c \land c \prec b \), so no elements are between \(a\) and \(b\).
Example: direct superior in a company
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a poset \( ( A; \preceq )\), \(b\) <b>covers</b> \(a\) if {{c1::\(a \prec b\) and there does not exist a \(c\) with \(a \prec c \land c \prec b \), so no elements are between \(a\) and \(b\).}}
If one replaces a sub-formula \(G\) of a formula \(F\) by an equivalent (to \(G\)) formula \(H\), then the resulting formula is equivalent to \(F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If one replaces a sub-formula \(G\) of a formula \(F\) by an equivalent (to \(G\)) formula \(H\), then {{c2::the resulting formula is equivalent to \(F\)}}.
The syntax defines: 1. An alphabet \(\Lambda\) of allowed symbols 2. Which strings in \(\Lambda^*\) are valid formulas (syntactically correct)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does the syntax of a logic define?
Back
The syntax defines:<br>1. An alphabet \(\Lambda\) of allowed symbols<br>2. Which strings in \(\Lambda^*\) are valid formulas (syntactically correct)
The equation \(ax \equiv_m 1\) has a unique solution \(x \in \mathbb{Z}_m\) if and only if \(\gcd(a,m) = 1\). This \(x\) is then called the multiplicative inverse of \(a \mod m\).
The equation \(ax \equiv_m 1\) has a unique solution \(x \in \mathbb{Z}_m\) if and only if \(\gcd(a,m) = 1\). This \(x\) is then called the multiplicative inverse of \(a \mod m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The equation \(ax \equiv_m 1\) has a unique solution \(x \in \mathbb{Z}_m\) if and only if {{c1::\(\gcd(a,m) = 1\).}} This \(x\) is then called the {{c2::multiplicative inverse of \(a \mod m\)}}.
The set of clauses associated with a formula \[F = (L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\] in CNF, denoted as {{c1::\(\mathcal{K}(F)\)}}, is the set {{c2::\[\mathcal{K}(F) = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
The set of clauses associated with a formula \[F = (L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\] in CNF, denoted as {{c1::\(\mathcal{K}(F)\)}}, is the set {{c2::\[\mathcal{K}(F) = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The set of clauses associated with a formula \[F = (L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\] in CNF, denoted as {{c1::\(\mathcal{K}(F)\)}}, is the set {{c2::\[\mathcal{K}(F) = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
The idea of Universal Instantiation is that if a statement is true for all elements, it is also true for a particular element, so \(\forall x F \models F[x/t]\).
The idea of Universal Instantiation is that if a statement is true for all elements, it is also true for a particular element, so \(\forall x F \models F[x/t]\).
Example: All elements in \(\mathbb{R}\) are invertible. Thus, 2 is also invertible.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The idea of {{c2::Universal Instantiation}} is that {{c1::if a statement is true for all elements, it is also true for a particular element, so \(\forall x F \models F[x/t]\).}}
Extra
Example: All elements in \(\mathbb{R}\) are invertible. Thus, 2 is also invertible.
Which elements generate \(\mathbb{Z}_n\)? Also proof
\(\mathbb{Z}_n\) is generated by all \(a \in \mathbb{Z}_n\) for which \(\gcd(n, a) = 1\) (all elements coprime to \(n\)).
Proof idea:
- If \(\mathbb{Z}_n = \langle a \rangle\), then \(1 \in \langle a \rangle\)
- This means \(au \equiv_n 1\) for some \(u\)
- By Bézout's identity, this implies \(\gcd(a, n) = 1\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Which elements generate \(\mathbb{Z}_n\)? Also proof</p>
Back
<p>\(\mathbb{Z}_n\) is generated by <strong>all \(a \in \mathbb{Z}_n\) for which \(\gcd(n, a) = 1\)</strong> (all elements coprime to \(n\)).</p>
<p><strong>Proof idea</strong>:<br>
- If \(\mathbb{Z}_n = \langle a \rangle\), then \(1 \in \langle a \rangle\)<br>
- This means \(au \equiv_n 1\) for some \(u\)<br>
- By Bézout's identity, this implies \(\gcd(a, n) = 1\)</p>
Group axiom G1 states that the operation \(*\) is associative: \(a * (b * c) = (a * b) * c\) for all \(a, b, c\) in \(G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>Group axiom <strong>G1</strong> states that the operation \(*\) is {{c1::associative}}: {{c2::\(a * (b * c) = (a * b) * c\)}} for all \(a, b, c\) in \(G\).</p>
Two codewords in a polynomial code with degree \(k-1\) cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.
Two codewords in a polynomial code with degree \(k-1\) cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>Two codewords in a <em>polynomial code</em> with degree \(k-1\) cannot agree at {{c1:: \(k\) positions (else they'd be equal)}}, so they disagree in {{c2:: at least \(n - k + 1\) positions}}.</p>
If we want to use roots to check that a polynomial is irreducible, it has to have?
Degree \(2\) or \(3\).
Important: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>If we want to use roots to check that a polynomial is irreducible, it has to have?</p>
Back
<p>Degree \(2\) or \(3\).</p>
<p><strong>Important</strong>: This doesn't work for polynomials of higher degrees! A degree \(4\) polynomial might be the product of two irreducible degree \(2\) polynomials, each with no roots.</p>
\[A / \theta \overset{\text{def}}{=} \{[a]_{\theta} \ | \ a \in A\}\]
The set of all equivalence classes of \(\theta\) on \(A\) (also called "\(A\) modulo \(\theta\)" or "\(A\) mod \(\theta\)").
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the quotient set \(A / \theta\)?
Back
\[A / \theta \overset{\text{def}}{=} \{[a]_{\theta} \ | \ a \in A\}\]
The set of all equivalence classes of \(\theta\) on \(A\) (also called "\(A\) modulo \(\theta\)" or "\(A\) mod \(\theta\)").
For \(a, b\) in a commutative ring \(R\), we say that \(a\) divides \(b\), denoted \(a \ | \ b\), if there exists a \(c \in R\) such that \(b = ac\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>For \(a, b\) in a <strong>commutative</strong> ring \(R\), we say that {{c1::\(a\) divides \(b\), denoted \(a \ | \ b\)}}, if {{c2:: there exists a \(c \in R\) such that \(b = ac\)}}.</p>
The set of clauses associated with a set \(M = \{F_1, \dots, F_k\}\) of formulas is {{c1::\[\mathcal{K}(M) = \bigcup_{i=1}^k \mathcal{K}(F_i)\]}} (the union of their clause sets).
The set of clauses associated with a set \(M = \{F_1, \dots, F_k\}\) of formulas is {{c1::\[\mathcal{K}(M) = \bigcup_{i=1}^k \mathcal{K}(F_i)\]}} (the union of their clause sets).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The set of clauses associated with a set \(M = \{F_1, \dots, F_k\}\) of formulas is {{c1::\[\mathcal{K}(M) = \bigcup_{i=1}^k \mathcal{K}(F_i)\]}} (the {{c2::union of their clause sets}}).
The following three statements are equivalent: 1. {{c1::\(\{F_1, \dots, F_k\} \models G\)}} 2. \((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology 3. {{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.
The following three statements are equivalent: 1. {{c1::\(\{F_1, \dots, F_k\} \models G\)}} 2. \((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology 3. {{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.
This is important for resolution calculus!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The following three statements are equivalent:<br>1. {{c1::\(\{F_1, \dots, F_k\} \models G\)}}<br>2. {{c2::\((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology}}<br>3. {{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.
A formula in propositional logic is defined recursively: - An atomic formula is a formula - If \(F\) and \(G\) are formulas, then also \(\lnot F\), \(F \lor G\), \(F \land G\).
A formula in propositional logic is defined recursively: - An atomic formula is a formula - If \(F\) and \(G\) are formulas, then also \(\lnot F\), \(F \lor G\), \(F \land G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A formula in propositional logic is defined recursively:<br>- {{c2::An atomic formula is a formula}}<br>- If \(F\) and \(G\) are formulas, then also {{c3::\(\lnot F\), \(F \lor G\), \(F \land G\)}}.
How can we test if a relation is transitive using composition?
A relation \(\rho\) is transitive if and only if \(\rho^2 \subseteq \rho\).
(If all two-step paths are already direct edges, the relation is transitive)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can we test if a relation is transitive using composition?
Back
A relation \(\rho\) is transitive <strong>if and only if</strong> \(\rho^2 \subseteq \rho\).
<br>
(If all two-step paths are already direct edges, the relation is transitive)
Which of the following are fields: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5, \mathbb{Z}_6, R[x]\)?
Fields: \(\mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5\) (where \(5\) is prime)
Not fields:
- \(\mathbb{Z}\) (not all nonzero elements have multiplicative inverse, e.g., \(2\))
- \(\mathbb{Z}_6\) (since \(6\) is not prime, e.g., \(2\) has no inverse)
- \(R[x]\) for any ring \(R\) (polynomials don't have multiplicative inverses)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Which of the following are fields: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5, \mathbb{Z}_6, R[x]\)?</p>
Back
<p><strong>Fields</strong>: \(\mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_5\) (where \(5\) is prime)</p>
<p><strong>Not fields</strong>:<br>
- \(\mathbb{Z}\) (not all nonzero elements have multiplicative inverse, e.g., \(2\))<br>
- \(\mathbb{Z}_6\) (since \(6\) is not prime, e.g., \(2\) has no inverse)<br>
- \(R[x]\) for any ring \(R\) (polynomials don't have multiplicative inverses)</p>
The semantics of a logic defines a function \(free\) which {{c2::assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \(free(F) \subseteq \{1, \dots, k\}\) of the indices}}.
The semantics of a logic defines a function \(free\) which {{c2::assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \(free(F) \subseteq \{1, \dots, k\}\) of the indices}}.
If \(i \in free(F)\), then the symbol is said to occur free in \(F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c3::<i>semantics</i>}} of a logic defines a function {{c1::\(free\)}} which {{c2::assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \(free(F) \subseteq \{1, \dots, k\}\) of the indices}}.
Extra
If \(i \in free(F)\), then the symbol is said to occur <i>free</i> in \(F\).
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a {{c2::greatest lower bound}}, then it is called the {{c1::<b>meet </b>of \(a\) and \(b\) (also denoted \(a \land b\)).}}<br>
To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:
- G1 (associativity)
- G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).
- G3 (inverse) G3' -> you only need to prove the existence of a right inverse
To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:
- G1 (associativity)
- G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).
- G3 (inverse) G3' -> you only need to prove the existence of a right inverse
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:<br>
- {{c2::G1 (associativity)}}<br>
- {{c3::G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).}}<br>
- {{c4::G3 (inverse) G3' -> you only need to prove the existence of a right inverse}}</p>
What exponentiation operation is valid in modular arithmetic?
I can do:
\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)
What is illegal is:
\(a \equiv_n b\) and \(c \equiv_n d\) and then doing \(a^c \equiv_n b^d\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What exponentiation operation is valid in modular arithmetic?
Back
I can do:<br><ul><li>\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)<br></li></ul><div>What is illegal is:</div><div><ul><li>\(a \equiv_n b\) and \(c \equiv_n d\) and then doing \(a^c \equiv_n b^d\)</li></ul></div>
rectify the formula (rename all bound occurrences clashing with free variables)
equivalences in Lemma 6.7 to move up all quantifiers in the tree
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Transform a formula to <b>prenex</b> form:<br><ol><li>{{c1::<b>rectify</b> the formula (rename all bound occurrences clashing with free variables)}}</li><li>{{c2::equivalences in Lemma 6.7 to <b>move up all quantifiers</b> in the tree}}</li></ol>
A function \(f:\mathbb{N}\to\{0,1\}\) is called computable if {{c1::there is a computer program that, for every \(n\in\mathbb{N}\), when given \(n\) as input, outputs \(f(n)\).}}
A function \(f:\mathbb{N}\to\{0,1\}\) is called computable if {{c1::there is a computer program that, for every \(n\in\mathbb{N}\), when given \(n\) as input, outputs \(f(n)\).}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A function \(f:\mathbb{N}\to\{0,1\}\) is called <b>computable</b> if {{c1::there is a computer program that, for every \(n\in\mathbb{N}\), when given \(n\) as input, outputs \(f(n)\).}}
What are the two trivial equivalence relations on a set \(A\)?
1. Complete relation \(A \times A\) → single equivalence class \(A\) 2. {{c2:: Identity relation → equivalence classes are all singletons \(\{a\}\)}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What are the two trivial equivalence relations on a set \(A\)?<br><br>1. {{c1:: <strong>Complete relation</strong> \(A \times A\) → single equivalence class \(A\)}}<br>2. {{c2:: <strong>Identity relation</strong> → equivalence classes are all singletons \(\{a\}\)}}
A formula F (propositional logic) is a tautology/valid if it is true for all truth combinations of the involved symbols, so if it is always true. Symbol: \( \top \)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a tautology?
Back
A formula F (propositional logic) is a tautology/valid if it is true for all truth combinations of the involved symbols, so if it is always true. Symbol: \( \top \)
Why is Lemma 6.3 (the equivalence between \(F \models G\) and unsatisfiability of \(\{F, \lnot G\}\)) important for the resolution calculus?
The fact that \(F \models G\) is equivalent to \(\{F, \lnot G\}\) being unsatisfiable makes the resolution calculus powerful enough to also show implications, not just unsatisfiability.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why is Lemma 6.3 (the equivalence between \(F \models G\) and unsatisfiability of \(\{F, \lnot G\}\)) important for the resolution calculus?
Back
The fact that \(F \models G\) is equivalent to \(\{F, \lnot G\}\) being unsatisfiable makes the resolution calculus powerful enough to also show implications, not just unsatisfiability.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \dots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \dots \times G_n; \star \rangle\) where the operation \(\star\) is component-wise.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \dots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \dots \times G_n; \star \rangle\) where the operation \(\star\) is component-wise.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::direct product}} of \(n\) groups \(\langle G_1; *_1 \rangle, \dots, \langle G_n; *_n \rangle\) is the algebra {{c2::\(\langle G_1 \times \dots \times G_n; \star \rangle\)}} where the operation \(\star\) is {{c3::component-wise}}.</p>
For a formula \(G\) in which \(y\) does not occur, we have:
\(\forall x G\)\(\equiv\)\(\forall y G[x/y]\)
\(\exists x G\)\(\equiv\)\(\exists y G[x/y]\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a formula \(G\) in which \(y\) does not occur, we have:<br><ul><li>{{c1::\(\forall x G\)}}\(\equiv\){{c2::\(\forall y G[x/y]\)}}</li><li>{{c3::\(\exists x G\)}}\(\equiv\){{c4::\(\exists y G[x/y]\)}}</li></ul>
\(F \models \emptyset\) means that \(F\) is unsatisfiable, as the empty set cannot be made true under any interpretation (it has no literals to set to true).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does \(F \models \emptyset\) mean?
Back
\(F \models \emptyset\) means that \(F\) is <b>unsatisfiable</b>, as the empty set cannot be made true under any interpretation (it has no literals to set to true).
How can you check if a polynomial of degree \(d\) is irreducible?
To check if a polynomial of degree \(d\) is irreducible, check all monic irreducible polynomials of degree \(\leq d/2\) as possible divisors.
Why \(d/2\)? If \(a(x) = b(x) \cdot c(x)\) where \(b\) and \(c\) are non-constant, then \(\deg(b) + \deg(c) = \deg(a) = d\). So at least one of \(b\) or \(c\) has degree \(\leq d/2\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>How can you check if a polynomial of degree \(d\) is irreducible?</p>
Back
<p>To check if a polynomial of degree \(d\) is irreducible, check all <strong>monic irreducible</strong> polynomials of degree \(\leq d/2\) as possible divisors.</p>
<p><strong>Why \(d/2\)?</strong> If \(a(x) = b(x) \cdot c(x)\) where \(b\) and \(c\) are non-constant, then \(\deg(b) + \deg(c) = \deg(a) = d\). So at least one of \(b\) or \(c\) has degree \(\leq d/2\).</p>
A proof of \(S\) by case distinction has three steps:
Find a finite list \(R_1,\ldots,R_k\) of mathematical statements, the cases.
Prove that at least one of the \(R_i\) is true (at least one case occurs).
Prove \(R_i \implies S\) for \(i = 1,\ldots,k\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A proof of \(S\) by <i>case distinction</i> has three steps:<br><ol><li>{{c1::Find a finite list \(R_1,\ldots,R_k\) of mathematical statements, the cases.}}<br></li><li>{{c2::Prove that at least one of the \(R_i\) is true (at least one case occurs).}}<br></li><li>{{c3::Prove \(R_i \implies S\) for \(i = 1,\ldots,k\).}}<br></li></ol>
What are the three ways to represent a relation on finite sets?
1. Set notation (subset of \(A \times B\)) 2. Boolean matrix (1 if \((a,b) \in \rho\), 0 otherwise) 3. Directed graph (nodes are elements, edges are relations)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What are the three ways to represent a relation on finite sets?<br><br>1. {{c1:: <strong>Set notation</strong> (subset of \(A \times B\))}}<br>2. {{c2:: <strong>Boolean matrix</strong> (1 if \((a,b) \in \rho\), 0 otherwise)}}<br>3. {{c3:: <strong>Directed graph</strong> (nodes are elements, edges are relations)}}
State Lemma 5.18 about the units of a ring and the property they satisfy?
Lemma 5.18: For a ring \(R\), \(R^*\) is a group (the multiplicative group of units of \(R\)).
Proof idea: Every element of \(R^*\) has an inverse by definition, so axiom G3 holds. The other group axioms (associativity, neutral element) are inherited from the ring.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Lemma 5.18 about the units of a ring and the property they satisfy?</p>
Back
<p><strong>Lemma 5.18</strong>: For a ring \(R\), \(R^*\) is a <strong>group</strong> (the multiplicative group of units of \(R\)).</p>
<p><strong>Proof idea</strong>: Every element of \(R^*\) has an inverse by definition, so axiom <strong>G3</strong> holds. The other group axioms (associativity, neutral element) are inherited from the ring.</p>
An axiom \(A\) is a statement taken as true in a theory. Theorems are the statements which follow from these axioms (\(A \models T\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An {{c1::<i>axiom</i> \(A\)}} is a {{c2::statement taken as true in a theory}}. {{c3::<i>Theorems</i>}} are the statements which {{c4::follow from these axioms}} (\(A \models T\)).
A field (Körper) is {{c2::a nontrivial commutative ring \(F\) in which every nonzero element is a unit, so \(F^* = F \backslash \{0\}\)}}
Example: \(\mathbb{R}\), but not \(\mathbb{Z}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A {{c1::field (<i>Körper</i>)}} is {{c2::a nontrivial commutative ring \(F\) in which every nonzero element is a unit, so \(F^* = F \backslash \{0\}\)}}
Extra
Example: \(\mathbb{R}\), but not \(\mathbb{Z}\)
A k-ary predicate on \( U \) is a function \( U^k \rightarrow \{0,1\}\).
It's like a function that takes any number of arguments, but only returns boolean results.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a predicate?
Back
A k-ary predicate on \( U \) is a function \( U^k \rightarrow \{0,1\}\).<div>It's like a function that takes any number of arguments, but only returns boolean results.</div>
State Theorem 5.31 about the number of roots a polynomial can have.
Theorem 5.31: For a field \(F\), a nonzero polynomial \(a(x) \in F[x]\) of degree \(d\) has at most \(d\) roots.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Theorem 5.31 about the number of roots a polynomial can have.</p>
Back
<p><strong>Theorem 5.31</strong>: For a field \(F\), a nonzero polynomial \(a(x) \in F[x]\) of degree \(d\) has <strong>at most \(d\) roots</strong>.</p>
What is a cyclic group of order \(n\) isomorphic to?
Theorem 5.7: A cyclic group of order \(n\) is isomorphic to \(\langle \mathbb{Z}_n; \oplus \rangle\) (and hence abelian).
This means all cyclic groups of the same order have the same structure.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is a cyclic group of order \(n\) isomorphic to?</p>
Back
<p><strong>Theorem 5.7</strong>: A cyclic group of order \(n\) is <strong>isomorphic</strong> to \(\langle \mathbb{Z}_n; \oplus \rangle\) (and hence <strong>abelian</strong>).</p>
<p>This means all cyclic groups of the same order have the same structure.</p>
Can the same variable occur both bound and free in a formula?
YES! The same variable can occur both bound in one place and free in another.
We can then replace all occurrences of the bound variable with another letter without changing the meaning.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Can the same variable occur both bound and free in a formula?
Back
<b>YES!</b> The same variable can occur both bound in one place and free in another.<br><br>We can then replace all occurrences of the bound variable with another letter without changing the meaning.
Give the formal definition of "\(a\) divides \(b\)" (denoted \(a | b\)).
\[a | b \overset{\text{def}}{\Longleftrightarrow} \exists c \in \mathbb{Z} \ b = ac\]
\(a\) is a divisor of \(b\), \(b\) is a multiple of \(a\), and \(c\) is the quotient.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of "\(a\) divides \(b\)" (denoted \(a | b\)).
Back
\[a | b \overset{\text{def}}{\Longleftrightarrow} \exists c \in \mathbb{Z} \ b = ac\]
\(a\) is a divisor of \(b\), \(b\) is a multiple of \(a\), and \(c\) is the quotient.
Explanation: The characteristic is the order of \(1\) in the additive group. In \(\mathbb{Z}_m\), adding \(1\) to itself \(m\) times gives: \[\underbrace{1 + 1 + \cdots + 1}_{m \text{ times}} = m \equiv_m 0\]
So \(\text{ord}(1) = m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is the characteristic of \(\mathbb{Z}_m\)?</p>
Back
<p>The characteristic of \(\mathbb{Z}_m\) is <strong>\(m\)</strong>.</p>
<p><strong>Explanation</strong>: The characteristic is the order of \(1\) in the additive group. In \(\mathbb{Z}_m\), adding \(1\) to itself \(m\) times gives: \[\underbrace{1 + 1 + \cdots + 1}_{m \text{ times}} = m \equiv_m 0\]</p>
<p>So \(\text{ord}(1) = m\).</p>
A relation \(\rho\) from a set \(A\) to a set \(B\) (also called an \((A,B)\)-relation) is a subset of \(A\times B\). If \(A = B\), then \(\rho\) is called a relation on \(A\).
A relation \(\rho\) from a set \(A\) to a set \(B\) (also called an \((A,B)\)-relation) is a subset of \(A\times B\). If \(A = B\), then \(\rho\) is called a relation on \(A\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <b>relation </b>\(\rho\) from a set \(A\) to a set \(B\) (also called an \((A,B)\)-relation) is {{c1::a subset of \(A\times B\).}} If \(A = B\), then \(\rho\) is called {{c1::a <i>relation on</i> \(A\).}}
What shortcut exists for testing whether \(n\) is prime? (Lemma 4.12)
Every composite integer \(n\) has a prime divisor \(\leq \sqrt{n}\).
Therefore, to test if \(n\) is prime, we only need to check divisibility by primes up to \(\sqrt{n}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What shortcut exists for testing whether \(n\) is prime? (Lemma 4.12)
Back
Every composite integer \(n\) has a prime divisor \(\leq \sqrt{n}\).
<br>
Therefore, to test if \(n\) is prime, we only need to check divisibility by primes up to \(\sqrt{n}\).
For a set \(Z\) of atomic formulas, a {{c1::truth assignment \(\mathcal{A}\)}} is {{c2::a function \(\mathcal{A}: Z \rightarrow \{0, 1\}\)}}.
A truth assignment \(\mathcal{A}\) is suitable for a formula \(F\) if it contains all atomic formulas appearing in \(F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a set \(Z\) of atomic formulas, a {{c1::<i>truth assignment</i> \(\mathcal{A}\)}} is {{c2::a function \(\mathcal{A}: Z \rightarrow \{0, 1\}\)}}.
Extra
A truth assignment \(\mathcal{A}\) is suitable for a formula \(F\) if it contains all atomic formulas appearing in \(F\).
If a theorem follows from the empty set of axioms \(\emptyset\), then it's a tautology. This means that it's a theorem in any theory!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If a theorem follows from the {{c1::empty set}} of axioms \(\emptyset\), then it's a {{c2::<i>tautology</i>}}. This means that {{c3::it's a theorem in any theory!}}
For a formula \(F\), a variable \(x\) and a term \(t\), \(F[x/t]\) denotes the formula obtained from \(F\) by substituting every free occurrence of \(x\) by \(t\).
For a formula \(F\), a variable \(x\) and a term \(t\), \(F[x/t]\) denotes the formula obtained from \(F\) by substituting every free occurrence of \(x\) by \(t\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a formula \(F\), {{c1::a variable \(x\) and a term \(t\), \(F[x/t]\)}} denotes {{c2::the formula obtained from \(F\) by substituting every free occurrence of \(x\) by \(t\)}}.
How does an indirect proof of \(S \Rightarrow T\) work?
An indirect proof assumes that \(T\) is false and proves that \(S\) is false under this assumption. This works because \(\lnot B \rightarrow \lnot A \models A \rightarrow B\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does an indirect proof of \(S \Rightarrow T\) work?
Back
An indirect proof assumes that \(T\) is <strong>false</strong> and proves that \(S\) is <strong>false</strong> under this assumption. This works because \(\lnot B \rightarrow \lnot A \models A \rightarrow B\).
What is the relationship between \(\sigma(F, \mathcal{A})\) and \(\mathcal{A}(F)\)?
They are the same! In logic, one often writes \(\mathcal{A}(F)\) instead of \(\sigma(F, \mathcal{A})\) and calls \(\mathcal{A}(F)\) the truth value of \(F\) under interpretation \(\mathcal{A}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the relationship between \(\sigma(F, \mathcal{A})\) and \(\mathcal{A}(F)\)?
Back
They are the same! In logic, one often writes \(\mathcal{A}(F)\) instead of \(\sigma(F, \mathcal{A})\) and calls \(\mathcal{A}(F)\) the <i>truth value of \(F\) under interpretation \(\mathcal{A}\)</i>.
What are the units of \(\mathbb{Z}\) and \(\mathbb{R}\)?
Units of \(\mathbb{Z}\): \(\mathbb{Z}^* = \{-1, 1\}\) (only elements with multiplicative inverse in \(\mathbb{Z}\))
Units of \(\mathbb{R}\): \(\mathbb{R}^* = \mathbb{R} \setminus \{0\}\) (all non-zero reals have multiplicative inverse)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What are the units of \(\mathbb{Z}\) and \(\mathbb{R}\)?</p>
Back
<ul>
<li><strong>Units of \(\mathbb{Z}\)</strong>: \(\mathbb{Z}^* = \{-1, 1\}\) (only elements with multiplicative inverse in \(\mathbb{Z}\))</li>
<li><strong>Units of \(\mathbb{R}\)</strong>: \(\mathbb{R}^* = \mathbb{R} \setminus \{0\}\) (all non-zero reals have multiplicative inverse)</li>
</ul>
A group \(G = \langle g \rangle\) generated by an element \(g \in G\) is called cyclic, and \(g\) is called a generator of \(G\).
Examples: \(\langle \mathbb{Z}_n;\oplus\rangle\) (cyclic for every \(n\), 1 is a generator) \(\langle\mathbb{Z}_n; +,-,0\rangle\)(infinite cyclic group with generators 1 and -1)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A group \(G = \langle g \rangle\) generated by an element \(g \in G\) is called {{c1::cyclic}}, and \(g\) is called {{c1::a <b>generator</b> of \(G\)}}.
Extra
Examples:<br>\(\langle \mathbb{Z}_n;\oplus\rangle\) (cyclic for every \(n\), 1 is a generator)<br>\(\langle\mathbb{Z}_n; +,-,0\rangle\)(infinite cyclic group with generators 1 and -1)
DHKE selects two public values:<br><ol><li>{{c1:: a large prime \(p\)}}</li><li>{{c2:: basis \(g\) which is then exponentiated}}</li></ol>
What important property do equivalence classes have?
The set \(A / \theta\) of equivalence classes of an equivalence relation \(\theta\) on \(A\) is a partition of \(A\).
(Equivalence classes are disjoint and cover the entire set)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What important property do equivalence classes have?
Back
The set \(A / \theta\) of equivalence classes of an equivalence relation \(\theta\) on \(A\) is a partition of \(A\).
<br>
(Equivalence classes are disjoint and cover the entire set)
The semantics of propositional logic are defined as:
{{c1::\(\mathcal{A}(F) = \mathcal{A}(A_i)\) for any atomic formula \(A_i\)}}
for \(\land, \lor, \lnot\) the semantics are identical to before.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The semantics of propositional logic are defined as:<br><ol><li>{{c1::\(\mathcal{A}(F) = \mathcal{A}(A_i)\) for any atomic formula \(A_i\)}}</li></ol>for \(\land, \lor, \lnot\) the semantics are identical to before.<br>
An interpretation or structure in predicate logic is a tuple \(\mathcal{A} = (U, \phi, \varphi, \xi)\) where: - \(U\) is a non-empty universe - \(\phi\) assigns function symbols to functions \(U^k \rightarrow U\) - {{c3::\(\varphi\) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}} - \(\xi\) assigns variable symbols to values in \(U\)
An interpretation or structure in predicate logic is a tuple \(\mathcal{A} = (U, \phi, \varphi, \xi)\) where: - \(U\) is a non-empty universe - \(\phi\) assigns function symbols to functions \(U^k \rightarrow U\) - {{c3::\(\varphi\) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}} - \(\xi\) assigns variable symbols to values in \(U\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An <i>interpretation</i> or <i>structure</i> in predicate logic is a tuple \(\mathcal{A} = (U, \phi, \varphi, \xi)\) where:<br>- {{c1::\(U\) is a <b>non-empty</b> universe}}<br>- {{c2::\(\phi\) assigns function symbols to functions \(U^k \rightarrow U\)}}<br>- {{c3::\(\varphi\) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}}<br>- {{c4::\(\xi\) assigns variable symbols to values in \(U\)}}
For all integers \(a\) and \(d \neq 0\), there exist unique integers \(q\) and \(r\) satisfying:
\[a = dq + r \quad \text{and} \quad 0 \leq r < |d|\]
(\(r\) is the remainder, \(q\) is the quotient)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
State the Euclidean Division Theorem.
Back
For all integers \(a\) and \(d \neq 0\), there exist <strong>unique</strong> integers \(q\) and \(r\) satisfying:
\[a = dq + r \quad \text{and} \quad 0 \leq r < |d|\]
(\(r\) is the remainder, \(q\) is the quotient)
What's the difference between \(\equiv\), \(\leftrightarrow\), and \(\Leftrightarrow\)?
\(\equiv\): links formulas to statements (not part of PL itself)
\(\leftrightarrow\): formula → formula (part of PL)
\(\Leftrightarrow\): statement → statement
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What's the difference between \(\equiv\), \(\leftrightarrow\), and \(\Leftrightarrow\)?
Back
<ul>
<li>\(\equiv\): links formulas to statements (not part of PL itself)</li>
<li>\(\leftrightarrow\): formula → formula (part of PL)</li>
<li>\(\Leftrightarrow\): statement → statement</li>
</ul>
The smallest non-negative integer \(n \in \mathbb{N}\) for which \(x \equiv_m n\). Equivalently, the remainder when \(x\) is divided by \(m\) (so \(0 \leq R_m(x) < m\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is \(R_m(x)\)?
Back
The smallest <strong>non-negative</strong> integer \(n \in \mathbb{N}\) for which \(x \equiv_m n\). Equivalently, the remainder when \(x\) is divided by \(m\) (so \(0 \leq R_m(x) < m\)).
What is the number of subgroups of \(\mathbb{Z}_n\)?
it is the number of divisors of \(n\) if \(n\) is written \(n = p_1^{e_1} \times p_2^{e_2} \times ... \times p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the number of subgroups of \(\mathbb{Z}_n\)?
Back
it is the number of divisors of \(n\)<br>if \(n\) is written \(n = p_1^{e_1} \times p_2^{e_2} \times ... \times p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\)
Lemma 5.5(ii): A group homomorphism \(\psi: G \rightarrow H\) maps {{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).
Lemma 5.5(ii): A group homomorphism \(\psi: G \rightarrow H\) maps {{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p><strong>Lemma 5.5(ii)</strong>: A group homomorphism \(\psi: G \rightarrow H\) maps {{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).</p>
To prove equivalence between formulas \(F\) and \(G\) we have to prove that \(F \models G \ \ \land \ \ G \models F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
To prove equivalence between formulas \(F\) and \(G\) we have to prove that {{c1:: \(F \models G \ \ \land \ \ G \models F\)}}.
A group is an algebra \(\langle G; *, \widehat{\ \ }, e \rangle\) satisfying three axioms: G1 (associativity), G2 (neutral element), and G3 (inverse elements).
A group is an algebra \(\langle G; *, \widehat{\ \ }, e \rangle\) satisfying three axioms: G1 (associativity), G2 (neutral element), and G3 (inverse elements).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>A {{c1::group}} is an algebra \(\langle G; *, \widehat{\ \ }, e \rangle\) satisfying {{c2::three}} axioms: {{c3::G1 (associativity)}}, {{c4::G2 (neutral element)}}, and {{c5::G3 (inverse elements)}}.</p>
There is a trade-off in calculi between simplicity (which makes proving soundness easier) and versatility (which makes the calculus more complete).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
There is a trade-off in calculi between {{c1::simplicity (which makes proving soundness easier)}} and {{c1::versatility (which makes the calculus more complete)}}.
A clause \(K\) is {{c1::<i>resolvent</i>}} of clauses \(K_1\) and \(K_2\) if {{c2::there is a literal \(L\) such that \(L \in K_1\), \(\lnot L \in K_2\)}}.
The syntax of a logic defines an alphabet \(\Lambda\) (of allowed symbols) and specifies which strings in \(\Lambda^*\) are formulas (i.e. syntactically correct).
The syntax of a logic defines an alphabet \(\Lambda\) (of allowed symbols) and specifies which strings in \(\Lambda^*\) are formulas (i.e. syntactically correct).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c1::<i>syntax</i>}} of a logic defines {{c2::an alphabet \(\Lambda\) (of allowed symbols)}} and specifies {{c2::which strings in \(\Lambda^*\) are formulas (i.e. syntactically correct)}}.
A monoidis an algebra \( \langle S; *, e \rangle\) where \(*\) is associative and \(e\) is the neutral element.
Difference to group: Inverse missing
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::A <b>monoid</b>}}<b> </b>is an algebra {{c2::\( \langle S; *, e \rangle\) where \(*\) is associative and \(e\) is the neutral element.}}
What is the group generated by a, denoted \(\langle a \rangle\) defined as?
For a group \(G\) and \(a \in G\), the group generated by \(a\), denoted \(\langle a \rangle\), is defined as: \[\langle a \rangle \ \overset{\text{def}}{=} \ \{a^n \ | \ n \in \mathbb{Z}\}\]
This is a group, the smallest subgroup of \(G\) containing the element \(a\).
For finite groups: \(\langle a \rangle = \{e, a, a^2, \dots, a^{\text{ord}(a)-1}\}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is the group <em>generated by a</em>, denoted \(\langle a \rangle\) defined as?</p>
Back
<p>For a group \(G\) and \(a \in G\), the group generated by \(a\), denoted \(\langle a \rangle\), is defined as: \[\langle a \rangle \ \overset{\text{def}}{=} \ \{a^n \ | \ n \in \mathbb{Z}\}\]</p>
<p>This is a group, the smallest subgroup of \(G\) containing the element \(a\).</p>
<p>For finite groups: \(\langle a \rangle = \{e, a, a^2, \dots, a^{\text{ord}(a)-1}\}\).</p>
Can a relation be both symmetric and antisymmetric?
YES - the identity relation is both symmetric and antisymmetric. The properties are independent, not mutually exclusive.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Can a relation be both symmetric and antisymmetric?
Back
<strong>YES</strong> - the identity relation is both symmetric and antisymmetric. The properties are <strong>independent</strong>, not mutually exclusive.
In propositional logic, a formula \(G\) is a logical consequence of a formula \(F\) if for all truth assignments to the propositional symbols appearing in \(F\) or \(G\), the truth value of \(G\) is \(1\) if the truth value of \(F\) is \(1\). This is denoted with \(F \models G\).
In propositional logic, a formula \(G\) is a logical consequence of a formula \(F\) if for all truth assignments to the propositional symbols appearing in \(F\) or \(G\), the truth value of \(G\) is \(1\) if the truth value of \(F\) is \(1\). This is denoted with \(F \models G\).
Example: \(A \land B \models A \lor B\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In <b>propositional logic</b>, a formula \(G\) is a <i>logical consequence</i> of a formula \(F\) if {{c1:: for all truth assignments to the propositional symbols appearing in \(F\) or \(G\), the truth value of \(G\) is \(1\) if the truth value of \(F\) is \(1\)}}. This is denoted with \(F \models G\).
An \((n,k)\)-encoding function \(E\) is an {{c2::injective function \(E: \mathcal{A}^k \rightarrow \mathcal{A}^n\) where \(n > k\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>An {{c1::\((n,k)\)-encoding function}} \(E\) is an {{c2::injective function \(E: \mathcal{A}^k \rightarrow \mathcal{A}^n\) where \(n > k\)}}.</p>
An operation on a set \(S\) is a function \(S^n \to S\), where \(n \ge 0\) is called the arity of the operation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An <i>operation</i> on a set \(S\) is {{c1::a function \(S^n \to S\), where \(n \ge 0\) is called the <i>arity</i> of the operation::what (include arity)?}}.
Can the resolution calculus remove two complementary literals at once?
NO! The resolution calculus doesn't allow removing two complementary literals at once.
The derivation \(\{A, \lnot B\}, \{\lnot A, B\} \vdash_{\text{res}} \emptyset\) is wrong and illegal!
For \(A = 1\), \(B = 1\) both clauses are true, so this would derive unsatisfiability from satisfiable clauses.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Can the resolution calculus remove two complementary literals at once?
Back
<b>NO!</b> The resolution calculus <b>doesn't allow</b> removing two complementary literals at once.<br><br>The derivation \(\{A, \lnot B\}, \{\lnot A, B\} \vdash_{\text{res}} \emptyset\) is <b>wrong and illegal!</b><br><br>For \(A = 1\), \(B = 1\) both clauses are true, so this would derive unsatisfiability from satisfiable clauses.
\(F \models G\) in propositional logic means that the function table (truth table) of \(G\) contains a \(1\) for at least all arguments for which the function table of \(F\) contains a \(1\).
\(F \models G\) in propositional logic means that the function table (truth table) of \(G\) contains a \(1\) for at least all arguments for which the function table of \(F\) contains a \(1\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c2::\(F \models G\)}} in propositional logic means that {{c1::the function table (truth table) of \(G\) contains a \(1\) for at least all arguments for which the function table of \(F\) contains a \(1\)}}.
In predicate logic interpretation, \(\phi\) assigns function symbols \(f\) to functions, \(\phi(f)\) is a function \(U^k \rightarrow U\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In predicate logic interpretation, {{c1::\(\phi\)}} assigns {{c2::<b>function</b> symbols \(f\) to functions, \(\phi(f)\) is a function \(U^k \rightarrow U\)}}.
For two groups \(\langle G;*;\widehat{};e\rangle\)and \(\langle H;\star;\sim;e'\rangle\), a function \(\psi: G\to H\) is called a group homomorphism if for all \(a\) and \(b\): \(\psi(a*b) = \psi(a)\star\psi(b)\). If \(\psi\) is a bijection from \(G\) to \(H\), then it is called an isomorphism.
For two groups \(\langle G;*;\widehat{};e\rangle\)and \(\langle H;\star;\sim;e'\rangle\), a function \(\psi: G\to H\) is called a group homomorphism if for all \(a\) and \(b\): \(\psi(a*b) = \psi(a)\star\psi(b)\). If \(\psi\) is a bijection from \(G\) to \(H\), then it is called an isomorphism.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For two groups \(\langle G;*;\widehat{};e\rangle\)and \(\langle H;\star;\sim;e'\rangle\), a function \(\psi: G\to H\) is called a <i>group homomorphism</i> if for all \(a\) and \(b\):<br>{{c1::\(\psi(a*b) = \psi(a)\star\psi(b)\)}}.<br>If \(\psi\) is {{c2::a bijection from \(G\) to \(H\)}}, then it is called an <i>isomorphism</i>.
Derivation or inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Derivation or inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Formally, a derivation rule \(R\) is a relation from the power set of the set of formulas to the set of formulas.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<i>Derivation </i>or <i>inference</i> rule: <br>{{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Extra
Formally, a derivation rule \(R\) is a relation from the power set of the set of formulas to the set of formulas.
In predicate logic interpretation, \(\varphi\) assigns {{c2::predicate symbols \(P\) to functions, \(\varphi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
In predicate logic interpretation, \(\varphi\) assigns {{c2::predicate symbols \(P\) to functions, \(\varphi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In predicate logic interpretation, {{c1::\(\varphi\)}} assigns {{c2::<b>predicate</b> symbols \(P\) to functions, \(\varphi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
What are the equivalence classes modulo \(m(x)\) in a polynomial field.
Lemma 5.33: Congruence modulo \(m(x)\) is an equivalence relation on \(F[x]\), and each equivalence class has a unique representation of degree less than \(\deg(m(x))\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What are the equivalence classes modulo \(m(x)\) in a polynomial field.</p>
Back
<p><strong>Lemma 5.33</strong>: Congruence modulo \(m(x)\) is an <strong>equivalence relation</strong> on \(F[x]\), and each equivalence class has a <strong>unique representation</strong> of degree less than \(\deg(m(x))\).</p>
If for two groups \(G\) and \(H\) there is a function \(\psi: G\to H\) which is an isomorphism, then we say that \(G\) and \(H\) are isomorphic and we write this as \(G \simeq H\).
If for two groups \(G\) and \(H\) there is a function \(\psi: G\to H\) which is an isomorphism, then we say that \(G\) and \(H\) are isomorphic and we write this as \(G \simeq H\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If for two groups \(G\) and \(H\) there is a function \(\psi: G\to H\) which is an isomorphism, then we say that {{c1::\(G\) and \(H\) are <i>isomorphic</i>}} and we write this as {{c1::\(G \simeq H\)}}.
What is the difference between a constructive and non-constructive existence proof?
Constructive: Exhibits an explicit \(a\) for which \(S_a\) is true
Non-constructive: Proves existence without constructing a specific example
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the difference between a constructive and non-constructive existence proof?
Back
<ul>
<li><strong>Constructive</strong>: Exhibits an explicit \(a\) for which \(S_a\) is true</li>
<li><strong>Non-constructive</strong>: Proves existence without constructing a specific example</li>
</ul>
Lagrange's theorem: If \(G\) is a finite group and \(H\) is a subgroup, then the order of \(H\) divides the order of \(G\), i.e. \(|H|\) divides \(|G|\).
Lagrange's theorem: If \(G\) is a finite group and \(H\) is a subgroup, then the order of \(H\) divides the order of \(G\), i.e. \(|H|\) divides \(|G|\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Lagrange's theorem: If \(G\) is a finite group and \(H\) is a subgroup, then {{c1::the order of \(H\) divides the order of \(G\), i.e. \(|H|\) divides \(|G|\).}}
For any formulas \(F\) and \(G\), \(F \rightarrow G\) is a tautology if and only if\(F \models G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For any formulas \(F\) and \(G\), {{c1::\(F \rightarrow G\)}} is a tautology <strong>if and only if</strong> {{c2::\(F \models G\)}}.
A formula is in conjunctive normal form (CNF) if it is a {{c2::conjunction of disjunctions of literals: \[(L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\]}}
A formula is in conjunctive normal form (CNF) if it is a {{c2::conjunction of disjunctions of literals: \[(L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\]}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A formula is in {{c1::<i>conjunctive normal form</i> (CNF)}} if it is a {{c2::conjunction of disjunctions of literals: \[(L_{11} \lor \dots \lor L_{1m_1}) \land \dots \land (L_{n1} \lor \dots \lor L_{nm_n})\]}}
The goal of logic is to provide a specific proof system with which we can express a very large class of mathematical statements in \(\mathcal{S}\).
However, it's never possible to create a proof system that captures all such statements, especially self-referential statements.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The goal of logic is to provide a {{c1::specific proof system}} with which we can express {{c2::a very large class of mathematical statements}} in \(\mathcal{S}\).
Extra
However, it's never possible to create a proof system that captures <i>all</i> such statements, especially self-referential statements.
The Skolem transformation works by replacing all variables bound to an \(\exists\) by a function whose arguments are the universally quantified variables that precede it.
The Skolem transformation works by replacing all variables bound to an \(\exists\) by a function whose arguments are the universally quantified variables that precede it.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The Skolem transformation works by {{c1::replacing all variables <i>bound to an \(\exists\)</i> by a function}} whose arguments are {{c2::the universally quantified variables that precede it}}.
How is composition of relations represented in matrix and graph form?
Matrix: Matrix multiplication
Graph: Natural composition - there's a path from \(a\) to \(c\) if there's a path \(a \to b\) in graph 1 and \(b \to c\) in graph 2
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How is composition of relations represented in matrix and graph form?
Back
<ul>
<li><strong>Matrix</strong>: Matrix multiplication</li>
<li><strong>Graph</strong>: Natural composition - there's a path from \(a\) to \(c\) if there's a path \(a \to b\) in graph 1 and \(b \to c\) in graph 2</li>
</ul>
Which of the following are integral domains: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_6, \mathbb{Z}_7\)?
Integral domains: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_7\) (where \(7\) is prime)
Not integral domains: \(\mathbb{Z}_6\) (since \(6\) is not prime)
Explanation: \(\mathbb{Z}_m\) is an integral domain if and only if \(m\) is prime. For \(\mathbb{Z}_6\), we have \(2 \cdot 3 \equiv_6 0\), so \(2\) and \(3\) are zerodivisors.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Which of the following are integral domains: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_6, \mathbb{Z}_7\)?</p>
Back
<p><strong>Integral domains</strong>: \(\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, \mathbb{Z}_7\) (where \(7\) is prime)</p>
<p><strong>Not integral domains</strong>: \(\mathbb{Z}_6\) (since \(6\) is not prime)</p>
<p><strong>Explanation</strong>: \(\mathbb{Z}_m\) is an integral domain if and only if \(m\) is prime. For \(\mathbb{Z}_6\), we have \(2 \cdot 3 \equiv_6 0\), so \(2\) and \(3\) are zerodivisors.</p>
State Theorem 5.23 about when \(\mathbb{Z}_p\) is a field.
Theorem 5.23: \(\mathbb{Z}_p\) is a field if and only if \(p\) is prime.
Explanation: When \(p\) is prime, every non-zero element is coprime to \(p\) and thus has a multiplicative inverse. When \(p\) is composite, there exist elements without inverses (the factors of \(p\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Theorem 5.23 about when \(\mathbb{Z}_p\) is a field.</p>
Back
<p><strong>Theorem 5.23</strong>: \(\mathbb{Z}_p\) is a field <strong>if and only if</strong> \(p\) is prime.</p>
<p><strong>Explanation</strong>: When \(p\) is prime, every non-zero element is coprime to \(p\) and thus has a multiplicative inverse. When \(p\) is composite, there exist elements without inverses (the factors of \(p\)).</p>
What is the proof idea for the soundness of the resolution calculus (Lemma 6.5)?
If \(\mathcal{A}\) models the set \(K_1, K_2\) then it makes at least one literal in both true. Case distinction: - If \(\mathcal{A}(L) = 1\), then \(K_2\) (which has \(\lnot L\)) must have at least one other literal that evaluates to true, so the union (resolvent) is also true - Similarly for \(\mathcal{A}(L) = 0\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the proof idea for the soundness of the resolution calculus (Lemma 6.5)?
Back
If \(\mathcal{A}\) models the set \(K_1, K_2\) then it makes at least one literal in both true. Case distinction:<br>- If \(\mathcal{A}(L) = 1\), then \(K_2\) (which has \(\lnot L\)) must have at least one other literal that evaluates to true, so the union (resolvent) is also true<br>- Similarly for \(\mathcal{A}(L) = 0\)
A formula is in disjunctive normal form (DNF) if it is a {{c2::disjunction of conjunctions of literals: \[(L_{11} \land \dots \land L_{1m_1}) \lor \dots \lor (L_{n1} \land \dots \land L_{nm_n})\]}}
A formula is in disjunctive normal form (DNF) if it is a {{c2::disjunction of conjunctions of literals: \[(L_{11} \land \dots \land L_{1m_1}) \lor \dots \lor (L_{n1} \land \dots \land L_{nm_n})\]}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A formula is in {{c1::<i>disjunctive normal form</i> (DNF)}} if it is a {{c2::disjunction of conjunctions of literals: \[(L_{11} \land \dots \land L_{1m_1}) \lor \dots \lor (L_{n1} \land \dots \land L_{nm_n})\]}}
The application of a derivation rule \(R\) to a set \(M\) of formulas means: 1. Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\) 2. {{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}
The application of a derivation rule \(R\) to a set \(M\) of formulas means: 1. Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\) 2. {{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <i>application of a derivation rule</i> \(R\) to a set \(M\) of formulas means:<br>1. {{c1::Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\)}}<br>2. {{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}
Why do we replace \(\exists x\) in \(\exists x f(x)\) with a constant \(a\) in Skolem Normal Form?
If the \(\exists\) is the first quantifier in the formula, then it doesn't depend on anything, and we can just replace it by a constant function \(a\) that always returns the \(x\) for which our formula is true: \(\exists x f(x) \equiv f(a)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why do we replace \(\exists x\) in \(\exists x f(x)\) with a constant \(a\) in Skolem Normal Form?
Back
If the \(\exists\) is the first quantifier in the formula, then it <b>doesn't depend on anything</b>, and we can just replace it by a constant function \(a\) that always returns the \(x\) for which our formula is true: \(\exists x f(x) \equiv f(a)\).
Under interpretation \(P, U, x, f\) become {{c1:: \(P^\mathcal{A}\), \(U^\mathcal{A}\), \(x^\mathcal{A} = \xi(x)\) and \(f^\mathcal{A}\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Under interpretation \(P, U, x, f\) become {{c1:: \(P^\mathcal{A}\), \(U^\mathcal{A}\), \(x^\mathcal{A} = \xi(x)\) and \(f^\mathcal{A}\)}}.
Semantics Prop. Logic: {{c2::\(\mathcal{A}((F \land G)) = 1\) }} if and only if {{c1::\(\mathcal{A}(F) = 1\) and \(\mathcal{A}(G) = 1\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Semantics Prop. Logic: {{c2::\(\mathcal{A}((F \land G)) = 1\) }} if and only if {{c1::\(\mathcal{A}(F) = 1\) <i>and</i> \(\mathcal{A}(G) = 1\)}}.
An interpretation consists of {{c1::a set \(\mathcal{Z} \subseteq \Lambda\) of \(\Lambda\)}}, {{c2::a domain (a set of possible values) for each symbol in \(\mathcal{Z}\)}}, and {{c3::a function that assigns to each symbol in \(\mathcal{Z}\) a value in the associated domain}}.
An interpretation consists of {{c1::a set \(\mathcal{Z} \subseteq \Lambda\) of \(\Lambda\)}}, {{c2::a domain (a set of possible values) for each symbol in \(\mathcal{Z}\)}}, and {{c3::a function that assigns to each symbol in \(\mathcal{Z}\) a value in the associated domain}}.
Often the domain is defined in terms of the universe \(U\) where a symbol can be a function, predicate or element of \(U\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An <i>interpretation</i> consists of {{c1::a set \(\mathcal{Z} \subseteq \Lambda\) of \(\Lambda\)}}, {{c2::a domain (a set of possible values) for each symbol in \(\mathcal{Z}\)}}, and {{c3::a function that assigns to each symbol in \(\mathcal{Z}\) a value in the associated domain}}.
Extra
Often the domain is defined in terms of the <i>universe</i> \(U\) where a symbol can be a function, predicate or element of \(U\).
What is the Skolem transformation of \(\forall s \exists t \forall x \forall y \exists z F(s, t, x, y, z)\)?
\[\forall s \forall x \forall y F(s, f(s), x, y, g(s, x, y))\]
The \(t\) depends only on \(s\), so it becomes \(f(s)\). The \(z\) depends on \(s\), \(x\), and \(y\), so it becomes \(g(s, x, y)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the Skolem transformation of \(\forall s \exists t \forall x \forall y \exists z F(s, t, x, y, z)\)?
Back
\[\forall s \forall x \forall y F(s, f(s), x, y, g(s, x, y))\]<br><br>The \(t\) depends only on \(s\), so it becomes \(f(s)\). The \(z\) depends on \(s\), \(x\), and \(y\), so it becomes \(g(s, x, y)\).
A formula \(G\) is a logical consequence of a formula \(F\) (or a set \(M\)), denoted \(F \models G\), if every interpretation suitable for both \(F\) and \(G\) which is a model for \(F\) is also a model for \(G\).
A formula \(G\) is a logical consequence of a formula \(F\) (or a set \(M\)), denoted \(F \models G\), if every interpretation suitable for both \(F\) and \(G\) which is a model for \(F\) is also a model for \(G\).
\(F\) model for \(G\) means: \(\mathcal{A} \models F \implies \mathcal{A} \models G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A formula \(G\) is a {{c1::<i>logical consequence</i>}} of a formula \(F\) (or a set \(M\)), denoted {{c1::\(F \models G\)}}, if {{c2::every interpretation suitable for both \(F\) and \(G\) which is a model for \(F\) is also a model for \(G\)}}.
Extra
\(F\) model for \(G\) means: \(\mathcal{A} \models F \implies \mathcal{A} \models G\).
A derivation of a formula \(G\) from a set \(M\) of formulas in a calculus \(K\) is a finite sequence (of some length \(n\)) of applications of rules in \(K\), leading to \(G\) denoted \(M \vdash_K G\).
A derivation of a formula \(G\) from a set \(M\) of formulas in a calculus \(K\) is a finite sequence (of some length \(n\)) of applications of rules in \(K\), leading to \(G\) denoted \(M \vdash_K G\).
More precisely: \(M_0 := M\), \(M_i := M_{i-1} \cup \{G_i\}\) for \(1 \leq i \leq n\), where \(N \vdash_R G_i\) for some \(N \subseteq M_{i-1}\) and for some \(R_j \in K\), and where \(G_n = G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <i>derivation</i> of a formula \(G\) from a set \(M\) of formulas in a calculus \(K\) is a {{c1::finite sequence (of some length \(n\)) of applications of rules in \(K\), leading to \(G\)}} denoted {{c2:: \(M \vdash_K G\)}}.
Extra
More precisely: \(M_0 := M\), \(M_i := M_{i-1} \cup \{G_i\}\) for \(1 \leq i \leq n\), where \(N \vdash_R G_i\) for some \(N \subseteq M_{i-1}\) and for some \(R_j \in K\), and where \(G_n = G\).
Proof Idea Resolution Calculus complete (regard to unsatisfiability):
Proof by induction on \(n\) literals:
Base case (n=1): Only one unsatisfiable set for 1 literal: \(\{\{A_1\}, \{\lnot A_1\}\}\)
Inductive step: Remove \(A_{n+1}\)/\(\lnot A_{n+1}\) from all formulas, producing two sets \(\mathcal{K}_1\)/\(\mathcal{K}_0\)
Apply I.H. to derive \(\emptyset\) in each (if unsatisfiable)
Add literals back: get derivations for \(\{A_{n+1}\}\) and \(\{\lnot A_{n+1}\}\), which resolve to \(\emptyset\)
(It could also be that we didn't use the literals in the derivations, then we're done immediately)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Proof Idea Resolution Calculus complete (regard to unsatisfiability):
Back
<b>Proof by induction on \(n\) literals:</b><br><ul><li><b>Base case (n=1):</b> Only one unsatisfiable set for 1 literal: \(\{\{A_1\}, \{\lnot A_1\}\}\)</li><li><b>Inductive step:</b> Remove \(A_{n+1}\)/\(\lnot A_{n+1}\) from all formulas, producing two sets \(\mathcal{K}_1\)/\(\mathcal{K}_0\)</li><li>Apply I.H. to derive \(\emptyset\) in each (if unsatisfiable)</li><li>Add literals back: get derivations for \(\{A_{n+1}\}\) and \(\{\lnot A_{n+1}\}\), which resolve to \(\emptyset\)</li><li>(It could also be that we didn't use the literals in the derivations, then we're done immediately)</li></ul><br>
How do you construct a CNF formula from a truth table?
For every row evaluating to 0: 1. Take the disjunction of \(n\) literals 2. If \(A_i = 0\) in the row, take \(A_i\) 3. If \(A_i = 1\) in the row, take \(\lnot A_i\) 4. Then take the conjunction of all these rows
This works because \(F\) is \(0\) exactly if every single disjunction is true, which is the case by construction.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do you construct a CNF formula from a truth table?
Back
For every row evaluating to <b>0</b>:<br>1. Take the <i>disjunction</i> of \(n\) literals<br>2. If \(A_i = 0\) in the row, take \(A_i\)<br>3. If \(A_i = 1\) in the row, take \(\lnot A_i\)<br>4. Then take the <i>conjunction</i> of all these rows<br><br>This works because \(F\) is \(0\) exactly if every single disjunction is true, which is the case by construction.
We can eliminate the quantifier by replacing \(x\) by one specific \(t\). As \(F\) is true for all \(x\), this holds for the free variable \(t\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does universal instantiation work?
Back
We can eliminate the quantifier by replacing \(x\) by one specific \(t\). As \(F\) is true for all \(x\), this holds for the free variable \(t\).
For a set \(M\) of formulas, a (suitable) interpretation for which all formulas are true is called a model for \(M\) denoted as {{c2::\(\mathcal{A} \models M\)}}.
For a set \(M\) of formulas, a (suitable) interpretation for which all formulas are true is called a model for \(M\) denoted as {{c2::\(\mathcal{A} \models M\)}}.
If \(\mathcal{A}\) is not a model for \(M\) one writes \(\mathcal{A} \not\models M\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a set \(M\) of formulas, a {{c3:: (suitable) interpretation for which all formulas are true}} is called a {{c2::<i>model</i> for \(M\)}} denoted as {{c2::\(\mathcal{A} \models M\)}}.
Extra
If \(\mathcal{A}\) is not a model for \(M\) one writes \(\mathcal{A} \not\models M\).
How do you construct a DNF formula from a truth table?
For every row evaluating to 1: 1. Take the conjunction of \(n\) literals 2. If \(A_i = 0\) in the row, take \(\lnot A_i\) 3. If \(A_i = 1\) in the row, take \(A_i\) 4. Then take the disjunction of all these rows
This works because \(F\) is \(1\) exactly if one of the rows is \(1\), which is the case by construction.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do you construct a DNF formula from a truth table?
Back
For every row evaluating to <b>1</b>:<br>1. Take the <i>conjunction</i> of \(n\) literals<br>2. If \(A_i = 0\) in the row, take \(\lnot A_i\)<br>3. If \(A_i = 1\) in the row, take \(A_i\)<br>4. Then take the <i>disjunction</i> of all these rows<br><br>This works because \(F\) is \(1\) exactly if one of the rows is \(1\), which is the case by construction.
A derivation rule \(R\) is correct if for every set \(M\) of formulas and every formula \(F\), \(M \vdash_R F\) implies \(M \models F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A derivation rule \(R\) is {{c1::<i>correct</i>}} if for every set \(M\) of formulas and every formula \(F\), {{c2::\(M \vdash_R F\) implies \(M \models F\)}}.
The semantics defines: 1. A function \(free\) that assigns to each formula which symbols occur free 2. A function \(\sigma\) that assigns truth values to formulas under interpretations 3. The meaning and behavior of logical operators
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does the semantics of a logic define?
Back
The semantics defines:<br>1. A function \(free\) that assigns to each formula which symbols occur free<br>2. A function \(\sigma\) that assigns truth values to formulas under interpretations<br>3. The meaning and behavior of logical operators
\(F\) of the form \(\forall x G\) or \(\exists x G\) semantics:
\(\mathcal{A}(\forall x G) = 1\) if {{c1::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for all \(u\) in \(U\)}}
\(\mathcal{A}(\exists x G) = 1\) if {{c2::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for some \(u\) in \(U\)}}
\(\mathcal{A}_{[x \rightarrow u]}\)}} for \(u\) in \(U\) is the same structure as \(\mathcal{A}\), except that \(\xi(x)\) is overwritten by \(u\): \(\xi(x) = u\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(F\) of the form \(\forall x G\) or \(\exists x G\) semantics:<br><ul><li>\(\mathcal{A}(\forall x G) = 1\) if {{c1::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for all \(u\) in \(U\)}}</li><li>\(\mathcal{A}(\exists x G) = 1\) if {{c2::\(\mathcal{A}_{[x \rightarrow u]}(G) = 1\) for some \(u\) in \(U\)}}</li></ul>
Extra
<div>\(\mathcal{A}_{[x \rightarrow u]}\)}} for \(u\) in \(U\) is the same structure as \(\mathcal{A}\), except that \(\xi(x)\) is overwritten by \(u\): \(\xi(x) = u\).</div>
A function symbol is of the form {{c2::\(f_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where \(k\) denotes the number of arguments (the arity) of the function.
A function symbol is of the form {{c2::\(f_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where \(k\) denotes the number of arguments (the arity) of the function.
Function symbols for \(k = 0\) are called constants.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A {{c1::<i>function symbol</i>}} is of the form {{c2::\(f_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where {{c2::\(k\) denotes the number of arguments (the <i>arity</i>) of the function}}.
Extra
Function symbols for \(k = 0\) are called <i>constants</i>.
A {{c2:: (suitable) interpretation \(\mathcal{A}\) for which a formula \(F\) is true (i.e. \(\mathcal{A}(F) = 1\))}} is called a model for \(F\) and one also writes {{c1::\(\mathcal{A} \models F\)}}.
A {{c2:: (suitable) interpretation \(\mathcal{A}\) for which a formula \(F\) is true (i.e. \(\mathcal{A}(F) = 1\))}} is called a model for \(F\) and one also writes {{c1::\(\mathcal{A} \models F\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A {{c2:: (suitable) interpretation \(\mathcal{A}\) for which a formula \(F\) is true (i.e. \(\mathcal{A}(F) = 1\))}} is called a {{c1::<i>model</i>}} for \(F\) and one also writes {{c1::\(\mathcal{A} \models F\)}}.
sound or correct if \(M \vdash_K F\) implies \(M \models F\).
complete if \(M \models F\) implies \(M \vdash_K F\).
Hence, it's sound and complete if \(M \vdash_K F \Leftrightarrow M \models F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A calculus \(K\) is <br><ul><li>{{c1::<i>sound</i> or <i>correct</i>}} if {{c2::\(M \vdash_K F\) implies \(M \models F\)}}.</li><li>{{c3::<i>complete</i>}} if {{c4::\(M \models F\) implies \(M \vdash_K F\)}}.</li></ul>
Extra
Hence, it's <b>sound and complete</b> if \(M \vdash_K F \Leftrightarrow M \models F\).
A predicate symbol is of the form {{c2::\(P_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where \(k\) denotes the number of arguments of the predicate.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A {{c1::<i>predicate symbol</i>}} is of the form {{c2::\(P_i^{(k)}\) with \(i, k \in \mathbb{N}\)}}, where {{c2::\(k\) denotes the number of arguments of the predicate}}.
The semantics of a logic defines a function \(\sigma\) {{c1::assigning to each formula \(F\) and each interpretation \(\mathcal{A}\) suitable for \(F\) a truth value\(\sigma(F, \mathcal{A})\)in \(\{0, 1\}\)}}.
The semantics of a logic defines a function \(\sigma\) {{c1::assigning to each formula \(F\) and each interpretation \(\mathcal{A}\) suitable for \(F\) a truth value\(\sigma(F, \mathcal{A})\)in \(\{0, 1\}\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <i>semantics</i> of a logic defines a function \(\sigma\) {{c1::assigning to each formula \(F\) and each interpretation \(\mathcal{A}\) suitable for \(F\) a truth value\(\sigma(F, \mathcal{A})\)in \(\{0, 1\}\)}}.
if \((t_1, \dots, t_k)\) are terms, then {{c3::\(f^{(k)}(t_1, \dots, t_k)\) is a term}}.
For \(k = 0\) one writes no parenthesis (constants).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <b>term</b> is defined inductively: <br><ul><li>{{c1::A variable}} is a term</li><li>if {{c2::\((t_1, \dots, t_k)\) are terms}}, then {{c3::\(f^{(k)}(t_1, \dots, t_k)\) is a term}}.</li></ul>
Extra
For \(k = 0\) one writes no parenthesis (constants).
Two formulas \(F\) and \(G\) are equivalent, denoted \(F \equiv G\), if every interpretation suitable for both \(F\) and \(G\) yields the same truth value.
Two formulas \(F\) and \(G\) are equivalent, denoted \(F \equiv G\), if every interpretation suitable for both \(F\) and \(G\) yields the same truth value.
Each one is a logical consequence of the other: \(F \models G\) and \(G \models F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Two formulas \(F\) and \(G\) are {{c1::<i>equivalent</i>}}, denoted {{c1::\(F \equiv G\)}}, if {{c2::every interpretation suitable for both \(F\) and \(G\) yields the same truth value}}.
Extra
Each one is a logical consequence of the other: \(F \models G\) and \(G \models F\).
If a variable \(x\) occurs in a (sub-)formula of the form \(\forall x G\) or \(\exists x G\) then it is bound, otherwise it is free.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If a variable \(x\) occurs {{c1::in a (sub-)formula of the form \(\forall x G\) or \(\exists x G\)}} then it is {{c2:: <b>bound</b>, otherwise it is <b>free</b>}}.
Does every homomorphism have to be injective? Give an example.
No, homomorphisms do not need to be injective.
Example: We could map all elements of \(G\) to the neutral element \(e'\) in \(H\). This satisfies the homomorphism property: \[\psi(a * b) = e' = e' \star e' = \psi(a) \star \psi(b)\] but is clearly not injective.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Does every homomorphism have to be injective? Give an example.</p>
Back
<p><strong>No</strong>, homomorphisms do not need to be injective.</p>
<p><strong>Example</strong>: We could map all elements of \(G\) to the neutral element \(e'\) in \(H\). This satisfies the homomorphism property: \[\psi(a * b) = e' = e' \star e' = \psi(a) \star \psi(b)\] but is clearly not injective.</p>
The set of units of \(R\) is denoted by \(R^*\) and \(R^*\) is a group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds.
The set of units of \(R\) is denoted by \(R^*\) and \(R^*\) is a group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::set of units}} of \(R\) is denoted by {{c2::\(R^*\)}} and {{c3::\(R^*\) is a group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds}}.</p>
Give an example of an element with infinite order.
In the group \(\langle \mathbb{Z}; + \rangle\), any integer \(a \neq 0\) has infinite order.
Explanation: The carrier \(\mathbb{Z}\) is infinite, and we never "loop around" to reach \(0\) by repeatedly adding a non-zero integer. For any \(n \geq 1\), we have \(na \neq 0\) if \(a \neq 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of an element with infinite order.</p>
Back
<p>In the group \(\langle \mathbb{Z}; + \rangle\), any integer \(a \neq 0\) has <strong>infinite order</strong>.</p>
<p><strong>Explanation</strong>: The carrier \(\mathbb{Z}\) is infinite, and we never "loop around" to reach \(0\) by repeatedly adding a non-zero integer. For any \(n \geq 1\), we have \(na \neq 0\) if \(a \neq 0\).</p>
What is a zerodivisor and in which structure do they exist?
A zerodivisor is an element \(a \neq 0\) in a commutative ring for which there exists a \(b \neq 0\) such that \(ab = 0\).
This is commonly encountered for the polynomial rings formed over \(\text{GF}[x]_{m(x)}\) with \(m(x)\) not irreducible (i.e. it's not a field).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a zerodivisor and in which structure do they exist?
Back
A <b>zerodivisor</b> is an element \(a \neq 0\) in a <b>commutative ring</b> for which there exists a \(b \neq 0\) such that \(ab = 0\).<br><br>This is commonly encountered for the polynomial rings formed over \(\text{GF}[x]_{m(x)}\) with \(m(x)\) not irreducible (i.e. it's not a field).
What's the difference between a minimal element and the least element in a poset?
Minimal: No \(b\) exists with \(b \prec a\) (could be multiple minimal elements)
Least: \(a \preceq b\) for all \(b \in A\) (unique if it exists)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What's the difference between a minimal element and the least element in a poset?
Back
<ul>
<li><strong>Minimal</strong>: No \(b\) exists with \(b \prec a\) (could be multiple minimal elements)</li>
<li><strong>Least</strong>: \(a \preceq b\) for <strong>all</strong> \(b \in A\) (unique if it exists)</li>
</ul>
What is the ideal \((a, b)\) generated by integers \(a\) and \(b\) and just \(a\)?
\[(a, b) \overset{\text{def}}{=} \{ ua + vb \ | \ u, v \in \mathbb{Z}\}\] and \[(a) \overset{\text{def}}{=} \{ ua \ | \ u \in \mathbb{Z}\}\]
The set of all integer linear combinations of \(a\) and \(b\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the ideal \((a, b)\) generated by integers \(a\) and \(b\) and just \(a\)?
Back
\[(a, b) \overset{\text{def}}{=} \{ ua + vb \ | \ u, v \in \mathbb{Z}\}\] and \[(a) \overset{\text{def}}{=} \{ ua \ | \ u \in \mathbb{Z}\}\]
The set of all integer linear combinations of \(a\) and \(b\).
A formula \(F\) is satisfiable if it is true for at least one truth assignment of the involved propositional symbols.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A formula \(F\) is {{c1:: satisfiable}} if it {{c2:: is true for <strong>at least one</strong> truth assignment of the involved propositional symbols}}.
An \((n,k)\)-error-correcting code over the alphabet \(\mathcal{A}\) with \(|\mathcal{A}| = q\) is a subset of \(\mathcal{A}^n\) of cardinality \(q^k\).
An \((n,k)\)-error-correcting code over the alphabet \(\mathcal{A}\) with \(|\mathcal{A}| = q\) is a subset of \(\mathcal{A}^n\) of cardinality \(q^k\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>An \((n,k)\)-error-correcting code over the alphabet \(\mathcal{A}\) with \(|\mathcal{A}| = q\) is a subset of \(\mathcal{A}^n\) of cardinality {{c1::\(q^k\)}}.</p>
How does satisfiability differ between propositional logic and predicate logic?
Propositional Logic: About truth assignments to symbols
Predicate Logic: About interpretations (universe, predicates, and constants)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does satisfiability differ between propositional logic and predicate logic?
Back
<ul>
<li><strong>Propositional Logic</strong>: About truth assignments to symbols</li>
<li><strong>Predicate Logic</strong>: About interpretations (universe, predicates, and constants)</li>
</ul>
Lemma 5.28: Polynomial evaluation is compatible with the ring operations:
- If \(c(x) = a(x) + b(x)\) then \(c(\alpha) = a(\alpha) + b(\alpha)\) for any \(\alpha\)
- If \(c(x) = a(x) \cdot b(x)\) then \(c(\alpha) = a(\alpha) \cdot b(\alpha)\) for any \(\alpha\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What does polynomial evaluation preserve?</p>
Back
<p><strong>Lemma 5.28</strong>: Polynomial evaluation is compatible with the ring operations:<br>
- If \(c(x) = a(x) + b(x)\) then \(c(\alpha) = a(\alpha) + b(\alpha)\) for any \(\alpha\)<br>
- If \(c(x) = a(x) \cdot b(x)\) then \(c(\alpha) = a(\alpha) \cdot b(\alpha)\) for any \(\alpha\)</p>
Show that if \(a \not= b\) then under that assumption, if \(f(a) = f(b)\) we get a contradiction as this implies \(a = b\).
Example: \(f(x) = 2x\), then if \(a \not = b\) then if \(f(a) = f(b) \ \implies \ 2a = 2b\). This however \( \ \implies a = b\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do I show the injectivity of a function?
Back
Show that if \(a \not= b\) then under that assumption, if \(f(a) = f(b)\) we get a contradiction as this implies \(a = b\).<br><br><b>Example: </b>\(f(x) = 2x\), then if \(a \not = b\) then if \(f(a) = f(b) \ \implies \ 2a = 2b\). This however \( \ \implies a = b\).
State the Chinese Remainder Theorem (Theorem 4.19).
Let \(m_1, m_2, \dots, m_r\) be pairwise relatively prime integers and let \(M = \prod_{i=1}^{r} m_i\). For every list \(a_1, \dots, a_r\) with \(0 \leq a_i < m_i\), the system
\[\begin{align} x &\equiv_{m_1} a_1 \\ x &\equiv_{m_2} a_2 \\ &\vdots \\ x &\equiv_{m_r} a_r \end{align}\]
has a unique solution \(x\) satisfying \(0 \leq x < M\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
State the Chinese Remainder Theorem (Theorem 4.19).
Back
Let \(m_1, m_2, \dots, m_r\) be <strong>pairwise relatively prime</strong> integers and let \(M = \prod_{i=1}^{r} m_i\). For every list \(a_1, \dots, a_r\) with \(0 \leq a_i < m_i\), the system
\[\begin{align} x &\equiv_{m_1} a_1 \\ x &\equiv_{m_2} a_2 \\ &\vdots \\ x &\equiv_{m_r} a_r \end{align}\]
has a <strong>unique solution</strong> \(x\) satisfying \(0 \leq x < M\).
Is the "dominates" relation (\(\preceq\)) transitive?
Yes: \(A \preceq B \land B \preceq C \Rightarrow A \preceq C\)
(If \(A\) injects into \(B\) and \(B\) injects into \(C\), then \(A\) injects into \(C\))
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Is the "dominates" relation (\(\preceq\)) transitive?
Back
Yes: \(A \preceq B \land B \preceq C \Rightarrow A \preceq C\)
<br>
(If \(A\) injects into \(B\) and \(B\) injects into \(C\), then \(A\) injects into \(C\))
Why do we need \(\mathbb{Z}_m^*\) for multiplication, rather than just using \(\mathbb{Z}_m\)?
\(\mathbb{Z}_m\) (with \(\oplus\)) is not a group with respect to multiplication modulo \(m\) because elements that are not coprime to \(m\) don't have a multiplicative inverse.
For example, in \(\mathbb{Z}_6\), the element \(2\) has no multiplicative inverse because \(\gcd(2, 6) = 2 \neq 1\).
Thus we need \(\mathbb{Z}_m^*\) (elements coprime to \(m\)) to form a group with \(\odot\) (multiplication mod \(\oplus\)0).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Why do we need \(\mathbb{Z}_m^*\) for multiplication, rather than just using \(\mathbb{Z}_m\)?</p>
Back
<p>\(\mathbb{Z}_m\) (with \(\oplus\)) is <strong>not a group</strong> with respect to multiplication modulo \(m\) because elements that are <strong>not coprime</strong> to \(m\) don't have a <strong>multiplicative inverse</strong>.</p>
<p>For example, in \(\mathbb{Z}_6\), the element \(2\) has no multiplicative inverse because \(\gcd(2, 6) = 2 \neq 1\).</p>
<p>Thus we need \(\mathbb{Z}_m^*\) (elements coprime to \(m\)) to form a group with \(\odot\) (multiplication mod \(\oplus\)0).</p>
If two sets each dominate the other, what can we conclude?
For sets \(A\) and \(B\):
\[A \preceq B \land B \preceq A \quad \Rightarrow \quad A \sim B\]
If there's an injection \(f: A \to B\) and an injection \(g: B \to A\), then there's a bijection between \(A\) and \(B\).
Bernstein-Schröder Theorem
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
If two sets each dominate the other, what can we conclude?
Back
For sets \(A\) and \(B\):
\[A \preceq B \land B \preceq A \quad \Rightarrow \quad A \sim B\]
If there's an injection \(f: A \to B\) and an injection \(g: B \to A\), then there's a bijection between \(A\) and \(B\).<div><br></div><div>Bernstein-Schröder Theorem</div>
The monic polynomial \(g(x)\) of largest degree such that \(g(x) \ | \ a(x)\) and \(g(x) \ | \ b(x)\) is called the greatest common divisor of \(a(x)\) and \(b(x)\), denoted \(\gcd(a(x), b(x))\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is the GCD in a polynomial Field</p>
Back
<p>The <em>monic</em> polynomial \(g(x)\) of <em>largest degree</em> such that \(g(x) \ | \ a(x)\) and \(g(x) \ | \ b(x)\) is called the <em>greatest common divisor</em> of \(a(x)\) and \(b(x)\), denoted \(\gcd(a(x), b(x))\).</p>
A relation ρ on a set A is called reflexive if {{c2::\( a \ \rho \ a\) is true for all \( a \in A\), i.e. if \( \text{id} \subseteq \rho\).}}
Example: \( \ge, \le \) are reflexive, while \( <, > \) are not.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A relation ρ on a set A is called {{c1::reflexive}} if {{c2::\( a \ \rho \ a\) is true for all \( a \in A\), i.e. if \( \text{id} \subseteq \rho\).}}
Extra
Example: \( \ge, \le \) are reflexive, while \( <, > \) are not.
A proof system is complete if every true statement has a proof: \(\phi(s, p) = 1 \Longleftarrow \tau(s) = 1\).
Note that the use of \(\Longleftarrow\) is not the correct formalism. For all \(s \in \mathcal{S}\) with \(\tau(s) = 1\) there exists a \(p \in \mathcal{P}\) such that \(\phi(s, p) = 1\), is the correct formal definition.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A proof system is {{c2:: <b>complete</b>}} if {{c1:: every true statement has a proof: \(\phi(s, p) = 1 \Longleftarrow \tau(s) = 1\)}}.
Extra
<i>Note that the use of </i> \(\Longleftarrow\) <i>is not the correct formalism.</i><br>For all \(s \in \mathcal{S}\) with \(\tau(s) = 1\) there exists a \(p \in \mathcal{P}\) such that \(\phi(s, p) = 1\), is the correct formal definition.
Give the formal definition of a prime number \(p\).
\[p \ \text{prime} \overset{\text{def}}{\Longleftrightarrow} p > 1 \land \forall d \ ((d > 1) \land (d | p) \rightarrow d = p)\]
A prime is greater than 1 and its only positive divisors are 1 and itself.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of a prime number \(p\).
Back
\[p \ \text{prime} \overset{\text{def}}{\Longleftrightarrow} p > 1 \land \forall d \ ((d > 1) \land (d | p) \rightarrow d = p)\]
A prime is greater than 1 and its only positive divisors are 1 and itself.
State Corollary 5.10 about raising elements to the power of the group order.
Corollary 5.10: Let \(G\) be a finite group. Then \(a^{|G|} = e\) for every \(a \in G\).
Proof: By Corollary 5.9, \(|G| = k \cdot \text{ord}(a)\) for some \(k\). Thus: \[a^{|G|} = a^{k \cdot \text{ord}(a)} = (a^{\text{ord}(a)})^k = e^k = e\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Corollary 5.10 about raising elements to the power of the group order.</p>
Back
<p><strong>Corollary 5.10</strong>: Let \(G\) be a finite group. Then \(a^{|G|} = e\) for every \(a \in G\).</p>
<p><strong>Proof</strong>: By Corollary 5.9, \(|G| = k \cdot \text{ord}(a)\) for some \(k\). Thus: \[a^{|G|} = a^{k \cdot \text{ord}(a)} = (a^{\text{ord}(a)})^k = e^k = e\]</p>
How does the inverse of a composition of relations behave?
Let \(\rho: A \to B\) and \(\sigma: B \to C\). Then:
\[\widehat{\rho \sigma} = \hat{\sigma}\hat{\rho}\]
(The inverse of a composition reverses the order)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does the inverse of a composition of relations behave?
Back
Let \(\rho: A \to B\) and \(\sigma: B \to C\). Then:
\[\widehat{\rho \sigma} = \hat{\sigma}\hat{\rho}\]
(The inverse of a composition reverses the order)
There are uncomputable functions \(\mathbb{N} \to \{0, 1\}\) because {{c1::the set of functions \(\mathbb{N} \to \{0, 1\}\) is uncountable (Cantor's diagonalization argument), but the set of programs \(\{0, 1\}^*\) computing them is countable.}}
There are uncomputable functions \(\mathbb{N} \to \{0, 1\}\) because {{c1::the set of functions \(\mathbb{N} \to \{0, 1\}\) is uncountable (Cantor's diagonalization argument), but the set of programs \(\{0, 1\}^*\) computing them is countable.}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
There are <i>uncomputable functions</i> \(\mathbb{N} \to \{0, 1\}\) because {{c1::the set of functions \(\mathbb{N} \to \{0, 1\}\) is uncountable (<i>Cantor's diagonalization argument</i>), but the set of programs \(\{0, 1\}^*\) computing them is countable.}}
For what \(m\) is \(\mathbb{Z}^*_m\) cyclic? (Theorem 5.15)
The group ℤ*_m is cyclic if and only if: • \(m = 2\) • \(m = 4\) • \(m = p^e\) (where p is an odd prime and \(e ≥ 1\)) • \(m = 2p^e\) (where p is an odd prime and \(e ≥ 1\)) Example: Is \(\mathbb{Z}^*_{19}\) cyclic? What is a generator? Yes, \(\mathbb{Z}^*_{19}\) is cyclic (since \(19\) is an odd prime).
For what \(m\) is \(\mathbb{Z}^*_m\) cyclic? (Theorem 5.15)
Back
The group ℤ*_m is cyclic if and only if:<br>• \(m = 2\)<br>• \(m = 4\)<br>• \(m = p^e\) (where p is an odd prime and \(e ≥ 1\))<br>• \(m = 2p^e\) (where p is an odd prime and \(e ≥ 1\)) Example: Is \(\mathbb{Z}^*_{19}\) cyclic? What is a generator? Yes, \(\mathbb{Z}^*_{19}\) is cyclic (since \(19\) is an odd prime).<br><br>2 is a generator.<br><br>Powers of 2: 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10, 1<br><br>Other generators: 3, 10, 13, 14, 15
An element \(a\ne0\) of a commutative ring \(R\) is called a zerodivisor if \(ab=0\) for some \(b\ne0\) in \(R\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An element \(a\ne0\) of a commutative ring \(R\) is called a <i>zerodivisor</i> if {{c1:: \(ab=0\) for some \(b\ne0\) in \(R\)}}.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \ldots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \cdots \times G_n; \star\rangle\). The operation \(\star\) is component-wise.
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \ldots, \langle G_n; *_n \rangle\) is the algebra \(\langle G_1 \times \cdots \times G_n; \star\rangle\). The operation \(\star\) is component-wise.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The direct product of \(n\) groups \(\langle G_1; *_1 \rangle, \ldots, \langle G_n; *_n \rangle\) is {{c1::the algebra \(\langle G_1 \times \cdots \times G_n; \star\rangle\)}}. The operation \(\star\) is component-wise.
Why does \(ax \equiv_m 1\) have no solution when \(\text{gcd}(a, m) = d > 1\)?
We can rewrite \(ax \equiv_m 1\) as \(ax - 1 = km \Leftrightarrow ax - km = 1\). Now since, \(d | a\) and \(d | m\), then \(d | ax\) and \(d | km\) for any \(x\). Thus \(d | (ax - km)\), and \(ax - km = 1\).
But \(d \nmid 1 \implies d \nmid (ax - km)\), which is a contradiction. Thus \(ax\) can never be congruent to \(1\) modulo \(m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does \(ax \equiv_m 1\) have no solution when \(\text{gcd}(a, m) = d > 1\)?
Back
We can rewrite \(ax \equiv_m 1\) as \(ax - 1 = km \Leftrightarrow ax - km = 1\). Now since, \(d | a\) and \(d | m\), then \(d | ax\) and \(d | km\) for any \(x\).<br>Thus \(d | (ax - km)\), and \(ax - km = 1\).<br><br>But \(d \nmid 1 \implies d \nmid (ax - km)\), which is a contradiction. Thus \(ax\) can never be congruent to \(1\) modulo \(m\).
A code \(\mathcal{C}\) with minimum distance \(d\) is \(t\)-error correcting if and only if:
\(d \geq 2t + 1\).
Intuition: To correct \(t\) errors, codewords must be at least \(2t + 1\) apart (so that even with \(t\) errors, the received word is closer to the correct codeword than to any other).
If they were only \(2t\) apart for each codeword, then there would be a tie.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>A code \(\mathcal{C}\) with minimum distance \(d\) is \(t\)-error correcting if and only if:</p>
Back
<p>\(d \geq 2t + 1\).</p>
<p><strong>Intuition</strong>: To correct \(t\) errors, codewords must be at least \(2t + 1\) apart (so that even with \(t\) errors, the received word is closer to the correct codeword than to any other).</p>
<p>If they were only \(2t\) apart for each codeword, then there would be a <strong>tie</strong>.</p>
We can reduce the exponent \(a^m\) modulo \(n\) by {{c1::the \(\text{ord}(a)\)}} iff. \(\gcd(a, n) = 1\), i.e. \(a\) and \(n\) are coprime.
This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We can reduce the exponent \(a^m\) modulo \(n\) by {{c1::the \(\text{ord}(a)\)}} iff. {{c2::\(\gcd(a, n) = 1\), i.e. \(a\) and \(n\) are coprime}}.
Extra
This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\).
Lemma 5.6: In a finite group \(G\), every element has a finite order.
(This doesn't hold for infinite groups - elements can have infinite order.)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is the order of elements in finite groups.</p>
Back
<p><strong>Lemma 5.6</strong>: In a <strong>finite group</strong> \(G\), every element has a <strong>finite order</strong>.</p>
<p>(This doesn't hold for infinite groups - elements can have infinite order.)</p>
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) (also called Euler's totient function) is defined as {{c1::the cardinality of \(\mathbb{Z}^*_m\).}}
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) (also called Euler's totient function) is defined as {{c1::the cardinality of \(\mathbb{Z}^*_m\).}}
Example: \(\mathbb{Z}_{18}^* = \{1,5,7,11,13,17\}\), so \(\varphi(18) = 6\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) (also called Euler's totient function) is defined as {{c1::the cardinality of \(\mathbb{Z}^*_m\).}}
Why is closure important when verifying that \(H\) is a subgroup of \(G\)?
Closure ensures that when you apply operations within \(H\), you stay within \(H\).
Without closure:
- \(a * b\) might not be in \(H\) (operation closure)
- \(\widehat{a}\) might not be in \(H\) (inverse closure)
- The neutral element \(e\) might not be in \(H\)
If \(H\) lacks closure, it cannot form a group on its own.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Why is closure important when verifying that \(H\) is a subgroup of \(G\)?</p>
Back
<p>Closure ensures that when you apply operations within \(H\), you <strong>stay within</strong> \(H\).</p>
<p>Without closure:<br>
- \(a * b\) might not be in \(H\) (operation closure)<br>
- \(\widehat{a}\) might not be in \(H\) (inverse closure)<br>
- The neutral element \(e\) might not be in \(H\)</p>
<p>If \(H\) lacks closure, it cannot form a group on its own.</p>
The transitive closure of a relation \(\rho\) on a set \(A\), denoted \(\rho^*\), is defined as {{c1::\(\rho^* = \bigcup_{n\in\mathbb{N}\setminus \{0\} } \rho^n\)}}.
The transitive closure of a relation \(\rho\) on a set \(A\), denoted \(\rho^*\), is defined as {{c1::\(\rho^* = \bigcup_{n\in\mathbb{N}\setminus \{0\} } \rho^n\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <b>transitive closure </b>of a relation \(\rho\) on a set \(A\), denoted \(\rho^*\), is defined as {{c1::\(\rho^* = \bigcup_{n\in\mathbb{N}\setminus \{0\} } \rho^n\)}}.
The Fermat-Euler theorem states that for all \(m\ge 2\) and all \(a\) with \(\gcd(a,m) = 1\),{{c1:: \[a^{\varphi(m)} \equiv_m 1\]and so in particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \(a^{p-1} \equiv_p 1\).}}
The Fermat-Euler theorem states that for all \(m\ge 2\) and all \(a\) with \(\gcd(a,m) = 1\),{{c1:: \[a^{\varphi(m)} \equiv_m 1\]and so in particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \(a^{p-1} \equiv_p 1\).}}
This theorem is used for RSA.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The Fermat-Euler theorem states that for all \(m\ge 2\) and all \(a\) with \(\gcd(a,m) = 1\),{{c1:: \[a^{\varphi(m)} \equiv_m 1\]and so in particular, for every prime \(p\) and every \(a\) not divisible by \(p\): \(a^{p-1} \equiv_p 1\).}}
A function \(f: A\to B\) from a domain \(A\) to a codomain \(B\) is a relation from \(A\) to \(B\) with the special properties: {{c1::1. (totally defined) \(\forall a\in A \; \exists b \in B \quad a \mathop{f} b\) 2. (well-defined) \(\forall a\in A \; \forall b, b' \in B \quad (a \mathop{f} b \land a\mathop{f}b' \to b = b')\)}}
A function \(f: A\to B\) from a domain \(A\) to a codomain \(B\) is a relation from \(A\) to \(B\) with the special properties: {{c1::1. (totally defined) \(\forall a\in A \; \exists b \in B \quad a \mathop{f} b\) 2. (well-defined) \(\forall a\in A \; \forall b, b' \in B \quad (a \mathop{f} b \land a\mathop{f}b' \to b = b')\)}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <b>function</b> \(f: A\to B\) from a <i>domain</i> \(A\) to a <i>codomain</i> \(B\) is {{c1::a relation from \(A\) to \(B\)}} with the special properties:<br>{{c1::1. (totally defined) \(\forall a\in A \; \exists b \in B \quad a \mathop{f} b\)<br>2. (well-defined) \(\forall a\in A \; \forall b, b' \in B \quad (a \mathop{f} b \land a\mathop{f}b' \to b = b')\)}}
How do polynomials behave under modular reduction? (Corollary 4.15)
Let \(f(x_1, \dots, x_k)\) be a polynomial with integer coefficients, and let \(m \geq 1\). If \(a_i \equiv_m b_i\) for \(1 \leq i \leq k\), then:
\[f(a_1, \dots, a_k) \equiv_m f(b_1, \dots, b_k)\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do polynomials behave under modular reduction? (Corollary 4.15)
Back
Let \(f(x_1, \dots, x_k)\) be a polynomial with integer coefficients, and let \(m \geq 1\). If \(a_i \equiv_m b_i\) for \(1 \leq i \leq k\), then:
\[f(a_1, \dots, a_k) \equiv_m f(b_1, \dots, b_k)\]
The Hasse diagram of a poset \((A; \preceq)\) is the directed graph whose vertices are the elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).
The Hasse diagram of a poset \((A; \preceq)\) is the directed graph whose vertices are the elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <i>Hasse diagram</i> of a poset \((A; \preceq)\) is {{c1::the directed graph whose vertices are the elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).}}
Special case of constructive existence proofs. By finding a counter example \( x\) such that \(S_x\) is not true, we can prove that \( S_i \) isn't always true.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Proof method: Proofs by counterexample
Back
Special case of constructive existence proofs. By finding a counter example \( x\) such that \(S_x\) is not true, we can prove that \( S_i \) isn't always true.
Theorem 5.13: \(\langle \mathbb{Z}_m^*; \odot, \text{ }^{-1}, 1 \rangle\) is a group.
Proof idea: For \(a, b \in \mathbb{Z}_m^*\), if \(\gcd(a, m) = 1\) and \(\gcd(b, m) = 1\), then \(\gcd(ab, m) = 1\). Thus the group is closed under multiplication.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Is \(\mathbb{Z}_m^*\) a group?.</p>
Back
<p><strong>Theorem 5.13</strong>: \(\langle \mathbb{Z}_m^*; \odot, \text{ }^{-1}, 1 \rangle\) is a <strong>group</strong>.</p>
<p><strong>Proof idea</strong>: For \(a, b \in \mathbb{Z}_m^*\), if \(\gcd(a, m) = 1\) and \(\gcd(b, m) = 1\), then \(\gcd(ab, m) = 1\). Thus the group is closed under multiplication.</p>
Basically, show for all cases that they are correct.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Proof method: "Case Distinction"
Back
1. Find a finite list \( R_1, \ldots, R_k\) of statements (cases)<div>2. Prove that one case applies for the situation (prove one \(R_i\))</div><div>3. Prove \( R_i \implies S\) for \(i = 1, \ldots, k\)</div><div><br></div><div>Basically, show for all cases that they are correct.</div>
The group \(\mathbb{Z}^*_m\) contains all numbers \(a \in \mathbb{Z}_m\) that are coprime to \(m\), that is, \(\gcd(a,m) = 1\).
As they are coprime, they are invertible. Thus its the set of units.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The group \(\mathbb{Z}^*_m\) contains all numbers \(a \in \mathbb{Z}_m\) that are {{c1::coprime to \(m\), that is, \(\gcd(a,m) = 1\).}}
Extra
As they are coprime, they are invertible. Thus its the set of units.
When is writing \(\top\) or \(\perp\) allowed in formulas (proof steps for example)?
We are not allowed to use \(\top\) or \(\perp\) in formulas, to replace statement that are true or false under our interpretation.
It's only allowed when the formula is actually a tautology (or unsatisfiable), i.e. true or false under all interpretations!
For example, in \(U = \mathbb{N}\), \(x \geq 0 \land x = 5 \implies \top \land x = 5 \implies x = 5\) but this is wrong as \(x \geq 0\) is only equivalent to \(\top\) in this specific universe. We instead can just write the implication directly.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
When is writing \(\top\) or \(\perp\) allowed in formulas (proof steps for example)?
Back
We are not allowed to use \(\top\) or \(\perp\) in formulas, to replace statement that are <b>true</b> or <b>false</b> under our interpretation.<br><br>It's only allowed when the formula is actually a tautology (or unsatisfiable), i.e. true or false under <b>all</b> interpretations!<br><br>For example, in \(U = \mathbb{N}\), \(x \geq 0 \land x = 5 \implies \top \land x = 5 \implies x = 5\) but this is wrong as \(x \geq 0\) is only equivalent to \(\top\) in this specific universe. We instead can just write the implication directly.
When is a decoding function \(t\)-error correcting?
A decoding function \(D\) is \(t\)-error-correcting for encoding function \(E\) if for any \((a_0, \dots, a_{k-1})\): \[D((r_0, \dots, r_{n-1})) = (a_0, \dots, a_{k-1})\] for any \((r_0, \dots, r_{n-1})\) with Hamming distance at most \(t\) from \(E((a_0, \dots, a_{k-1}))\).
In other words, every codeword with a maximum of \(t\) errors, is correctly decoded.
A code is \(t\)-error-correcting if there exists \(E\) and \(D\) with \(C = Im(D)\) where \(D\) is \(t\)-error-correcting.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>When is a decoding function \(t\)-error correcting?</p>
Back
<p>A decoding function \(D\) is \(t\)-error-correcting for encoding function \(E\) if for any \((a_0, \dots, a_{k-1})\): \[D((r_0, \dots, r_{n-1})) = (a_0, \dots, a_{k-1})\] for any \((r_0, \dots, r_{n-1})\) with Hamming distance at most \(t\) from \(E((a_0, \dots, a_{k-1}))\).</p>
<p><em>In other words</em>, every codeword with a maximum of \(t\) errors, is correctly decoded.</p>
<p>A code is \(t\)-error-correcting if there exists \(E\) and \(D\) with \(C = Im(D)\) where \(D\) is \(t\)-error-correcting.</p>
This holds because if \(a(x) = b(x) \cdot c(x)\), then \(a(x) = vb(x) \cdot (v^{-1} c(x))\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>If \(b(x)\) divides \(a(x)\), then so does:</p>
Back
<p>\(v \cdot b(x)\) for any nonzero \(v \in F\).</p>
<p>This holds because if \(a(x) = b(x) \cdot c(x)\), then \(a(x) = vb(x) \cdot (v^{-1} c(x))\).</p>
What does "unique up to order" mean in the Fundamental Theorem of Arithmetic?
Every integer has exactly one prime factorization if we don't care about the order of factors. For example, \(12 = 2^2 \cdot 3 = 3 \cdot 2 \cdot 2 = 2 \cdot 3 \cdot 2\) are all the same factorization, just written differently.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does "unique up to order" mean in the Fundamental Theorem of Arithmetic?
Back
Every integer has exactly one prime factorization if we don't care about the order of factors. For example, \(12 = 2^2 \cdot 3 = 3 \cdot 2 \cdot 2 = 2 \cdot 3 \cdot 2\) are all the same factorization, just written differently.
What is the order of \(\text{ord}(a)\) for \(a \in G\) in a group?
Let \(G\) be a group and let \(a\) be an element of \(G\). The order of \(a\), denoted \(\text{ord}(a)\), is the least \(m \geq 1\) such that \(a^m = e\), if such an \(m\) exists: \[\text{ord}(a) = \min \{n \geq 1 \ | \ a^n = e\} \cup \{\infty\}\]
If no such \(m\) exists, \(\text{ord}(a)\) is said to be infinite, written \(\text{ord}(a) = \infty\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is the order of \(\text{ord}(a)\) for \(a \in G\) in a group?</p>
Back
<p>Let \(G\) be a group and let \(a\) be an element of \(G\). The order of \(a\), denoted \(\text{ord}(a)\), is the least \(m \geq 1\) such that \(a^m = e\), if such an \(m\) exists: \[\text{ord}(a) = \min \{n \geq 1 \ | \ a^n = e\} \cup \{\infty\}\]</p>
<p>If no such \(m\) exists, \(\text{ord}(a)\) is said to be infinite, written \(\text{ord}(a) = \infty\).</p>
State Corollary 5.11 about groups of prime order (what property, what does each element satisfy).
Corollary 5.11: Every group of prime order is cyclic, and in such a group every element except the neutral element is a generator.
Proof: Only \(1 | p\) and \(p | p\) for \(p\) prime. So for \(a \in G\), either \(\text{ord}(a) = 1\) (meaning \(a = e\)) or \(\text{ord}(a) = p\) (meaning \(a\) generates the whole group).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Corollary 5.11 about groups of prime order (what property, what does each element satisfy).</p>
Back
<p><strong>Corollary 5.11</strong>: Every group of <strong>prime order</strong> is cyclic, and in such a group <strong>every element except the neutral element is a generator</strong>.</p>
<p><strong>Proof</strong>: Only \(1 | p\) and \(p | p\) for \(p\) prime. So for \(a \in G\), either \(\text{ord}(a) = 1\) (meaning \(a = e\)) or \(\text{ord}(a) = p\) (meaning \(a\) generates the whole group).</p>
Does \( p | a \land q | a \land \gcd(p, q) = 1 \implies pq | a \) hold?
Yes, but this has to be reproven before using.
The proof technique is important. Replacing a neutral element by something it's equal is often a smart move. Proof: This is an important result for the exam:
\[p \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a\]
Which is the same as saying \(\exists k \in \mathbb{Z}\) such that \(a = pq \cdot k\).
Since \(p \mid a\) and \(q \mid a\), we have:
\[\exists k, k' \in \mathbb{Z} \text{ such that } a = pk \land a = qk'\]
Since \(\gcd(p, q) = 1\), by Bézout's identity:
\[\exists u, v \in \mathbb{Z} \text{ such that } 1 = pu + qv\]
Now we can write:
\[\begin{align}
a &= 1 \cdot a \\
&= a \cdot (pu + qv) \\
&= pua + qva \\
&= pu \cdot qk' + qv \cdot pk \\
&= pq(uk' + vk')
\end{align}\]
Thus \(pq \mid a\). \(\square\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Does \( p | a \land q | a \land \gcd(p, q) = 1 \implies pq | a \) hold?
Back
Yes, but this has to be reproven before using.<br><br>The proof technique is important. Replacing a neutral element by something it's equal is often a smart move.<br>
<b>Proof:</b> This is an important result for the exam:
<div>\[p \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a\]</div>
Which is the same as saying \(\exists k \in \mathbb{Z}\) such that \(a = pq \cdot k\).
<br>
Since \(p \mid a\) and \(q \mid a\), we have:
<div>\[\exists k, k' \in \mathbb{Z} \text{ such that } a = pk \land a = qk'\]</div>
Since \(\gcd(p, q) = 1\), by Bézout's identity:
<div>\[\exists u, v \in \mathbb{Z} \text{ such that } 1 = pu + qv\]</div>
Now we can write:
<div>\[\begin{align}
a &= 1 \cdot a \\
&= a \cdot (pu + qv) \\
&= pua + qva \\
&= pu \cdot qk' + qv \cdot pk \\
&= pq(uk' + vk')
\end{align}\]</div>
Thus \(pq \mid a\). \(\square\)
When does an element of \(F[x]_{m(x)}\) have an inverse?
Lemma 5.36: The congruence equation \[a(x)b(x) \equiv_{m(x)} 1\] for a given \(a(x)\) has a solution \(b(x) \in F[x]_{m(x)}\) if and only if \(\gcd(a(x), m(x)) = 1\). The solution is unique.
In other words: \[ F[x]_{m(x)}^* = \{a(x) \in F[x]_{m(x)} \ | \ \gcd(a(x), m(x)) = 1\} \]
This is analogous to \(\mathbb{Z}_m^*\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>When does an element of \(F[x]_{m(x)}\) have an inverse?</p>
Back
<p><strong>Lemma 5.36</strong>: The congruence equation \[a(x)b(x) \equiv_{m(x)} 1\] for a given \(a(x)\) has a solution \(b(x) \in F[x]_{m(x)}\) <strong>if and only if</strong> \(\gcd(a(x), m(x)) = 1\). The solution is <strong>unique</strong>.</p>
<p>In other words: \[ F[x]_{m(x)}^* = \{a(x) \in F[x]_{m(x)} \ | \ \gcd(a(x), m(x)) = 1\} \]</p>
<p>This is analogous to \(\mathbb{Z}_m^*\).</p>
In every connected graph \(G\), when executing Kruskal using Union-Find, the representative repr[u] changes \(O(\dots)\) times:
\(O(\log_2 |V|)\), as we always at least double the size of the representative (we merge smaller into bigger, and repr[u] changes if it's the smaller one).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
In every connected graph \(G\), when executing Kruskal using Union-Find, the representative <b>repr[u]</b> changes \(O(\dots)\) times:
Back
\(O(\log_2 |V|)\), as we always at least double the size of the representative (we merge smaller into bigger, and repr[u] changes if it's the smaller one).
The generators of \(\langle \mathbb{Z}_n; \oplus \rangle\) are all \(g \in \mathbb{Z}_n\) for which \(\gcd(g, n) = 1\)(i.e., \(g\) is coprime to \(n\)).
The generators of \(\langle \mathbb{Z}_n; \oplus \rangle\) are all \(g \in \mathbb{Z}_n\) for which \(\gcd(g, n) = 1\)(i.e., \(g\) is coprime to \(n\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The generators of \(\langle \mathbb{Z}_n; \oplus \rangle\) are all \(g \in \mathbb{Z}_n\) for which {{c1::\(\gcd(g, n) = 1\)(i.e., \(g\) is coprime to \(n\))}}.</p>
A formula of the form \[Q_1 x_1 \ Q_2 x_2 \ \dots \ Q_n x_n G\]where the \(Q_i\) are arbitrary quantifiers and \(G\) is a formula free of quantifiers.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<b>Prenex</b> form defintion:
Back
A formula of the form \[Q_1 x_1 \ Q_2 x_2 \ \dots \ Q_n x_n G\]where the \(Q_i\) are arbitrary quantifiers and \(G\) is a formula free of quantifiers.
Finding the \(e\)-th root is a hard problem (we have to try all possibilities) as long as we don't know the group order \(|G|\).
If we do, we can find d using the extended euclidean algorithm.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does RSA work, i.e. why can't we break it?
Back
Finding the \(e\)-th root is a hard problem (we have to try all possibilities) <b>as long as we don't know the group order </b>\(|G|\).<br><br>If we do, we can find d using the extended euclidean algorithm.
For any ring elements \(a\) and \(b\) in \(R\) (not both \(0\)), a ring element \(d\) is called a greatest common divisor of \(a\) and \(b\) if:
- \(d\) divides both \(a\) and \(a\)0
- Every common divisor of \(a\)1 and \(a\)2 divides \(a\)3
Formally: \[d \ | \ a \ \land \ d \ | \ b \ \land \ \forall c ((c \ | \ a \ \land \ c \ | \ b) \rightarrow c \ | \ d)\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>In a ring, \(d\) is a gcd of \(a\) and \(b\) if:</p>
Back
<p>For any ring elements \(a\) and \(b\) in \(R\) (not both \(0\)), a ring element \(d\) is called a greatest common divisor of \(a\) and \(b\) if:<br>
- \(d\) divides both \(a\) and \(a\)0<br>
- Every common divisor of \(a\)1 and \(a\)2 divides \(a\)3</p>
<p>Formally: \[d \ | \ a \ \land \ d \ | \ b \ \land \ \forall c ((c \ | \ a \ \land \ c \ | \ b) \rightarrow c \ | \ d)\]</p>
What is the multiplicative inverse of \(a\) modulo \(m\)?
The unique solution \(x \in \mathbb{Z}_m\) to the congruence equation \(ax \equiv_m 1\), where \(\text{gcd}(a, m) = 1\). Denoted \(a^{-1} \pmod{m}\) or \(1/a \pmod{m}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the multiplicative inverse of \(a\) modulo \(m\)?
Back
The unique solution \(x \in \mathbb{Z}_m\) to the congruence equation \(ax \equiv_m 1\), where \(\text{gcd}(a, m) = 1\). Denoted \(a^{-1} \pmod{m}\) or \(1/a \pmod{m}\).
A formula \(F\) is a tautology (or valid) if it is true for all truth assignments of the involved propositional symbols. Denoted as \(\models F\) or \(\top\).
A formula \(F\) is a tautology (or valid) if it is true for all truth assignments of the involved propositional symbols. Denoted as \(\models F\) or \(\top\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A formula \(F\) is a {{c1:: tautology (or valid)}} if it {{c2:: is true for <strong>all</strong> truth assignments of the involved propositional symbols}}. Denoted as {{c3:: \(\models F\) or \(\top\)}}.
The Cartesian product \(A \times B\) of sets \(A, B\) is {{c1::the set of all ordered pairs with the first component from \(A\) and the second component from \(B\): \(A\times B = \{(a,b)\mid a\in A \land b \in B\}\)}}.
The Cartesian product \(A \times B\) of sets \(A, B\) is {{c1::the set of all ordered pairs with the first component from \(A\) and the second component from \(B\): \(A\times B = \{(a,b)\mid a\in A \land b \in B\}\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <b>Cartesian product </b>\(A \times B\) of sets \(A, B\) is {{c1::the set of all ordered pairs with the first component from \(A\) and the second component from \(B\): \(A\times B = \{(a,b)\mid a\in A \land b \in B\}\)}}.
What is the relationship between \(\exists x (P(x) \land Q(x))\) and \(\exists x P(x) \land \exists x Q(x)\)?
\(\exists x (P(x) \land Q(x)) \models \exists x P(x) \land \exists x Q(x)\)
(Note: This is logical consequence, NOT equivalence. The reverse doesn't hold!)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the relationship between \(\exists x (P(x) \land Q(x))\) and \(\exists x P(x) \land \exists x Q(x)\)?
Back
\(\exists x (P(x) \land Q(x)) \models \exists x P(x) \land \exists x Q(x)\)
<br>
(Note: This is logical consequence, NOT equivalence. The reverse doesn't hold!)
A function \( f: A \rightarrow B\) is surjective (or onto) if \( \forall b \ \exists a \ , b = f(a)\), i.e. every value is taken
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A function \( f: A \rightarrow B\) is {{c1::surjective (or onto)}} if {{c2::\( \forall b \ \exists a \ , b = f(a)\), i.e. every value is taken}}
The order of an element \(a\) in a group (denoted \(\text{ord}(a)\)) is {{c1::the smallest \(m \ge 1\) such that \(a^m = e\). If such an \(m\) does not exist, \(\text{ord}(a) = \infty\)}}
The order of an element \(a\) in a group (denoted \(\text{ord}(a)\)) is {{c1::the smallest \(m \ge 1\) such that \(a^m = e\). If such an \(m\) does not exist, \(\text{ord}(a) = \infty\)}}
\(\text{ord}(e) = 1\) in any group
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The order of an element \(a\) in a group (denoted \(\text{ord}(a)\)) is {{c1::the smallest \(m \ge 1\) such that \(a^m = e\). If such an \(m\) does not exist, \(\text{ord}(a) = \infty\)}}
Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\).
Then \(a(x)\) is given by Lagrange's Interpolation formula: \[a(x) = \sum_{i=1}^{d+1} \beta_i u_i(x)\] where the polynomial \(u_i(x)\) is: \[u_i(x) = \frac{{{c2::(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}}}{{{c3::(\alpha_i - \alpha_1) \cdots (\alpha_i - \alpha_{i-1})(\alpha_i - \alpha_{i+1}) \cdots (\alpha_i - \alpha_{d+1})}}}\]
Note that for \(u_i(x)\) to be well-defined, all constant terms \(\alpha_i - \alpha_j\) in the denominator must be invertible. This is guaranteed in a field since \(a_i - a_j \neq 0\) for \(i \neq j\) (as they are all distinct).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Lagrange Interpolation for polynomials in a Field</p>
Back
<p>Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\).</p>
<p>Then \(a(x)\) is given by Lagrange's Interpolation formula: \[a(x) = \sum_{i=1}^{d+1} \beta_i u_i(x)\] where the polynomial \(u_i(x)\) is: \[u_i(x) = \frac{{{c2::(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}}}{{{c3::(\alpha_i - \alpha_1) \cdots (\alpha_i - \alpha_{i-1})(\alpha_i - \alpha_{i+1}) \cdots (\alpha_i - \alpha_{d+1})}}}\]</p>
<p>Note that for \(u_i(x)\) to be well-defined, all constant terms \(\alpha_i - \alpha_j\) in the denominator must be invertible. This is guaranteed in a field since \(a_i - a_j \neq 0\) for \(i \neq j\) (as they are all distinct).</p>
Since \((2^3)^2 \neq 2^{(3^2)}\), exponentiation is not associative.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of a binary operation that is <strong>not</strong> associative and demonstrate why.</p>
Back
<p><strong>Exponentiation</strong> on the integers is not associative.</p>
<p><strong>Example</strong>:<br>
- \((2^3)^2 = 8^2 = 64\)<br>
- \(2^{(3^2)} = 2^9 = 512\)</p>
<p>Since \((2^3)^2 \neq 2^{(3^2)}\), exponentiation is not associative.</p>
Theorem 5.8 (Lagrange's Theorem): Let \(G\) be a finite group and let \(H\) be a subgroup of \(G\). Then the order of \(H\) divides the order of \(G\), i.e., \(|H|\) divides \(|G|\).
Written: \(|H| \ | \ |G|\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Lagrange's Theorem (Theorem 5.8).</p>
Back
<p><strong>Theorem 5.8 (Lagrange's Theorem)</strong>: Let \(G\) be a finite group and let \(H\) be a subgroup of \(G\). Then the order of \(H\) <strong>divides</strong> the order of \(G\), i.e., \(|H|\) divides \(|G|\).</p>
<p>Written: \(|H| \ | \ |G|\)</p>
What important property do ideals in \(\mathbb{Z}\) have? (Lemma 4.3)
For \(a, b \in \mathbb{Z}\), there exists \(d \in \mathbb{Z}\) such that \((a, b) = (d)\).
Every ideal can be generated by a single integer.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What important property do ideals in \(\mathbb{Z}\) have? (Lemma 4.3)
Back
For \(a, b \in \mathbb{Z}\), there exists \(d \in \mathbb{Z}\) such that \((a, b) = (d)\).
<br>
<strong>Every ideal</strong> can be generated by a <strong>single integer</strong>.
How does \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) relate to equivalence classes of modulo?
\(\mathbb{Z}_m\) is the set of canonical representatives from \(\mathbb{Z} / \equiv_m\). Each element of \(\mathbb{Z}_m\) represents one of the \(m\) equivalence classes of integers congruent modulo \(m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does \(\mathbb{Z}_m = \{0, 1, \dots, m-1\}\) relate to equivalence classes of modulo?
Back
\(\mathbb{Z}_m\) is the set of <strong>canonical representatives</strong> from \(\mathbb{Z} / \equiv_m\). Each element of \(\mathbb{Z}_m\) represents one of the \(m\) equivalence classes of integers congruent modulo \(m\).
Lemma 5.5(i): A group homomorphism \(\psi: G \rightarrow H\) maps the neutral element to the neutral element: \(\psi(e) = e'\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p><strong>Lemma 5.5(i)</strong>: A group homomorphism \(\psi: G \rightarrow H\) maps the neutral element to {{c1::the neutral element: \(\psi(e) = e'\)}}.</p>
The Hamming distance between two strings of equal length over a finite alphabet \(\mathcal{A}\) is the number of positions at which the two strings differ.
The Hamming distance between two strings of equal length over a finite alphabet \(\mathcal{A}\) is the number of positions at which the two strings differ.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::Hamming distance}} between two strings of equal length over a finite alphabet \(\mathcal{A}\) is the {{c2::number of positions at which the two strings differ}}.</p>
Indirect proof of \( S \implies T \): Assume T is false, prove that S is false.
Follows from \( (\neg B \to \neg A) \models (A \to B) \)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<i>Proof method:</i> "Indirect Proof of an Implication"
Back
Indirect proof of \( S \implies T \): Assume T is false, prove that S is false.<div><br></div><div>Follows from \( (\neg B \to \neg A) \models (A \to B) \)</div>
Why is Bézout's identity useful for finding modular inverses?
If \(\text{gcd}(a, m) = 1\), then \(ua + vm = 1\) for some \(u, v\). This means \(ua = 1 - vm\), so \(ua \equiv_m 1\), making \(u\) the multiplicative inverse of \(a\) modulo \(m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why is Bézout's identity useful for finding modular inverses?
Back
If \(\text{gcd}(a, m) = 1\), then \(ua + vm = 1\) for some \(u, v\). This means \(ua = 1 - vm\), so \(ua \equiv_m 1\), making \(u\) the multiplicative inverse of \(a\) modulo \(m\).
State Theorem 5.37 about when \(F[x]_{m(x)}\) is a field.
Theorem 5.37: The ring \(F[x]_{m(x)}\) is a field if and only if \(m(x)\) is irreducible.
Explanation: If \(m(x)\) is irreducible, then \(\gcd(a(x), m(x)) = 1\) for all non-zero \(a(x)\) in \(F[x]_{m(x)}\), so all elements (except \(0\)) are units.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Theorem 5.37 about when \(F[x]_{m(x)}\) is a field.</p>
Back
<p><strong>Theorem 5.37</strong>: The ring \(F[x]_{m(x)}\) is a field <strong>if and only if</strong> \(m(x)\) is <strong>irreducible</strong>.</p>
<p><strong>Explanation</strong>: If \(m(x)\) is irreducible, then \(\gcd(a(x), m(x)) = 1\) for all non-zero \(a(x)\) in \(F[x]_{m(x)}\), so all elements (except \(0\)) are units.</p>
Every statement \(s \in \mathcal{S}\) is either true or false as assigned by the {{c2:: truth function \(\tau : \mathcal{S} \rightarrow \{0,1\}\) which assigns to each statement it's truth value}}.
Every statement \(s \in \mathcal{S}\) is either true or false as assigned by the {{c2:: truth function \(\tau : \mathcal{S} \rightarrow \{0,1\}\) which assigns to each statement it's truth value}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Every statement \(s \in \mathcal{S}\) is {{c1:: either true or false}} as assigned by the {{c2:: truth function \(\tau : \mathcal{S} \rightarrow \{0,1\}\) which assigns to each statement it's <b>truth value</b>}}.
\(A\) is countable if and only if \(A \sim \mathbb{N}\) or \(A \sim \mathbf{n}\) for some \(n \in \mathbb{N}\) (i.e., \(A\) is finite or equinumerous with \(\mathbb{N}\)).
Conclusion: No cardinality level exists between finite and countably infinite.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What are the two types of countable sets?
Back
\(A\) is countable <strong>if and only if</strong> \(A \sim \mathbb{N}\) or \(A \sim \mathbf{n}\) for some \(n \in \mathbb{N}\) (i.e., \(A\) is finite or equinumerous with \(\mathbb{N}\)).
<br>
<strong>Conclusion</strong>: No cardinality level exists between finite and countably infinite.
If \(uv = vu = 1\) for some \(v \in R\) (we write \(v = u^{-1}\)), then \(u\) is a?
Unit.
Example The units of \(\mathbb{Z}\) are \(-1\) and \(1\). Therefore \(\mathbb{Z}^* = \{-1, 1\}\). In contrast, \(\mathbb{R}^* = \mathbb{R} \backslash \{0\}\), as we can divide any two numbers.
The set of units of \(R\) is denoted by \(R^*\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>If \(uv = vu = 1\) for some \(v \in R\) (we write \(v = u^{-1}\)), then \(u\) is a?</p>
Back
<p>Unit.</p>
<p><strong>Example</strong> The units of \(\mathbb{Z}\) are \(-1\) and \(1\). Therefore \(\mathbb{Z}^* = \{-1, 1\}\). In contrast, \(\mathbb{R}^* = \mathbb{R} \backslash \{0\}\), as we can divide any two numbers.</p>
<p>The set of units of \(R\) is denoted by \(R^*\).</p>
What are the two key properties of the remainder function \(R_m\)? (Lemma 4.16)
(i) \(a \equiv_m R_m(a)\) (the remainder represents the equivalence class) (ii) \(a \equiv_m b \Longleftrightarrow R_m(a) = R_m(b)\) (congruence iff same remainder)
What are the two key properties of the remainder function \(R_m\)? (Lemma 4.16)
(i) \(a \equiv_m R_m(a)\) (the remainder represents the equivalence class) (ii) \(a \equiv_m b \Longleftrightarrow R_m(a) = R_m(b)\) (congruence iff same remainder)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What are the two key properties of the remainder function \(R_m\)? (Lemma 4.16)<br><br><strong>(i)</strong> {{c1:: \(a \equiv_m R_m(a)\) (the remainder represents the equivalence class)}}<br><b>(ii)</b> {{c2:: \(a \equiv_m b \Longleftrightarrow R_m(a) = R_m(b)\) (congruence iff same remainder)}}
The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the minimum of the Hamming distance between any two codewords.
The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the minimum of the Hamming distance between any two codewords.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the {{c3::minimum of the Hamming distance}} between any two codewords.</p>
What is the greatest lower bound (glb) of a subset \(S\) in a poset?
The greatest element (by the relation, not just integer ordering) of the set of all lower bounds of \(S\). Also called the infimum.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the greatest lower bound (glb) of a subset \(S\) in a poset?
Back
The <strong>greatest element</strong> (by the relation, not just integer ordering) of the set of all lower bounds of \(S\). Also called the <strong>infimum</strong>.
When does an irreducible polynomial exist in \(\text{GF}(p)[x]\)?
For every prime \(p\) and every \(d > 1\), there exists an irreducible polynomial of degree \(d\) in \(\text{GF}(p)[x]\).
In particular, there exists a finite field with \(p^d\) elements.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>When does an irreducible polynomial exist in \(\text{GF}(p)[x]\)?</p>
Back
<p>For every prime \(p\) and every \(d > 1\), there exists an <strong>irreducible polynomial</strong> of degree \(d\) in \(\text{GF}(p)[x]\).</p>
<p>In particular, there exists a <strong>finite field</strong> with \(p^d\) elements.</p>
A group \(\langle G; * \rangle\) (or monoid) is called commutative or abelian if \(a * b = b * a\) for all \(a, b \in G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>A group \(\langle G; * \rangle\) (or monoid) is called {{c1::commutative}} or {{c1::abelian}} if {{c2::\(a * b = b * a\)}} for all \({{c3::a, b}} \in G\).</p>
For two groups \(\langle G; *, \widehat{\ \ }, e \rangle\) and \(\langle H; \star, \tilde{\ \ }, e' \rangle\), a function \(\psi: G \rightarrow H\) is called a group homomorphism if for all \(a\) and \(b\): \[.
This means the operation can be applied before or after the function with the same result.
For two groups \(\langle G; *, \widehat{\ \ }, e \rangle\) and \(\langle H; \star, \tilde{\ \ }, e' \rangle\), a function \(\psi: G \rightarrow H\) is called a group homomorphism if for all \(a\) and \(b\): \[.
This means the operation can be applied before or after the function with the same result.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>For two groups \(\langle G; *, \widehat{\ \ }, e \rangle\) and \(\langle H; \star, \tilde{\ \ }, e' \rangle\), a function \(\psi: G \rightarrow H\) is called a {{c1::group homomorphism}} if {{c2:: for all \(a\) and \(b\): \[{{c2::\psi(a * b) = \psi(a) \star \psi(b)}}\]}}.</p>
<p>This means the operation can be applied {{c3::before or after}} the function with the same result.</p>
In a finite group the function \(x \rightarrow x^e\) is a bijection if \(e\) coprime to \(|G|\). For \(x^e = y\), the inverse of \(y\) is the unique \(e\)th root \(x = y^d\).
In a finite group the function \(x \rightarrow x^e\) is a bijection if \(e\) coprime to \(|G|\). For \(x^e = y\), the inverse of \(y\) is the unique \(e\)th root \(x = y^d\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a finite group the function \(x \rightarrow x^e\) is {{c1:: a bijection}} if {{c2:: \(e\) coprime to \(|G|\)}}.<br>For \(x^e = y\), the inverse of \(y\) is {{c3:: the <b>unique</b> \(e\)th root \(x = y^d\)}}.
An irreducible polynomial of degree \(\geq 2\) has no roots in the field.
Proof: If it had a root \(\alpha\), then \((x - \alpha)\) would divide it by Lemma 5.29, contradicting irreducibility.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>An {{c1::irreducible}} polynomial of degree {{c2::\(\geq 2\)}} has {{c3::no roots}} in the field.</p>
<p><strong>Proof</strong>: If it had a root \(\alpha\), then \((x - \alpha)\) would divide it by Lemma 5.29, contradicting irreducibility.</p>
If two sets are countable, what about their Cartesian product?
The Cartesian product \(A \times B\) of two countable sets is also countable:
\[A \preceq \mathbb{N} \land B \preceq \mathbb{N} \Rightarrow A \times B \preceq \mathbb{N}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
If two sets are countable, what about their Cartesian product?
Back
The Cartesian product \(A \times B\) of two countable sets is also countable:
\[A \preceq \mathbb{N} \land B \preceq \mathbb{N} \Rightarrow A \times B \preceq \mathbb{N}\]
If \(\psi: G \rightarrow H\) is a bijection and a homomorphism, then it is called an isomorphism, and we say that \(G\) and \(H\) are isomorphic and write \(G \simeq H\).
If \(\psi: G \rightarrow H\) is a bijection and a homomorphism, then it is called an isomorphism, and we say that \(G\) and \(H\) are isomorphic and write \(G \simeq H\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>If \(\psi: G \rightarrow H\) is a {{c1::bijection}} and a homomorphism, then it is called an {{c2::isomorphism}}, and we say that \(G\) and \(H\) are {{c2::isomorphic}} and write {{c2::\(G \simeq H\)}}.</p>
An integral domain \(D\) is a (nontrivial, \(0 \neq 1\)) commutative ring without zerodivisors (\(ab = 0 \implies a = 0 \lor b = 0\))
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>An {{c1::integral domain \(D\)}} is a {{c2::(nontrivial, \(0 \neq 1\)) commutative ring}} without {{c3::zerodivisors (\(ab = 0 \implies a = 0 \lor b = 0\))}}</p>
Is \(\langle \mathbb{Z}_n; \oplus \rangle\) abelian (commutative)?
Yes, \(\langle \mathbb{Z}_n; \oplus \rangle\) is abelian because addition modulo \(n\) is commutative: \[a \oplus b = (a + b) \bmod n = (b + a) \bmod n = b \oplus a\]
<p><strong>Yes</strong>, \(\langle \mathbb{Z}_n; \oplus \rangle\) is <strong>abelian</strong> because addition modulo \(n\) is commutative: \[a \oplus b = (a + b) \bmod n = (b + a) \bmod n = b \oplus a\]</p>
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a {{c2::least upper bound}}, then it is called the {{c1::<b>join </b>of \(a\) and \(b\) (also denoted \(a \lor b\)).}}
In a homomorphism \(\psi: G \rightarrow H\), does it matter whether you apply the operation before or after applying the function?
No, it doesn't matter! That's exactly what defines a homomorphism:
\[\psi(a *_G b) = \psi(a) *_H \psi(b)\]
You get the same result whether you:
- First operate in \(G\), then map to \(H\), OR
- First map both elements to \(H\), then operate in \(H\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>In a homomorphism \(\psi: G \rightarrow H\), does it matter whether you apply the operation before or after applying the function?</p>
Back
<p><strong>No</strong>, it doesn't matter! That's exactly what defines a homomorphism:</p>
<p>\[\psi(a *_G b) = \psi(a) *_H \psi(b)\]</p>
<p>You get the same result whether you:<br>
- First operate in \(G\), then map to \(H\), OR<br>
- First map both elements to \(H\), then operate in \(H\)</p>
Why does Euclid's algorithm work? (Based on Lemma 4.2)
Because \(\text{gcd}(m, n) = \text{gcd}(m, R_m(n))\). We repeatedly replace the larger number with its remainder when divided by the smaller, preserving the GCD while reducing the problem size. Eventually we reach \(\text{gcd}(d, 0) = d\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does Euclid's algorithm work? (Based on Lemma 4.2)
Back
Because \(\text{gcd}(m, n) = \text{gcd}(m, R_m(n))\). We repeatedly replace the larger number with its remainder when divided by the smaller, preserving the GCD while reducing the problem size. Eventually we reach \(\text{gcd}(d, 0) = d\).
Why must every common divisor of \(a\) and \(b\) also divide \(\text{gcd}(a,b)\)?
This is part of the definition of GCD - it's not just the largest common divisor by magnitude, but also the one that is divisible by all other common divisors. This makes it "greatest" in the divisibility ordering, not just in size.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why must every common divisor of \(a\) and \(b\) also divide \(\text{gcd}(a,b)\)?
Back
This is part of the definition of GCD - it's not just the largest common divisor by magnitude, but also the one that is divisible by all other common divisors. This makes it "greatest" in the divisibility ordering, not just in size.
For a homomorphism \(h: G \rightarrow H\), the kernel \(\ker h\) is the set of all elements mapped to the neutral element (essentially the nullspace).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>For a homomorphism \(h: G \rightarrow H\), the {{c1::kernel \(\ker h\)}} is the set of all elements mapped to the {{c2::neutral element}} (essentially the {{c2::nullspace}}).</p>
Lemma 5.22(2): In \(D[x]\) where \(D\) is an integral domain, the degree of the product of two polynomials is?
The degree of their product is exactly the sum (not just at most) of their degrees.
This holds because \(ab \neq 0\) for all \(a,b \neq 0\) in an integral domain (no zerodivisors).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p><strong>Lemma 5.22(2)</strong>: In \(D[x]\) where \(D\) is an integral domain, the degree of the product of two polynomials is?</p>
Back
<p>The degree of their product is exactly the sum (not just at most) of their degrees.</p>
<p>This holds because \(ab \neq 0\) for all \(a,b \neq 0\) in an integral domain (no zerodivisors).</p>
In the poset \((\{2, 3, 4, 5, 6, 7, 8, 9\}; |)\), identify the minimal and maximal elements.
Minimal elements: \(2, 3, 5, 7\) (primes)
Maximal elements: \(5, 6, 7, 8, 9\)
Least or greatest element There is none (not all elements comparable)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In the poset \((\{2, 3, 4, 5, 6, 7, 8, 9\}; |)\), identify the minimal and maximal elements.<br><ul><li><strong>Minimal elements</strong>: {{c1:: \(2, 3, 5, 7\) (primes)}}</li><li><strong>Maximal elements</strong>: {{c2:: \(5, 6, 7, 8, 9\)}}</li><li><strong>Least or greatest element</strong> {{c3:: There is none (not all elements comparable)}}</li></ul><div><img src="paste-1d2f8dcd3adedbac7c91aff60842c9ece732a3a8.jpg"></div>
In any ring \(\langle R; +, -, 0, \cdot, 1 \rangle\), if it's non trivial (more than one element) \(1 \neq 0\)
If \(1=0\), then for all \(a \in R\) : \(a=1⋅a=0⋅a=0\)
So the ring would be trivial (only contains 0).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In any ring \(\langle R; +, -, 0, \cdot, 1 \rangle\), if it's non trivial (more than one element) {{c1:: \(1 \neq 0\)}}
Extra
<div>If \(1=0\), then for all \(a \in R\) : \(a=1⋅a=0⋅a=0\)</div><div><br></div><div>So the ring would be trivial (only contains 0). </div>
We can transform every formula into:<br><ul><li>{{c1::<b>prenex</b>}}<br></li><li>{{c2::<b>CNF</b>}}<br></li><li>{{c3::<b>DNF</b>}}</li><li>{{c4::<b>Skolem</b>}}</li></ul>
Let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[F[x]_{m(x)} \ \overset{\text{def}}{=} \ \{a(x) \in F[x] \ | \ \deg(a(x)) < d\}\]
This is the set of all polynomials over \(F\) with degree strictly less than \(d\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is \(F[x]_{m(x)}\)?</p>
Back
<p>Let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[F[x]_{m(x)} \ \overset{\text{def}}{=} \ \{a(x) \in F[x] \ | \ \deg(a(x)) < d\}\]</p>
<p>This is the set of all polynomials over \(F\) with <strong>degree strictly less than \(d\)</strong>.</p>
What is the number of generators of \(\mathbb{Z}_n^*\)?
1. verify that \(\mathbb{Z}_n^*\)is cyclic (iff n = 2, 4, \(p^e\), \(2p^e\), with \(e \ge 1\) and \(p\) is an odd prime) 2. if \(\mathbb{Z}_n^*\) is cyclic then it is isomorphic to \(\mathbb{Z}_{\varphi(n)}^+\) (by lemma) 3. the number of generators of \(\mathbb{Z}_{\varphi(n)}^+\) is \(\varphi(\varphi(n))\) as it is the number of coprime elements of the group
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the number of generators of \(\mathbb{Z}_n^*\)?
Back
1. verify that \(\mathbb{Z}_n^*\)is cyclic (iff n = 2, 4, \(p^e\), \(2p^e\), with \(e \ge 1\) and \(p\) is an odd prime)<br>2. if \(\mathbb{Z}_n^*\) is cyclic then it is isomorphic to \(\mathbb{Z}_{\varphi(n)}^+\) (by lemma) <br>3. the number of generators of \(\mathbb{Z}_{\varphi(n)}^+\) is \(\varphi(\varphi(n))\) as it is the number of coprime elements of the group
You can divide as in a field, the multiplicative monoid is also a group (without \(0\), thus \(0\) cannot be divided by - no inverse).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>In a field, you can:</p>
Back
<ul>
<li>add</li>
<li>subtract</li>
<li>multiply</li>
<li><em>divide</em> by any nonzero element.</li>
</ul>
<p>You can divide as in a field, the multiplicative monoid is also a <em>group</em> (without \(0\), thus \(0\) cannot be divided by - no inverse).</p>
What three properties must a relation have to be a partial order: 1. Reflexive 2. Antisymmetric 3. Transitive
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What three properties must a relation have to be a partial order:<br>1. {{c1:: <b>Reflexive</b>}}<br>2. {{c2:: <b>Antisymmetric</b>}}<br>3. {{c3:: <b>Transitive</b>}}
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}.
The Euler function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c1::Euler function}} \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}.</p>
Give the formal definition of the least common multiple \(\text{lcm}(a, b)\).
\[a | l \land b | l \land \forall m \ ((a | m \land b | m) \rightarrow l | m)\]
\(l\) is a common multiple of \(a\) and \(b\) which divides every common multiple of \(a\) and \(b\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give the formal definition of the least common multiple \(\text{lcm}(a, b)\).
Back
\[a | l \land b | l \land \forall m \ ((a | m \land b | m) \rightarrow l | m)\]
\(l\) is a common multiple of \(a\) and \(b\) which divides every common multiple of \(a\) and \(b\).
Lemma 5.34: Let \(F\) be a finite field with \(q\) elements and let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[|F[x]_{m(x)}| = q^d\]
Explanation: Each polynomial has \(d\) coefficients, and each coefficient can be any of \(q\) elements from \(F\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is the cardinality of \(F[x]_{m(x)}\)?</p>
Back
<p><strong>Lemma 5.34</strong>: Let \(F\) be a finite field with \(q\) elements and let \(m(x)\) be a polynomial of degree \(d\) over \(F\). Then: \[|F[x]_{m(x)}| = q^d\]</p>
<p><strong>Explanation</strong>: Each polynomial has \(d\) coefficients, and each coefficient can be any of \(q\) elements from \(F\).</p>
We are allowed to swap quantifier order in a formula if:
they are of the same type
the variables don't appear nested together
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We are allowed to swap quantifier order in a formula if:<br><ul><li>{{c1:: they are of the same type}}</li><li>{{c2:: the variables don't appear nested together}}</li></ul>
For \(a,b,m\in\mathbb{Z}\) with \(m\ge1\), we say that \(a\) is congruent to \(b\) modulo \(m\) if \(m\) divides \(a-b\). Written as an expression: \(a\equiv_mb \iff m \mid (a-b)\).
For \(a,b,m\in\mathbb{Z}\) with \(m\ge1\), we say that \(a\) is congruent to \(b\) modulo \(m\) if \(m\) divides \(a-b\). Written as an expression: \(a\equiv_mb \iff m \mid (a-b)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(a,b,m\in\mathbb{Z}\) with \(m\ge1\), we say that \(a\) is <i>congruent to </i>\(b\) <i>modulo </i>\(m\) if {{c1:: \(m\) divides \(a-b\)}}. Written as an expression:{{c1:: \(a\equiv_mb \iff m \mid (a-b)\).}}
A partial order on a set \(A\) is a relation that is
* reflexive
* antisymmetric
* transitive
Examples: \(\leq, \geq\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::A partial order}} on a set \(A\) is a relation that is<div>{{c2::<div>* reflexive</div><div>* antisymmetric</div><div>* transitive</div>}}<br></div>
A poset \((A; \preceq)\) is called totally ordered (also: linearly ordered) by \(\preceq\) if any two elements of the poset are comparable.
Example: \((\mathbb{Z}; \ge)\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A poset \((A; \preceq)\) is called {{c2::<b>totally ordered</b> (also: linearly ordered) by \(\preceq\)}} if {{c1::any two elements of the poset are comparable.}}
\(\mathbb{Z}_m^*\) is useful compared to \(\mathbb{Z}_m\)because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), but we would like to have this for building RSA}}.
\(\mathbb{Z}_m^*\) is useful compared to \(\mathbb{Z}_m\)because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), but we would like to have this for building RSA}}.
Not all element in Zm have an inverse, something which Zm* guarantees by bezout.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(\mathbb{Z}_m^*\) is useful compared to \(\mathbb{Z}_m\)because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), but we would like to have this for building RSA}}.
Extra
Not all element in Zm have an inverse, something which Zm* guarantees by bezout.
A relation ρ on a set A is called antisymmetric if {{c1::\( a \ \rho \ b \wedge b \ \rho \ a \implies a = b\) is true, i.e. if \( \rho \cap \hat{\rho} \subseteq \text{id}\)}}
A relation ρ on a set A is called antisymmetric if {{c1::\( a \ \rho \ b \wedge b \ \rho \ a \implies a = b\) is true, i.e. if \( \rho \cap \hat{\rho} \subseteq \text{id}\)}}
Example: \( \le, \ge\) and the division relation: \( a \mid b \wedge b \mid a \implies a = b\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A relation ρ on a set A is called {{c2::antisymmetric}} if {{c1::\( a \ \rho \ b \wedge b \ \rho \ a \implies a = b\) is true, i.e. if \( \rho \cap \hat{\rho} \subseteq \text{id}\)}}
Extra
Example: \( \le, \ge\) and the division relation: \( a \mid b \wedge b \mid a \implies a = b\)
1. Basis Step: Prove \(P(0)\) (or \(P(1)\) or \(P(k)\) depending on universe)
2. Induction Step: Prove that for any arbitrary \(n\), \(P(n) \Rightarrow P(n+1)\) (assuming \(P(n)\) as the induction hypothesis)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What are the two steps of a proof by induction?
Back
1. <strong>Basis Step</strong>: Prove \(P(0)\) (or \(P(1)\) or \(P(k)\) depending on universe)
<br>2. <strong>Induction Step</strong>: Prove that for any arbitrary \(n\), \(P(n) \Rightarrow P(n+1)\) (assuming \(P(n)\) as the induction hypothesis)
This is the set of all elements in \(\mathbb{Z}_m\) that are coprime to \(m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>\(\mathbb{Z}_m^*\) is defined as?</p>
Back
<p>\[ \overset{\text{def}}{=} \ \{a \in \mathbb{Z}_m \ | \ \gcd(a, m) = 1\} \]</p><br><p>This is the set of all elements in \(\mathbb{Z}_m\) that are coprime to \(m\).</p>
To show that a newly defined operator can be used to express any formula, we show that:
\(\lnot F\), \(F \lor G\) and \(F \land G\) can be rewritten only in terms of it.
For example NOT, AND, OR can be expressed in NAND form, thus we can rewritten in CNF (or DNF) then NANDs (by simply replacing).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
To show that a newly defined operator can be used to express any formula, we show that:
Back
\(\lnot F\), \(F \lor G\) and \(F \land G\) can be rewritten <b>only</b> in terms of it.<br><br>For example NOT, AND, OR can be expressed in NAND form, thus we can rewritten in CNF (or DNF) then NANDs (by simply replacing).
A proof that \(S_x\) is not true for all \(x \in X\) by exhibiting an \(a\) (called a counterexample) such that \(S_a\) is false.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a proof by counterexample?
Back
A proof that \(S_x\) is <strong>not</strong> true for all \(x \in X\) by exhibiting an \(a\) (called a counterexample) such that \(S_a\) is <strong>false</strong>.
That is, it's hard to find \(x_A\) from \(g^{x_A} \mod p\), knowing \(g\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
DHKE works because?
Back
The <b>discrete logarithm</b> problem is hard!<br><br>That is, it's hard to find \(x_A\) from \(g^{x_A} \mod p\), knowing \(g\).
Does the uniqueness of the neutral element imply that a group is abelian (commutative)?
I.e. does a*e = e*a mean G is abelian?
No! The uniqueness of the neutral element does not imply commutativity.
Counterexample: The identity matrix \(I_3\) is the unique neutral element for the group of \(3 \times 3\) real matrices under multiplication. We have \(A \cdot I_3 = I_3 \cdot A\) for all matrices \(A\), even though matrix multiplication is not commutative in general.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Does the uniqueness of the neutral element imply that a group is abelian (commutative)?</p><br><br>I.e. does a*e = e*a mean G is abelian?
Back
<p><strong>No!</strong> The uniqueness of the neutral element does <strong>not</strong> imply commutativity.</p><br><p><strong>Counterexample</strong>: The identity matrix \(I_3\) is the unique neutral element for the group of \(3 \times 3\) real matrices under multiplication. We have \(A \cdot I_3 = I_3 \cdot A\) for all matrices \(A\), even though matrix multiplication is <strong>not commutative</strong> in general.</p>
Theorem 5.42: Let \(\mathcal{A} = \text{GF}(q)\) and let \(\alpha_0, \dots, \alpha_{n-1}\) be arbitrary distinct elements of \(\text{GF}(q)\). Encode by polynomial evaluation: \[E((a_0, \dots, a_{k-1})) = (a(\alpha_0), \dots, a(\alpha_{n-1}))\] where \(a(x)\) is the polynomial with coefficients \((a_0, \dots, a_{k-1})\).
The code has minimum distance \(d_{\min} = n - k + 1\).
Key property: The polynomial can be interpolated from any \(k\) values by Lagrangian interpolation. Two codewords cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What is a polynomial based encoding function?</p>
Back
<p><strong>Theorem 5.42</strong>: Let \(\mathcal{A} = \text{GF}(q)\) and let \(\alpha_0, \dots, \alpha_{n-1}\) be arbitrary distinct elements of \(\text{GF}(q)\). Encode by polynomial evaluation: \[E((a_0, \dots, a_{k-1})) = (a(\alpha_0), \dots, a(\alpha_{n-1}))\] where \(a(x)\) is the polynomial with coefficients \((a_0, \dots, a_{k-1})\).</p>
<p>The code has minimum distance \(d_{\min} = n - k + 1\).</p>
<p><strong>Key property</strong>: The polynomial can be interpolated from any \(k\) values by Lagrangian interpolation. Two codewords cannot agree at \(k\) positions (else they'd be equal), so they disagree in at least \(n - k + 1\) positions.</p>
How do you perform polynomial division when the divisor is not monic (e.g., in \(\text{GF}(7)[x]\))?
If dividing by a non-monic polynomial like \(4x + 2\) in \(\text{GF}(7)[x]\):
Find the multiplicative inverse of the leading coefficient in the field
For \(4\) in \(\text{GF}(7)\): \(4 \cdot 2 \equiv_7 1\), so \(4^{-1} = 2\)
Multiply the polynomial by this inverse to make it monic
\(2 \cdot (4x + 2) = 8x + 4 \equiv_7 x + 4\)
Now divide by the monic polynomial
Example: \(3x^2 + 6x + 5\) divided by \(4x + 2\) becomes \(3x^2 + 6x + 5\) divided by \(\text{GF}(7)[x]\)0 (after multiplying by \(\text{GF}(7)[x]\)1).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>How do you perform polynomial division when the divisor is not monic (e.g., in \(\text{GF}(7)[x]\))?</p>
Back
<p>If dividing by a non-monic polynomial like \(4x + 2\) in \(\text{GF}(7)[x]\):</p>
<ol>
<li>Find the multiplicative inverse of the leading coefficient in the field</li>
<li>For \(4\) in \(\text{GF}(7)\): \(4 \cdot 2 \equiv_7 1\), so \(4^{-1} = 2\)</li>
<li>Multiply the polynomial by this inverse to make it monic</li>
<li>\(2 \cdot (4x + 2) = 8x + 4 \equiv_7 x + 4\)</li>
<li>Now divide by the monic polynomial</li>
</ol>
<p><strong>Example</strong>: \(3x^2 + 6x + 5\) divided by \(4x + 2\) becomes \(3x^2 + 6x + 5\) divided by \(\text{GF}(7)[x]\)0 (after multiplying by \(\text{GF}(7)[x]\)1).</p>
\(\text{GF}(q)\) is only finite if and only if \(q\) is a power of a prime, i.e. \(q = p^k\) for \(p\) prime.
Any two fields of the same size \(q\) are isomorphic.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>When is there a finite field with \(q\) elements?</p>
Back
<p>\(\text{GF}(q)\) is only finite <em>if and only if</em> \(q\) is a <em>power</em> of a prime, i.e. \(q = p^k\) for \(p\) prime.</p>
<p>Any two fields of the same size \(q\) are isomorphic.</p>
For the universe \(\mathbb{N}\) and an arbitrary unary predicate \(P\):
\[P(0) \land \forall n (P(n) \rightarrow P(n+1)) \Rightarrow \forall n P(n)\]
(If the base case holds and the induction step holds, then the property holds for all natural numbers)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the Principle of Mathematical Induction?
Back
For the universe \(\mathbb{N}\) and an arbitrary unary predicate \(P\):
\[P(0) \land \forall n (P(n) \rightarrow P(n+1)) \Rightarrow \forall n P(n)\]
<br>
(If the base case holds and the induction step holds, then the property holds for all natural numbers)
\(\langle S; * \rangle\) can have at most one neutral element.
There can be a distinct left and right neutral though.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Can there be more than one neutral element?</p>
Back
<p>\(\langle S; * \rangle\) can have <strong>at most one neutral element</strong>.</p><p><br></p><p>There can be a distinct left and right neutral though.</p>
For DHKE, both Alice and Bob choose \(x_A, x_B\) (their private keys) at random. They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and with \(y_B\)analogously, which are their public keys}} which is sent over the network to their partner. The other {{c3:: then exponentiates by their private key to get the shared key \(k_{AB} \equiv_p y_B^{x_A} \equiv_p g^{x_B \cdot x_A} \equiv_p y_A^{x_B}\)}}.
For DHKE, both Alice and Bob choose \(x_A, x_B\) (their private keys) at random. They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and with \(y_B\)analogously, which are their public keys}} which is sent over the network to their partner. The other {{c3:: then exponentiates by their private key to get the shared key \(k_{AB} \equiv_p y_B^{x_A} \equiv_p g^{x_B \cdot x_A} \equiv_p y_A^{x_B}\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For DHKE, both Alice and Bob {{c1:: choose \(x_A, x_B\) (their private keys) at random}}.<br>They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and with \(y_B\)analogously, which are their public keys}} which is {{c2:: sent over the network to their partner}}.<br>The other {{c3:: then exponentiates by their private key to get the shared key \(k_{AB} \equiv_p y_B^{x_A} \equiv_p g^{x_B \cdot x_A} \equiv_p y_A^{x_B}\)}}.
If a set of \( n \) objects is divided into \( k < n\) sets, then at least one of the sets contains at least \( \left \lceil{\frac{n}{k}}\right \rceil\) objects.
Informally: If there are more objects than sets, there is a set with more than one object in it.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Proof method: Pigeonhole Principle
Back
If a set of \( n \) objects is divided into \( k < n\) sets, then at least one of the sets contains at least \( \left \lceil{\frac{n}{k}}\right \rceil\) objects.<div><br></div><div>Informally: If there are more objects than sets, there is a set with more than one object in it.</div>
If no \(m\) exists, such that \(a^m = e\) in a group, the order \(\text{ord}(a)\) of \(a\) is {{c1:: said to be infinite, written \(\text{ord}(a) = \infty\)}}.
If no \(m\) exists, such that \(a^m = e\) in a group, the order \(\text{ord}(a)\) of \(a\) is {{c1:: said to be infinite, written \(\text{ord}(a) = \infty\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>If {{c2:: no \(m\) exists, such that \(a^m = e\) in a group}}, the order \(\text{ord}(a)\) of \(a\) is {{c1:: said to be infinite, written \(\text{ord}(a) = \infty\)}}.</p>
The subset \(f(A)\) of \(B\) is called the image (also: range) of \(f\) and is also denoted \(Im(f)\).
Example: \(f(x) = x^2\), the range of \(f\) is \(\mathbb{R}^{\ge 0}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c2::subset \(f(A)\) of \(B\)}} is called the {{c1::<b>image</b> (also: range) of \(f\)}} and is also denoted {{c1::\(Im(f)\)}}.
Extra
Example: \(f(x) = x^2\), the range of \(f\) is \(\mathbb{R}^{\ge 0}\)
An element \(p \in \mathcal{P}\) is either a valid proof for a statement \(s \in \mathcal{S}\) or it's not. this is defined by the {{c1:: verification function \(\phi : \mathcal{S} \times \mathcal{P} \rightarrow \{0, 1\}\) }}.
An element \(p \in \mathcal{P}\) is either a valid proof for a statement \(s \in \mathcal{S}\) or it's not. this is defined by the {{c1:: verification function \(\phi : \mathcal{S} \times \mathcal{P} \rightarrow \{0, 1\}\) }}.
\(\phi(s, p) = 1\) means that \(p\) is a valid proof for \(s\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An element \(p \in \mathcal{P}\) is either a valid proof for a statement \(s \in \mathcal{S}\) or it's not. this is defined by the {{c1:: <b>verification function</b> \(\phi : \mathcal{S} \times \mathcal{P} \rightarrow \{0, 1\}\) }}.
Extra
\(\phi(s, p) = 1\) means that \(p\) is a valid proof for \(s\).
If \(p\) is a prime which divides the product \(x_1 x_2 \dots x_n\) of some integers, then \(p\) divides at least one of them: \[p | (x_1 x_2 \dots x_n) \Rightarrow \exists i \ p | x_i\]
If \(p\) is a prime which divides the product \(x_1 x_2 \dots x_n\) of some integers, then \(p\) divides at least one of them: \[p | (x_1 x_2 \dots x_n) \Rightarrow \exists i \ p | x_i\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(p\) is a prime which divides the product \(x_1 x_2 \dots x_n\) of some integers, then \(p\) {{c1:: divides at least one of them: \[p | (x_1 x_2 \dots x_n) \Rightarrow \exists i \ p | x_i\]}}<br>
An expression using the propositional symbols \(A, B, C, \dots\) and logical operators \(\land, \lor, \lnot, \ldots\) is called a formula (of propositional logic).
An expression using the propositional symbols \(A, B, C, \dots\) and logical operators \(\land, \lor, \lnot, \ldots\) is called a formula (of propositional logic).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An {{c2::expression using the propositional symbols \(A, B, C, \dots\) and logical operators \(\land, \lor, \lnot, \ldots\)}} is called a {{c1::<i>formula</i> (of propositional logic)}}.
What is a Hasse diagram of a poset \((A; \preceq)\)?
A directed graph whose vertices are labeled with elements of \(A\) and where there is an edge from \(a\) to \(b\) if and only if \(b\) covers \(a\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a Hasse diagram of a poset \((A; \preceq)\)?
Back
A directed graph whose vertices are labeled with elements of \(A\) and where there is an edge from \(a\) to \(b\) <strong>if and only if</strong> \(b\) <strong>covers</strong> \(a\).
What two properties must a relation \(f: A \to B\) have to be a function?
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\) 2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
What two properties must a relation \(f: A \to B\) have to be a function?
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\) 2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What two properties must a relation \(f: A \to B\) have to be a function?<br><br>1. {{c1:: <strong>Totally defined</strong>: \(\forall a \in A \ \exists b \in B : a \ f \ b\) }}<br>2. {{c2:: <strong>Well-defined</strong>: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)}}
What is the transitive closure \(\rho^*\) of a relation \(\rho\)?
\[\rho^{*} = \bigcup_{n \in \mathbb{N} \setminus \{0\}} \rho^n\]
The "reachability relation" - \((a,b) \in \rho^*\) iff there's a path of finite length from \(a\) to \(b\) in \(\rho\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the transitive closure \(\rho^*\) of a relation \(\rho\)?
Back
\[\rho^{*} = \bigcup_{n \in \mathbb{N} \setminus \{0\}} \rho^n\]
The "reachability relation" - \((a,b) \in \rho^*\) iff there's a path of finite length from \(a\) to \(b\) in \(\rho\).
The smallest subgroup of a group \(G\) containing \(a \in G\) is the group generated by \(a\), \(\langle a \rangle\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The {{c2:: smallest}} subgroup of a group \(G\) containing \(a \in G\) is {{c1:: the group <em>generated by \(a\)</em>, \(\langle a \rangle\)}}.</p>
Equivalence relation is a relation on a set \(A\) that is
* reflexive
* symmetric
* transitive
Example: \(\equiv_m \)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::Equivalence relation}} is a relation on a set \(A\) that is<div>{{c2::<div>* reflexive</div><div>* symmetric</div><div>* transitive</div>}}<br></div>
A cyclic group of order \(n\) {{c1::is isomorphic to \(\langle \mathbb{Z}_n,\oplus)\), and hence commutative::has which useful property?}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A cyclic group of order \(n\) {{c1::is isomorphic to \(\langle \mathbb{Z}_n,\oplus)\), and hence commutative::has which useful property?}}.
A subgroup \(H\) of a group \(G\) is a subset \(H \subseteq G\) which is a group in itself (closed with respect to all operations, inverses exist).
Trivial subgroups: \(\{e\}, G\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A subgroup \(H\) of a group \(G\) is {{c1::a subset \(H \subseteq G\) which is a group in itself (closed with respect to all operations, <b>inverses</b> exist).}}
What property does every finite field \(\text{GF}(q)\) have (and what does \(q\) satisfy)?
Theorem 5.40: The multiplicative group of every finite field \(\text{GF}(q)\) is cyclic (as \(q\) is a power of a prime, if \(\text{GF}(q)\) is cyclic).
This group has order \(q - 1\) and \(\varphi(q-1)\) generators.
Note that even though q is not prime thus not every integer is comprime, GF(q) is not Z_q.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What property does every finite field \(\text{GF}(q)\) have (and what does \(q\) satisfy)?</p>
Back
<p><strong>Theorem 5.40</strong>: The multiplicative group of every finite field \(\text{GF}(q)\) is cyclic (as \(q\) is a power of a prime, if \(\text{GF}(q)\) is cyclic).</p>
<p>This group has order \(q - 1\) and \(\varphi(q-1)\) generators.</p><p><i>Note that even though q is not prime thus not every integer is comprime, GF(q) is <b>not</b> Z_q.</i></p>
no variable occurs both as a bound and as a free variable
all variables appearing after the quantifiers are distinct
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>Rectified</b> form:<br><ul><li>{{c1::<b>no</b> variable occurs <b>both as a bound and as a free</b> variable}}</li><li>{{c2::<b>all</b> variables appearing <b>after the quantifiers</b> are distinct}}</li></ul>
Give an example of an extension field constructed from polynomials.
\(\mathbb{R}[x]_{x^2+1}\) is a field, isomorphic to \(\mathbb{C}\) (the complex numbers).
Explanation: \(x^2 + 1\) is irreducible over \(\mathbb{R}\) (no real roots). Elements of \(\mathbb{R}[x]_{x^2+1}\) are of the form \(a + bx\) where \(x^2 = -1\), which corresponds exactly to complex numbers \(a + bi\).
There are no other extension fields on \(\mathbb{R}\) that aren't isomorphic to \(\mathbb{C}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Give an example of an extension field constructed from polynomials.</p>
Back
<p>\(\mathbb{R}[x]_{x^2+1}\) is a field, <strong>isomorphic to \(\mathbb{C}\)</strong> (the complex numbers).</p>
<p><strong>Explanation</strong>: \(x^2 + 1\) is irreducible over \(\mathbb{R}\) (no real roots). Elements of \(\mathbb{R}[x]_{x^2+1}\) are of the form \(a + bx\) where \(x^2 = -1\), which corresponds exactly to complex numbers \(a + bi\).</p>
<p>There are no other extension fields on \(\mathbb{R}\) that aren't isomorphic to \(\mathbb{C}\).</p>
Name the binding strengths of PL tokens in order:<br><ol><li>{{c1:: unary operators (NOT)}}</li><li>{{c2:: quantifiers (for all and exists)}}</li><li>{{c3:: operators (AND, OR)}}</li><li>{{c4:: Implication}}</li></ol>
State Lemma 5.20 about division in integral domains: (The quotient has what property?)
Lemma 5.20: In an integral domain, if \(a | b\) (i.e., \(b = ac\) for some \(c\)), then \(c\) is unique and is denoted by \(c = b/a\) (the quotient).
Explanation: If \(b = ac_1\) and \(b = ac_2\), then \(a(c_1 - c_2) = 0\). Since \(a \neq 0\) in an integral domain, we must have \(c_1 - c_2 = 0\), so \(b = ac\)0.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>State Lemma 5.20 about division in integral domains: (The quotient has what property?)</p>
Back
<p><strong>Lemma 5.20</strong>: In an integral domain, if \(a | b\) (i.e., \(b = ac\) for some \(c\)), then \(c\) is <strong>unique</strong> and is denoted by \(c = b/a\) (the quotient).</p>
<p><strong>Explanation</strong>: If \(b = ac_1\) and \(b = ac_2\), then \(a(c_1 - c_2) = 0\). Since \(a \neq 0\) in an integral domain, we must have \(c_1 - c_2 = 0\), so \(b = ac\)0.</p>
How does the GCD change when we subtract a multiple? (Lemma 4.2)
For any integers \(m, n\) and \(q\):
\[\text{gcd}(m, n - qm) = \text{gcd}(m, n)\]
This is the key property for Euclid's algorithm:
\[\text{gcd}(m, R_m(n)) = \text{gcd}(m, n)\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How does the GCD change when we subtract a multiple? (Lemma 4.2)
Back
For any integers \(m, n\) and \(q\):
\[\text{gcd}(m, n - qm) = \text{gcd}(m, n)\]
This is the key property for Euclid's algorithm:
\[\text{gcd}(m, R_m(n)) = \text{gcd}(m, n)\]
An algebra (also: algebraic structure, \( \Omega\)-algebra) is a pair \(\langle S, \Omega \rangle\) where S is a set and \(\Omega = (\omega_1, \ldots, \omega_n)\) is a list of operations on S.
An algebra (also: algebraic structure, \( \Omega\)-algebra) is a pair \(\langle S, \Omega \rangle\) where S is a set and \(\Omega = (\omega_1, \ldots, \omega_n)\) is a list of operations on S.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::An algebra (also: algebraic structure, \( \Omega\)-algebra)}} is a pair \(\langle S, \Omega \rangle\) {{c2::where S is a set and \(\Omega = (\omega_1, \ldots, \omega_n)\) is a list of operations on S.}}
3. Assume that \( S \) is false and prove that \( T \) is true (-> contradiction)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Proof method: Proof by Contradiction<br><br>1. {{c1:: Find a suitable statement \( T\)}}<div>2. {{c2:: Prove that \( T \) is false}}</div><div>3. {{c3:: Assume that \( S \) is false and prove that \( T \) is true (-> contradiction)}}</div>
In a Group:
\(\widehat{(\widehat{a})} =\) \(a\) (inverse of inverse is the original element). This is a property from Lemma 5.3.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>In a Group:<br>
\(\widehat{(\widehat{a})} =\){{c1:: \(a\) }} {{c1:: (inverse of inverse is the original element)}}. This is a property from Lemma 5.3.</p>
Verify that \(\equiv_m\) is reflexive, symmetric, and transitive.
Reflexive: \(a \equiv_m a\) since \(m | (a - a) = 0\) ✓
Symmetric: \(a \equiv_m b \Rightarrow m | (a-b) \Rightarrow m | (b-a) \Rightarrow b \equiv_m a\) ✓
Transitive: If \(m | (a-b)\) and \(m | (b-c)\), then \(m | (a-b+b-c) = (a-c)\) ✓
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Verify that \(\equiv_m\) is reflexive, symmetric, and transitive.<br><ul><li><strong>Reflexive</strong>: {{c1:: \(a \equiv_m a\) since \(m | (a - a) = 0\) ✓}}</li><li><strong>Symmetric</strong>: {{c2:: \(a \equiv_m b \Rightarrow m | (a-b) \Rightarrow m | (b-a) \Rightarrow b \equiv_m a\) ✓}}</li><li><strong>Transitive</strong>: {{c3:: If \(m | (a-b)\) and \(m | (b-c)\), then \(m | (a-b+b-c) = (a-c)\) ✓}}</li></ul>
A right (left) neutral element is an elements such that for all \(a \in G\), \(a*e = a\) (\(e*a = a\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>A {{c1::right (left) neutral element}} is an elements such that for all \(a \in G\), {{c2:: \(a*e = a\) (\(e*a = a\))}}.</div>
Find a common factor \((x - \alpha)\) using the roots method:
Try all possible elements of the field to find roots
If \(\alpha\) is a root of both, then \((x - \alpha)\) is a common factor
Use division with remainder to reduce to smaller polynomials
Repeat the process on the smaller polynomials
Important: Don't just find all roots and multiply! A root might be repeated (e.g., \((x+1)^2\)), and you'd miss the higher multiplicity
Example: For \(a(x) = (x+1)(x+1)(x+2)\), the GCD with another polynomial might be \((x+1)^2\), not just \((x+1)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>How do you find the GCD of two polynomials?</p>
Back
<p>To find \(\gcd(a(x), b(x))\):</p>
<ol>
<li>Find a common factor \((x - \alpha)\) using the <strong>roots method</strong>:</li>
<li>Try all possible elements of the field to find roots</li>
<li>If \(\alpha\) is a root of both, then \((x - \alpha)\) is a common factor</li>
<li>Use <strong>division with remainder</strong> to reduce to smaller polynomials</li>
<li>Repeat the process on the smaller polynomials</li>
<li><strong>Important</strong>: Don't just find all roots and multiply! A root might be repeated (e.g., \((x+1)^2\)), and you'd miss the higher multiplicity</li>
</ol>
<p><strong>Example</strong>: For \(a(x) = (x+1)(x+1)(x+2)\), the GCD with another polynomial might be \((x+1)^2\), not just \((x+1)\).</p>
We just want to prove that there exists a \( x \) such that a statement \( S_x \) is true. (e.g. There exists a prime number such that \( n - 10\) and \( n + 10\) are also prime.)
constructive: We know the x.
non-constructive: We know that x has to exist, but we don't know its value.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Proof method: Existence Proof
Back
We just want to prove that there exists a \( x \) such that a statement \( S_x \) is true. (e.g. There exists a prime number such that \( n - 10\) and \( n + 10\) are also prime.) <div><br></div><div><i>constructive: </i>We know the x.</div><div><i>non-constructive: </i>We know that x has to exist, but we don't know its value.</div>
Special elements in posets: \((A; \preceq)\) is a poset.
\(a \in A\) is the least (greatest) element of \(A\) if \(a \preceq b\) (\(a \succeq b) \) for all \(b \in A\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset.<div>\(a \in A\) is the {{c1::<b>least (greatest) element</b> of \(A\)}} if {{c2::\(a \preceq b\) (\(a \succeq b) \) for all \(b \in A\)}}</div>
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is the greatest lower (least upper) bound of \(S\) if \(a\) is the greatest (least) element of the set of all lower (upper) bounds of \(S\).
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).
\(a \in A\) is the greatest lower (least upper) bound of \(S\) if \(a\) is the greatest (least) element of the set of all lower (upper) bounds of \(S\).
Note that greatest (least) refers to the operation \(\preceq\) and not to order by \(>\) or \(<\) (smaller, bigger).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Special elements in posets: \((A; \preceq)\) is a poset, \( S \subseteq A\).<div>\(a \in A\) is the {{c1::<b>greatest lower (least upper) bound</b> of \(S\)}} if {{c2::\(a\) is the greatest (least) element of the set of all lower (upper) bounds of \(S\). }}</div>
Extra
Note that greatest (least) refers to the operation \(\preceq\) and not to order by \(>\) or \(<\) (smaller, bigger).
A relation ρ on a set A is called symmetric if {{c2::\( a \ \rho \ b \iff b \ \rho \ a\) is true, i.e. if \( \rho = \hat{\rho}\)}}
Examples: \( \equiv_m\), marriage
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A relation ρ on a set A is called {{c1::symmetric}} if {{c2::\( a \ \rho \ b \iff b \ \rho \ a\) is true, i.e. if \( \rho = \hat{\rho}\)}}
A codeword \(c\) of length \(n\) in a polynomial code with degree \(k-1\) can be interpolated from any \(k\) values by Lagrangian interpolation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>A codeword \(c\) of length \(n\) in a <em>polynomial code</em> with degree \(k-1\) can be interpolated from {{c1:: <em>any \(k\) values</em> by Lagrangian interpolation}}.</p>
Why does the Chinese Remainder Theorem require \(m_1, \dots, m_r\) to be pairwise relatively prime?
If \(\text{gcd}(m_i, m_j) = d > 1\), then the system could be inconsistent (e.g., \(x \equiv 0 \pmod{6}\) and \(x \equiv 1 \pmod{4}\) has no solution) or have multiple solutions (destroying uniqueness).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does the Chinese Remainder Theorem require \(m_1, \dots, m_r\) to be <strong>pairwise relatively prime</strong>?
Back
If \(\text{gcd}(m_i, m_j) = d > 1\), then the system could be <strong>inconsistent</strong> (e.g., \(x \equiv 0 \pmod{6}\) and \(x \equiv 1 \pmod{4}\) has no solution) or have <strong>multiple solutions</strong> (destroying uniqueness).
Eine Gruppe ist eine Menge \(G\) mit Operation \( * \) mit folgenden Eigenschaften:
{{c2::
Assoziativität: \((a * b) * c = a * (b*c)\)
Neutrales Element existiert: \( a * e = e * a = a \)
Jedes Element \(a\in G\) hat eine Inverse: \( a * a^{-1} = a^{-1} * a = e\)
}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::Eine Gruppe}} ist eine {{c1::Menge \(G\) mit Operation \( * \)}} mit folgenden Eigenschaften:<ul>{{c2::<li> Assoziativität: \((a * b) * c = a * (b*c)\)</li><li>Neutrales Element existiert: \( a * e = e * a = a \)</li><li>Jedes Element \(a\in G\) hat eine Inverse: \( a * a^{-1} = a^{-1} * a = e\)</li>}}<br></ul>
\(F \equiv G\) means they correspond to the same function, i.e., their truth values are equal for all truth assignments to the propositional symbols appearing in \(F\) or \(G\).
\(F \equiv G\) means they correspond to the same function, i.e., their truth values are equal for all truth assignments to the propositional symbols appearing in \(F\) or \(G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c2::\(F \equiv G\)}} means {{c1:: they correspond to the same function}}, i.e., {{c3:: their truth values are equal for <strong>all</strong> truth assignments to the propositional symbols appearing in \(F\) or \(G\)}}.
What are both distributive laws in propositional logic?
\(A \land (B \lor C) \equiv (A \land B) \lor (A \land C)\) (distributing \(\land\) over \(\lor\))
\(A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)\) (distributing \(\lor\) over \(\land\))
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What are both distributive laws in propositional logic?
Back
<ul>
<li>\(A \land (B \lor C) \equiv (A \land B) \lor (A \land C)\) (distributing \(\land\) over \(\lor\))</li>
<li>\(A \lor (B \land C) \equiv (A \lor B) \land (A \lor C)\) (distributing \(\lor\) over \(\land\))</li>
</ul>
In a group, the equation \(a * x = b\) has a unique solution \(x\) for any \(a\) and \(b\) (So does the equation \(x * a = b\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a group, the equation \(a * x = b\) has {{c1:: a unique solution \(x\)}} for any \(a\) and \(b\) {{c1:: (So does the equation \(x * a = b\))}}.
Give the formal definitions of union and intersection.
\(A \cup B \overset{\text{def}}{=} \{x \ | \ x \in A \lor x \in B\}\)
\(A \cap B \overset{\text{def}}{=} \{x \ | \ x \in A \land x \in B\}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give the formal definitions of union and intersection.
Back
<ul>
<li>\(A \cup B \overset{\text{def}}{=} \{x \ | \ x \in A \lor x \in B\}\)</li>
<li>\(A \cap B \overset{\text{def}}{=} \{x \ | \ x \in A \land x \in B\}\)</li>
</ul>
What fundamental property distinguishes finite from infinite sets regarding proper subsets?
A finite set never has the same cardinality as one of its proper subsets. An infinite set can (e.g., \(\mathbb{N} \sim \mathbb{O}\) where \(\mathbb{O}\) is the set of odd numbers).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What fundamental property distinguishes finite from infinite sets regarding proper subsets?
Back
A <strong>finite</strong> set never has the same cardinality as one of its proper subsets. An <strong>infinite</strong> set can (e.g., \(\mathbb{N} \sim \mathbb{O}\) where \(\mathbb{O}\) is the set of odd numbers).
To prove \(\phi: G \rightarrow H\) is an isomorphism, you must verify two main properties:
- \(\phi\) is a homomorphism
- \(\phi\) is a bijection.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>To prove \(\phi: G \rightarrow H\) is an {{c2:: isomorphism}}, you must verify two main properties:<br>
- \(\phi\) is a {{c1::homomorphism}}<br>
- \(\phi\) is a {{c1::bijection}}.</p>
Theorem 5.24: A field is always an integral domain.
Proof idea: If \(ab = 0\) in a field and \(a \neq 0\), then \(a\) has an inverse \(a^{-1}\). Multiplying both sides by \(a^{-1}\) gives \(b = a^{-1} \cdot 0 = 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>When is a field an integral domain?</p>
Back
<p><strong>Theorem 5.24</strong>: A field is <strong>always</strong> an <strong>integral domain</strong>.</p>
<p><strong>Proof idea</strong>: If \(ab = 0\) in a field and \(a \neq 0\), then \(a\) has an inverse \(a^{-1}\). Multiplying both sides by \(a^{-1}\) gives \(b = a^{-1} \cdot 0 = 0\).</p>
The gcd does not change if we subract a multiple of the first number from the second.
\(\text{gcd}(m, n - qm) = \text{gcd}(m,n) \), which is why reduction modulo \(m\) preserves the gcd, which is what makes Euclid's algorithm work.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The gcd does <b>not</b> change if we {{c1:: subract a multiple of the first number from the second}}.
Extra
\(\text{gcd}(m, n - qm) = \text{gcd}(m,n) \), which is why reduction modulo \(m\) preserves the gcd, which is what makes Euclid's algorithm work.
The group \(\mathbb{Z}_n\) also only contains the positive numbers up to \(n\) \(\{0, 1, 2, \dots, n-1\}\), as the negatives \(\{-n+1, \dots, -2, -1\}\) are equal to a positive number \(\equiv_n\).
The group \(\mathbb{Z}_n\) also only contains the positive numbers up to \(n\) \(\{0, 1, 2, \dots, n-1\}\), as the negatives \(\{-n+1, \dots, -2, -1\}\) are equal to a positive number \(\equiv_n\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>The group \(\mathbb{Z}_n\) also {{c3::only contains the positive numbers up to \(n\)}} \(\{0, 1, 2, \dots, n-1\}\), as the negatives \(\{-n+1, \dots, -2, -1\}\) are equal to a positive number \(\equiv_n\).</p>
In EBNF we can write a recursive rule by writing the rule name on both sides e.g. <A> \(\leftarrow\) A[<A>] or by writing a series of rules that result in the same.
Back
ETH::1._Semester::EProg::1._EBNF::6._Recursion
In EBNF we can write a recursive rule by writing the rule name on both sides e.g. <A> \(\leftarrow\) A[<A>] or by writing a series of rules that result in the same.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In EBNF we can write a recursive rule by {{c1:: writing the rule name on both sides e.g. <A> \(\leftarrow\) A[<A>]}} or by {{c1:: writing a series of rules that result in the same}}.
A vector space \(V\) over a field \(F\) is a set with vector addition (\(V \times V \mapsto V)\) and scalar multiplication (\(F \times V \mapsto V\)) being defined. The elements of \(V\) are then usually called vectors and the elements of \(F\) scalars.
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
A vector space \(V\) over a field \(F\) is a set with vector addition (\(V \times V \mapsto V)\) and scalar multiplication (\(F \times V \mapsto V\)) being defined. The elements of \(V\) are then usually called vectors and the elements of \(F\) scalars.
Example: \(\mathbb{R}^2\) with the usual definitions of \(+, \cdot\) (cartesian vectors)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A <i>vector space</i> \(V\) over a field \(F\) is {{c1::a set with vector addition (\(V \times V \mapsto V)\) and scalar multiplication (\(F \times V \mapsto V\)) being defined}}. The elements of \(V\) are then usually called {{c1::vectors}} and the elements of \(F\) {{c1::scalars}}<i>.</i>
Extra
Example: \(\mathbb{R}^2\) with the usual definitions of \(+, \cdot\) (cartesian vectors)
If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How is the scalar product defined on an angle?
Back
\(\textbf{v} \cdot \textbf{w} = ||\textbf{v}|| \ ||\textbf{w}|| \cdot \cos(\alpha)\).<br><br>If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
the Kronecker delta is a function which is described as follows: \(\delta_{i, j} = \begin{cases} \text{0} &\quad\text{if }i \neq j \\ \text{1} &\quad\text{if }i = j \end{cases}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the <b>Kronecker delta?</b>
Back
the Kronecker delta is a function which is described as follows:<br>\(\delta_{i, j} = \begin{cases} \text{0} &\quad\text{if }i \neq j \\ \text{1} &\quad\text{if }i = j \end{cases}\)
Für eine unitäre Matrix gilt \( \mathbf{A^H A = I}_n\), d.h. die komplex-transponierte von A ist die Inverse von A.
Unitär = regulär & quadratisch
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Was ist eine <b>unitäre</b> Matrix?
Back
Für eine unitäre Matrix gilt \( \mathbf{A^H A = I}_n\), d.h. die komplex-transponierte von A ist die Inverse von A. <div>Unitär = regulär & quadratisch </div>
Ein Unterraum ist eine Teilmenge \( U \subseteq \mathbb{V}\) falls \( U \) auch die Eigenschaften eines Vektorraums hat (d.h. abgeschlossen bezüglich Vektoraddition & Skalarmultiplikation). Beispiel: Ebene in \(\mathbb{R}^3\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Was ist ein Unterraum?
Back
Ein Unterraum ist eine Teilmenge \( U \subseteq \mathbb{V}\) falls \( U \) auch die Eigenschaften eines Vektorraums hat (d.h. abgeschlossen bezüglich Vektoraddition & Skalarmultiplikation). Beispiel: Ebene in \(\mathbb{R}^3\)
Wann ist eine Matrix <b>skew-symmetric </b>(schiefsymmetrisch)?
Back
Falls \( \mathbf{A}^\top = -\mathbf{A}\)<div><br></div><div>Beispiel:</div><div>\( \begin{pmatrix} 0 & -3 & 5 \\ 3 & 0 & -4 \\ -5 & 4 & 0 \end{pmatrix}\)<br></div>
Gilt für zwei Matrizen \( \mathbf{A}\) und \( \mathbf{B}\), dass {{c2::\( \mathbf{AB} = \mathbf{BA}\)}}, dann kommutieren diese Matrizen.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Gilt für zwei Matrizen \( \mathbf{A}\) und \( \mathbf{B}\), dass {{c2::\( \mathbf{AB} = \mathbf{BA}\)}}, dann {{c1::kommutieren}} diese Matrizen.
What is the definition of a linear transformation or a linear functional?
a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\) is called a linear transformation or a linear functional if the linearity axiom holds for it
What is the definition of a linear transformation or a linear functional?
Back
a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\) is called a linear transformation or a linear functional if the <b>linearity axiom</b> holds for it <br><br><b>linearity axiom: </b>\(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\)
Für eine orthogonale Matrix gilt \( \mathbf{A^\top A = I}_n\), d.h. die Inverse von A ist A transponiert. Orthogonal = reell, quadratisch, regulär
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Was ist eine <b>orthogonale</b> Matrix?
Back
Für eine orthogonale Matrix gilt \( \mathbf{A^\top A = I}_n\), d.h. die Inverse von A ist A transponiert. Orthogonal = reell, quadratisch, regulär
Give the three definitions for linear independence:
None of the vectors is a linear combination of the other ones.
{{c2::There are no scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) can only be written as a trivial combination of the vectors.}}
None of the vectors is a linear combination of the previous ones.
Give the three definitions for linear independence:
None of the vectors is a linear combination of the other ones.
{{c2::There are no scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) can only be written as a trivial combination of the vectors.}}
None of the vectors is a linear combination of the previous ones.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Give the three definitions for linear independence:<br><ol><li>{{c1::None of the vectors is a linear combination of the other ones.}}</li><li>{{c2::There are no scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) can only be written as a trivial combination of the vectors.}}<br></li><li>{{c3::None of the vectors is a linear combination of the previous ones.}}</li></ol>
What does the linearity axiom say and how can it be interpreted for a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\):
What does the linearity axiom say and how can it be interpreted for a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\):
What does the linearity axiom say and how can it be interpreted for a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\):<br><br>i) {{c1:: \(T(x+x') = T(x) + T(x')\)}}<br>ii) {{c2:: \(T(\lambda x) = \lambda T(x)\)}}
Formula for the cosine of the angle between vectors v and w
If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Formula for the cosine of the angle between vectors v and w
Back
<img src="paste-f59da43aa9991b8ecc2f19c7a1f37d6e4e44107c.jpg"><br><br>If v and w are unit vectors, we don't need to divide by their norms, see the definition of a scalar product geometrically.
If columns \(v_1, v_2, ..., v_n\) of \(A\) are linearly independent and \(A\lambda = A\mu = x\) are two ways of writing vector x as a linear combination of the vectors v then:
If columns \(v_1, v_2, ..., v_n\) of \(A\) are linearly independent and \(A\lambda = A\mu = x\) are two ways of writing vector x as a linear combination of the vectors v then:
\(\lambda \ \text{and} \ \mu\) are the same vector.
Linear combinations are unique if all vectors are independent.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
If columns \(v_1, v_2, ..., v_n\) of \(A\) are linearly independent and \(A\lambda = A\mu = x\) are two ways of writing vector x as a linear combination of the vectors v then:
Back
\(\lambda \ \text{and} \ \mu\) are the same vector.<div><br></div><div>Linear combinations are unique if all vectors are independent.</div>
At least one of the vectors is a linear combination of the other ones.
{{c2::There are scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) is a nontrivial combination of the vectors.}}
At least one of the vectors is a linear combination of the previous ones.
At least one of the vectors is a linear combination of the other ones.
{{c2::There are scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) is a nontrivial combination of the vectors.}}
At least one of the vectors is a linear combination of the previous ones.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Give the three definitions of linear dependence:<br><ol><li>{{c1::At least one of the vectors is a linear combination of the other ones.}}</li><li>{{c2::There are scalars \(\lambda_1, ..., \lambda_n\) besides 0, 0, ..., 0 such that \(\sum_{i = 1}^n \lambda_i v_i = \mathbf{0}\). \(\mathbf{0}\) is a nontrivial combination of the vectors.}}<br></li><li>{{c3::At least one of the vectors is a linear combination of the previous ones.}}</li></ol>
given a vector \(\mathbf{d} \in \mathbb{R}^n\) \(\mathbf{d} \neq \mathbf{0}\), \(H_{\mathbf{d}} = \{\mathbf{v} \in \mathbb{R}^n : \mathbf{v} \cdot \mathbf{d} = \mathbf{0} \}\) or in other words, it is the set of vectors orthogonal to a given vector
Since 0 is orthogonal to every vector \(0 \in H_d\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the definition of a hyperplane?
Back
given a vector \(\mathbf{d} \in \mathbb{R}^n\) \(\mathbf{d} \neq \mathbf{0}\), \(H_{\mathbf{d}} = \{\mathbf{v} \in \mathbb{R}^n : \mathbf{v} \cdot \mathbf{d} = \mathbf{0} \}\) <br>or in other words, it is the set of vectors orthogonal to a given vector<br><br>Since 0 is orthogonal to every vector \(0 \in H_d\).
The LU (Lower-Upper, also sometimes called LR) decomposition factors a matrix \(A\) as the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\).
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
The LU (Lower-Upper, also sometimes called LR) decomposition factors a matrix \(A\) as the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\).
(so \(A = LU\))
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The LU ({{c1::Lower-Upper}}, also sometimes called {{c1::LR}}) decomposition factors a matrix \(A\) as {{c2::the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\)}}.
This equality holds exactly if one vector is the scalar multiple of the other.
This essentially means that: the length of the projecton of v onto w is smaller than the both of their lengths multiplied.
This explains the equality part: if they are already aligned, their projection doesn't lose any length...
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
The Cauchy-Schwarz Inequality tells us that for \(\textbf{v}, \textbf{w} \in \mathbb{R}^m\)
Back
\(|\textbf{v} \cdot \textbf{w}| \leq ||\textbf{v}|| \ ||\textbf{w}||\).<br><br>This equality holds exactly if one vector is the scalar multiple of the other.<br><br>This essentially means that: the length of the projecton of v onto w is smaller than the both of their lengths multiplied.<br><br>This explains the equality part: if they are already aligned, their projection doesn't lose any length...
The scalar product of \(\textbf{v} \cdot \textbf{v}\) is \(\leq or \geq\) to what?
\(\textbf{v} \cdot \textbf{v} \geq 0\) with equality exactly if \(\textbf{v} = \textbf{0}\).
This is because we essentially square the entries and thus can't get negatives.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
The <b>scalar product</b> of \(\textbf{v} \cdot \textbf{v}\) is \(\leq or \geq\) to what?
Back
\(\textbf{v} \cdot \textbf{v} \geq 0\) with equality exactly if \(\textbf{v} = \textbf{0}\).<br><br>This is because we essentially square the entries and thus can't get negatives.
it is the number of independent columns, where independence is defined such that given a column vector \(v_j\) then \(v_j\) is not a linear combination of \(v_1, v_2 ... v_{j-1}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the rank of a matrix?
Back
it is the number of independent columns, where independence is defined such that given a column vector \(v_j\) then \(v_j\) is not a linear combination of \(v_1, v_2 ... v_{j-1}\)
An important difference between a field \(F\) and a vector space \(V\) is that multiplication in the field is \(F\times F\mapsto F\), whereas it is \(F\times V\mapsto V\) in the vector space.
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
An important difference between a field \(F\) and a vector space \(V\) is that multiplication in the field is \(F\times F\mapsto F\), whereas it is \(F\times V\mapsto V\) in the vector space.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An important difference between a field \(F\) and a vector space \(V\) is that {{c1::multiplication in the field is \(F\times F\mapsto F\), whereas it is \(F\times V\mapsto V\) in the vector space}}.
Since 0 is orthogonal to every vector \(0 \in H_d\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is a hyperplane through the origin?
Back
<img src="paste-668e9356fe68198a22a939d45f03e5d4e9db8bdd.jpg"><br>Is called a hyperplane through the origin.<br><br>Since 0 is orthogonal to every vector \(0 \in H_d\).
Für alle Vektorpaare \( \mathbf{x,y} \in \mathbb{E}^n \) gilt die Cauchy-Schwarz-Ungleichung: {{c1::\( | \langle \mathbf{x, y} \rangle | \le ||\mathbf{x}|| \ ||\mathbf{y}||\)}}
Back
ETH::1._Semester::LinAlg PlsFix::DUPLICATE
Für alle Vektorpaare \( \mathbf{x,y} \in \mathbb{E}^n \) gilt die Cauchy-Schwarz-Ungleichung: {{c1::\( | \langle \mathbf{x, y} \rangle | \le ||\mathbf{x}|| \ ||\mathbf{y}||\)}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Für alle Vektorpaare \( \mathbf{x,y} \in \mathbb{E}^n \) gilt die Cauchy-Schwarz-Ungleichung: {{c1::\( | \langle \mathbf{x, y} \rangle | \le ||\mathbf{x}|| \ ||\mathbf{y}||\)}}
Wenn \(\mathbf{A}\) eine komplexe Matrix ist, dann ist \(\overline{\mathbf{A}}\) mit \( (\overline{\mathbf{A}})_{ij} = \overline{(\mathbf{A})_{ij}}\) die konjugiert-komplexe Matrix.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Was ist eine <b>konjugiert-komplexe </b>Matrix?
Back
Wenn \(\mathbf{A}\) eine komplexe Matrix ist, dann ist \(\overline{\mathbf{A}}\) mit \( (\overline{\mathbf{A}})_{ij} = \overline{(\mathbf{A})_{ij}}\) die konjugiert-komplexe Matrix.
Eine symmetrische Matrix erfüllt \(A^\top = A\) (d.h. eine "Spiegelachse" an der Hauptdiagonale). Hauptdiagonale selber unwichtig!<div>Beispiel:</div><div>\( \begin{pmatrix} 0 & 5 & 1 \\ 5 & 2 & 4 \\ 1 & 4 & 0 \end{pmatrix} \)<br></div>
Eine Linearkombination (LK) der Vektoren \( a_1, \ldots, a_n\) ist {{c2::ein Ausdruck der Form \( \alpha_1 a_1 + \cdots + \alpha_n a_n\) wobei \( \alpha_1, \ldots, \alpha_n \in \mathbb{R}\)}}
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
Eine Linearkombination (LK) der Vektoren \( a_1, \ldots, a_n\) ist {{c2::ein Ausdruck der Form \( \alpha_1 a_1 + \cdots + \alpha_n a_n\) wobei \( \alpha_1, \ldots, \alpha_n \in \mathbb{R}\)}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Eine {{c1::Linearkombination (LK)}} der Vektoren \( a_1, \ldots, a_n\) ist {{c2::ein Ausdruck der Form \( \alpha_1 a_1 + \cdots + \alpha_n a_n\) wobei \( \alpha_1, \ldots, \alpha_n \in \mathbb{R}\)}}
The LU decomposition is useful because (among other things) it is computationally more efficient when solving multiple \(Ax = b\) having the same \(A\) and different \(b\) .
Back
ETH::1._Semester::LinAlg PlsFix::DELETE
The LU decomposition is useful because (among other things) it is computationally more efficient when solving multiple \(Ax = b\) having the same \(A\) and different \(b\) .
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The LU decomposition is useful because (among other things) {{c1::it is computationally more efficient when solving multiple \(Ax = b\) having the same \(A\) and different \(b\) }}.