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.
Runtime of sorting an array containing only \(1, 0\)?
Back
ETH::1._Semester::A&D::04._Sorting_Algorithms
Runtime of sorting an array containing only \(1, 0\)?
Using bucketsort, we can achieve \(O(n)\).
We go through the array once, counting occurences of \(0\) as x. We then add \(x\) zeros in the beginning and fill the rest with 1s.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Runtime of sorting an array containing only \(1, 0\)?
Back
Using bucketsort, we can achieve \(O(n)\). <br><br>We go through the array once, counting occurences of \(0\) as x. We then add \(x\) zeros in the beginning and fill the rest with 1s.
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)\): As visit(u) would call visit(v) before the recursive call ends. <img src="paste-a6fc070f96de8bd2b8148e3891cf956fd611a0a2.jpg"> }}</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><b>push(k, S)</b>: {{c1:: push a new object <b>k</b> to the top of the stack <b>S</b>}}</li><li><b>pop(S)</b>: {{c2:: remove and return the top element of the stack <b>S</b>}}</li><li><b>top(S)</b>: {{c3:: 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
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br><br>\(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but <b>not tree edge</b>: {{c1:: Forward edge}}
Let \((S, V \setminus S)\) be any cut of a graph \(G\).
Let \(e = (u,v)\) be the minimal edge crossing this cut.
We want to show that \(e \in T\).
Assume \(e \not \in T\) for contradiction.
Since \(T\) is a spanning tree, \(T \cup {u}\) contains a cycle, crossing the cut at least twice (once via \(e\) and once via another edge \(e’\).)
We now construct \(T’= (T \cup {e}) \setminus {e’}\) which breaks the cycle but keeps the MST property.
Since \(w(e) < w(e’)\), \(w(T’) < w(T)\) and thus \(T\) is not an MST.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Cut and Paste Proof of <b>Cut-Property</b>:
Back
<div>Let \((S, V \setminus S)\) be any cut of a graph \(G\).</div><div><br></div><div>Let \(e = (u,v)\) be the minimal edge crossing this cut. </div><div>We want to show that \(e \in T\). </div><div><br></div><div><ol><li>Assume \(e \not \in T\) for contradiction.</li><li>Since \(T\) is a spanning tree, \(T \cup {u}\) contains a cycle, crossing the cut at least twice (once via \(e\) and once via another edge \(e’\).)</li><li>We now construct \(T’= (T \cup {e}) \setminus {e’}\) which breaks the cycle but keeps the MST property.</li><li>Since \(w(e) < w(e’)\), \(w(T’) < w(T)\) and thus \(T\) is not an MST.</li></ol></div>
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 (ZHKs): \(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 (ZHKs): \(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}}.
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>queue</b> has the following operations:<br><ul><li><b>enqueue(k, S)</b>: {{c2:: append at the end of the queue}}</li><li><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>)}}.
Start in the middle of the array. <br><br>If the middle element is the target element, return the current index.<br><br>Else if the middle elment is larger (smaller) than the target element, continue recursively on the left (right) half of the array.
\(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 Bellman-Ford for "free".</div>
A Minimum Spanning Tree is a subgraph of a connected, undirected, weighted graph 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 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 that fullfills:<br><ul><li>{{c2:: spanning, it connects all vertices}}</li><li>{{c3:: acylic, it's a tree}}</li><li>{{c4:: 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><b>insert(k, L)</b>: {{c1:: insert the key <b>K</b> at the end of the list <b>L</b>}}</li><li><b>get(i, L)</b>: {{c2:: return the memory address of the i-th key in list <b>L</b>}}</li><li><b>delete(k, L)</b>: {{c3:: remove the key <b>k</b> from the list <b>L</b>}}</li><li><b>insertAfter(k, k', L)</b>: {{c4:: inserts the key <b>k'</b> after the key <b>k</b> in the list <b>L</b>}}</li></ul>
The depth \(h\) of a seach tree of any comparison-based algorithm satisfies which bound?
\(h \geq \Omega(\log n)\) this is information theoretically the least amount of comparisons necessary.
Note that \(h \not \leq O(n)\) necessarily as we could have a really stupid algorithm that compares thrice for example.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
The depth \(h\) of a seach tree of any comparison-based algorithm satisfies which bound?
Back
\(h \geq \Omega(\log n)\) this is information theoretically the least amount of comparisons necessary.<br><br>Note that \(h \not \leq O(n)\) necessarily as we could have a really stupid algorithm that compares thrice for example.
Explain how union 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 union 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)
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
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)\)
In a sparse graph an adjacency list is better, in a dense graph an 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
Which datastructure is best for DFS?<br><br>In a sparse graph {{c1:: an adjacency list is better}}, in a dense graph {{c1:: an 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 (or that of another child, as works) 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>: Insertion 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 (or that of another child, as works) 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 \(G\) 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 \(G\) 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><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.<br><br><div>Dann enthält jeder minimale Spannbaum von \(G\) 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 whether 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 whether 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
Provide 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>insert</b>: {{c1::insert with priority <b>p}}</b><br></li><li><b>extractMax:</b> {{c2::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 in constant time! We have to swap 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\)}}.
No, because it's the heaviest edge in the cycle. If there was an MST containing it, we could remove it and replace it by another edge in the cycle. Then we preserve the tree property yet it's weight is strictly lower.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Can (g, h) ever be in an MST? Prove it:<br><img src="paste-0451663ce9f1137e81a00020ee38fb0a96908565.jpg">
Back
No, because it's the heaviest edge in the cycle.<br>If there was an MST containing it, we could remove it and replace it by another edge in the cycle.<br>Then we preserve the tree property yet it's weight is strictly lower.
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 anliegend) 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 anliegend) 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 (a<i>djazent</i> oder b<i>enachbart</i>)}} to \(v\) (and the other way around) and \(e\) {{c2::incident (i<i>nzident</i> oder a<i>nliegend</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>For all \(n < r - l + 1\) merge sort correctly sorts any sub-array of length n.</div><div><br></div><div>Assuming the invariant holds, the two recursive calls return sorted halves. </div><div><br></div><div>It remains to show that merge correctly combines two sorted halves into a sorted whole.</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)\). (Though it can be implemented as such)<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>: Deletion 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: \(\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: \(\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 entries (Base case, recursive formula, pay attention to bounds!)}}</li><li>{{c3::Order of calculation (what depends on what entries, what variable incremented first)}}</li><li>{{c4::Extracting the solution}}</li><li>{{c5::Runtime}}</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
How can we check for cycles via DFS?
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...).
The term \(B - b_i\) can become negative. Instead of accessing an invalid index, return "false" (the neutral element for OR), since you can't achieve a negative sum.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
When writing a recursion which accesses an index that could go out of bounds, make sure to {{c1::return a neutral value instead of crashing}}.
Extra
Example: Subset Sum<br><br>Recursion: \(DP[i][B] = DP[i-1][B] \lor DP[i-1][B - b_i]\)<br><br>The term \(B - b_i\) can become negative. Instead of accessing an invalid index, return "false" (the neutral element for OR), since you can't achieve a negative sum.
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)\)
2-3 Tree: We deleted a node and now it's sibling is an only child. What happens if it's neighbor has 2 keys?
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: We deleted a node and now it's sibling is an only child. What happens if it's neighbor 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 and 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\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br><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>}}.
A while loop that doesn't increase constantly but goes from i = 1 and increases by i = 2*i for example, can be modelled as a sum from 0 to \(\log_2 n\)?
A while loop that doesn't increase constantly but goes from i = 1 and increases by i = 2*i for example, can be modelled as a sum from 0 to \(\log_2 n\)?
Note that we start from 0, as \(2 = 1^0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A while loop that doesn't increase constantly but goes from <b>i = 1</b> and increases by <b>i = 2*i</b> for example, can be modelled as a sum from {{c1::0}} to {{c2:: \(\log_2 n\)}}?
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.
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><br></div><div>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><br>We then swap the pivot into the middle of that.<br><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 and 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).</div><div><br>Then we "versickern" this small element, until the heap condition is restored. 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 one get a lower bound for the function \(n!\) ?
One could simply take only 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 one get a lower bound for the function \(n!\) ?
Back
One could simply take only 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 Bellman-Ford 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 Bellman-Ford 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 datastructure 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 datastructure 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\)}}.
Once the DP table is filled, backtracking reconstructs the actual solution (not just the optimal value) by tracing which choices led to each cell.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is "backtracking" in DP problems?
Back
Once the DP table is filled, backtracking reconstructs the actual solution (not just the optimal value) by tracing which choices led to each cell.<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>
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).
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">
How can I find the asymptotic behavior of a sum like \(\sum_{i = 1}^{^{\lceil \sqrt{n} \rceil}} \sqrt{i}\)?
Sum and integral have the same asymptotic behavior (not covered in lecture)!
\[\begin{align}
\sum_{i=1}^{\lceil \sqrt{n} \rceil} \sqrt{i}
&\sim \int_1^{\lceil \sqrt{n} \rceil} \sqrt{x}\,dx \\
&= \left[\frac{2}{3}x^{3/2}\right]_1^{\lceil \sqrt{n} \rceil} \\
&= \frac{2}{3}\bigl(\lceil \sqrt{n} \rceil^{3/2} - 1\bigr) \\
&\sim \frac{2}{3}\bigl(n^{1/2}\bigr)^{3/2} \\
&= \Theta(n^{3/4}).
\end{align}\]
(We use \(\sim\) to denote asympotic equivalence. Correct but verbose would be to wrap everything in \(\Theta\))
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can I find the asymptotic behavior of a sum like \(\sum_{i = 1}^{^{\lceil \sqrt{n} \rceil}} \sqrt{i}\)?
Back
Sum and integral have the same asymptotic behavior (not covered in lecture)!<br><br>\[\begin{align}
\sum_{i=1}^{\lceil \sqrt{n} \rceil} \sqrt{i}
&\sim \int_1^{\lceil \sqrt{n} \rceil} \sqrt{x}\,dx \\
&= \left[\frac{2}{3}x^{3/2}\right]_1^{\lceil \sqrt{n} \rceil} \\
&= \frac{2}{3}\bigl(\lceil \sqrt{n} \rceil^{3/2} - 1\bigr) \\
&\sim \frac{2}{3}\bigl(n^{1/2}\bigr)^{3/2} \\
&= \Theta(n^{3/4}).
\end{align}\]<br>
(We use \(\sim\) to denote asympotic equivalence. Correct but verbose would be to wrap everything in \(\Theta\))
2-3 Tree: We deleted a node and now it's sibling is an only child. What happens if it's neighbor has 3 keys?
Our current node adopts one of the children. The separators have to be updated by “rotating them”. The parent sep moves with the adopted and the left sep becomes the new parent).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<b>2-3 Tree</b>: We deleted a node and now it's sibling is an only child. What happens if it's neighbor has 3 keys?
Back
Our current node adopts one of the children. The separators have to be updated by “rotating them”. The parent sep moves with the adopted and the left sep becomes the new parent).<br><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 for a 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):
We can build one backwards, by always finding a vertex which has no succeeding vertices, removing it from the graph and adding 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
We can build one backwards, by always finding a vertex which has no succeeding vertices, removing it from the graph and adding it to the front of our topologically sorted list.<br><br>This is not possible if there is a directed cycle in the graph.
This trick works even if every term has a constant coefficient.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can you find the upper bound of a geometric series like \(T = 7^1, 7^2, \ldots, 7^n\)?
Back
Use the multiply-subract trick.<br><ol><li>Mutliply the series by its base: \(7T\)</li><li>Subtract: \(7T - T = 7^{n+1} - 7^1\) (middle terms cancel)</li><li>Factor: \(T(7-1) = 7^{n+1} - 7^1\)</li><li>Divide: \(T = \frac{7^{n+1} - 7^1}{6}\)</li></ol><div>This trick works even if every term has a constant coefficient.</div>
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. <br><br>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 equals the 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 equals the <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>
DFS Pseudocode needs to include a for loop over all unmarked nodes, when we're not sure whether the graph is connected.
Otherwise we aren't visiting ZHKs that aren't connected to our chosen first node.
DFS(g):
all vertices unmarked
for u unmarked:
visit(u)
visit(u):
mark u
for v adjacent to u:
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
DFS Pseudocode needs to include {{c1:: a for loop over all unmarked nodes}}, when we're not sure whether the graph is connected.
Extra
Otherwise we aren't visiting ZHKs that aren't connected to our chosen first node.<pre><code>DFS(g):
all vertices unmarked
for u unmarked:
visit(u)
visit(u):
mark u
for v adjacent to u:
</code></pre><pre><code><br></code></pre>
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">
We use \(\Theta(n^2)\) comparisons and \(O(n^2)\) switches.
Invariant
Nach \(j\) Durchläufen der äusseren Schleife sind die \(j\) grössten Elemente am richtigen Ort.
Worst Case Scenario
Array sorted in descending order
Attributes
In-Place<br>Stable<br><div><br></div>
<div>An algorithm is in-place if it uses only a constant amount of extra memory (i.e., O(1) additional space), beyond the input itself. It modifies the input data structure directly rather than creating a copy. </div><div><br></div><div>An algorithm is <em>stable</em> if it preserves the relative order of elements with equal keys. If two elements have the same value, they appear in the same order in the output as they did in the input.<br></div>
<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>
Replacing \(v\) and \(w\) by a single vertex \(vw\)
Replacing any edge \(\{v,x\}\) or \(\{w, x\}\) by \(\{vw, x\}\).
Set the weights to their previous ones, and the minimum if there was more than one.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is <b>contracting</b> an edge?
Back
We contract \(\{v, w\}\) by:<br><ol><li>Replacing \(v\) and \(w\) by a single vertex \(vw\)</li><li>Replacing any edge \(\{v,x\}\) or \(\{w, x\}\) by \(\{vw, x\}\).</li><li>Set the weights to their previous ones, and the minimum if there was more than one.</li></ol>
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}}.
After adding \(x\) edges to the Union-Find datastructure, the repr array contains \(n-x\) components (different values).
Each added edge removes one unconnected component.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
After adding \(x\) edges to the Union-Find datastructure, the <b>repr</b> array contains {{c1::\(n-x\) components (different values)}}.
Extra
Each added edge <i>removes one unconnected component</i>.
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 those rounded profits: \(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\).
We then only have to compute every K'th entry of 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 those rounded profits:<br>\(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\). <br><br>We then only have to compute every K'th entry of 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><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 a pointer to the next element in the list instead.
We also have an extra pointer to the end.
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 next element in the list instead}}.<br><br>We also have {{c3::an extra pointer to the end}}.
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 necessarily balanced, hence it is 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 necessarily <b>balanced</b>, hence it is possible that \(h >> \log_2 n\).<br><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 once 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>
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 {{c1:: \(d[v] = \min \{d[v], w(v*, v)\}\) instead of \(d[v^*] + w(v^*, v)\) }}.
Dijkstra's find the shortest distance to each vertex, thus it tracks the total distance.
Prim's needs to build the MST. Since we add vertex \(v\) to the MST in the loop, we now want to know the new least distance to the MST for each node.
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] = \min \{d[v], 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 distance.<br><br>Prim's needs to build the MST. Since we add vertex \(v\) to the MST in the loop, we now want to know the new least distance to the MST for each node.
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><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)\)}}.
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.<br><br>Note that (negative) cycles are accepted, as we are looking for the "shortest" (not cheapest) path.
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, since 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, since 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((|V| + |E|) \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>
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>
No, as \(\{b, c\}\) does not have a greatest lower bound. Both \(a\) and \(e\) would fit, but there isn't a greatest one.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Is this a lattice?<br><br> <img src="paste-055f63c858350a5edd9d53fae73e8b5c5e237b32.jpg">
Back
No, as \(\{b, c\}\) does not have a greatest lower bound. Both \(a\) and \(e\) would fit, but there isn't a <b>greatest</b> one.
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) = 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) = 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>
To prove an isomorphism \(\phi: G \rightarrow H\), we need to prove:
Well-definedness
The image of \(\phi\) lies entirely within \(H\)
The homomorphism-property \(\phi(g_1 \cdot g_2) = \phi(g_1) \cdot \phi(g_2)\) holds
Injectivity
Surjectivity
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
To prove an isomorphism \(\phi: G \rightarrow H\), we need to prove:<br><ol><li>{{c1::Well-definedness}}</li><li>{{c2::The image of \(\phi\) lies entirely within \(H\)}}<br></li><li>{{c3::The homomorphism-property \(\phi(g_1 \cdot g_2) = \phi(g_1) \cdot \phi(g_2)\) holds}}<br></li><li>{{c4::Injectivity}}</li><li>{{c5::Surjectivity}}</li></ol>
What does it mean for a function \(f: A \to B\) to be injective?
For \(a \neq a'\) we have \(f(a) \neq f(a')\).
No two distinct values are mapped to the same function value (no "collisions"). This is also called "one-to-one".
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does it mean for a function \(f: A \to B\) to be injective?
Back
For \(a \neq a'\) we have \(f(a) \neq f(a')\). <br><br>No two distinct values are mapped to the same function value (no "collisions"). This is also called "one-to-one".
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.
A formula in 1st order logic with no logical connectives (like \(\lnot, \land, \lor, \rightarrow \)) and no quantifiers (\(\forall, \exists\))
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>}}.
Extra
A formula in 1st order logic with <b>no logical connectives</b> (like \(\lnot, \land, \lor, \rightarrow \)) and <b>no quantifiers</b> (\(\forall, \exists\))
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>
What is the logical principle behind case distinction?
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 principle behind 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 \mid a \land d \mid b \land \forall c \ ((c \mid a \land c \mid b) \rightarrow c \mid 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 \mid a \land d \mid b \land \forall c \ ((c \mid a \land c \mid b) \rightarrow c \mid 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\)}}.
How is Euclidian division of polynomials in a field defined?
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>How is Euclidian division of polynomials in a field defined?</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>
In a Euclidean domain every element can be factored uniquely into irreducible elements (up to associates)
\(a, b\) associates (\(a \sim b\)) if \(a = ub\) for some unit \(u\).
Proof sketch:
Consider a nonzero, nonunit \(a \in R\).
If a is irreducible, we are done.
Otherwise, \(a = bc\) with both \(b,c\) nonunits.
By the Euclidean property, we may assume
\(\delta(b), \delta(c) < \delta(a)\).
If either factor is reducible, factor it further.
This process must terminate, since \(\delta\) takes values in \(\mathbb{N}\) and strictly decreases.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a Euclidean domain every element can be {{c1:: factored uniquely into irreducible elements (up to associates)}}
Extra
\(a, b\) associates (\(a \sim b\)) if \(a = ub\) for some unit \(u\).<br><br><b>Proof sketch:<br></b><div><ol><li>
<div>Consider a nonzero, nonunit \(a \in R\).</div>
</li><li>
<div>If a is irreducible, we are done.</div>
</li><li>
<div>Otherwise, \(a = bc\) with both \(b,c\) nonunits.</div>
</li><li>
<div>By the Euclidean property, we may assume </div>\(\delta(b), \delta(c) < \delta(a)\).</li><li>
<div>If either factor is reducible, factor it further.</div>
</li><li>
<div>This process <b>must terminate</b>, since \(\delta\) takes values in \(\mathbb{N}\) and strictly decreases.</div></li></ol></div>
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></p><ol><li>{{c2::The set \(\{e\}\) (containing only the neutral element)}}</li><li>{{c3::\(G\) itself}}</li></ol>
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.
Uncountability Proof by Complement (with example \([0,1] \setminus \mathbb{Q}\)):
Find \(B\) uncountable such that \(A \subseteq B\).
Show that \(B \backslash A\) countable which proves that \(A\) uncountable.
You have to prove this implication in the exam:
Assume \(A\) is countable towards contradiction.
We have shown that \(B \ \backslash \ A\) is countable.
Thus \(A \cup (B \ \backslash \ A)\) also countable (Theorem 3.22: Union of countable is countable).
But \(A \cup (B \ \backslash \ A) \supseteq B\), which is uncountable - contradiction!
Verwende \(\mathbb{R}\) oder \([0,1]\) statt \(\{0, 1\}^\infty\) falls einfacher.
Beispiel mit \([0,1] \setminus \mathbb{Q}\):
We know \([0,1]\) is uncountable.
By definition \([0, 1] \setminus \mathbb{Q} \subseteq [0,1]\) and \([0,1] \setminus ([0,1] \setminus \mathbb{Q})\) which is equal to \(\mathbb{Q} \cap [0,1]\). Thus \(\mathbb{Q} \cap [0,1] \subseteq \mathbb{Q}\) and by Lemma 3.15 \(\mathbb{Q} \cap [0,1] \preceq \mathbb{Q}\) (subset is dominated).
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.
Proof: \(L\) left inverse, \(R\) right inverse.
\(L = L * e = L * (a * R) \) \(= (L * a) * R = e * R = R\)
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><p><b>Proof: </b>\(L\) left inverse, \(R\) right inverse.</p><p>\(L = L * e = L * (a * R) \) \(= (L * a) * R = e * R = R\)</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.
What happens if there is a left and right neutral element in a group?
Lemma 5.1: If \(\langle S; * \rangle\) has both a left and a right neutral element, then they are equal.
\(e * e' = e\) (\(e'\) right inverse)
\(e * e' = e'\) (\(e\) left inverse)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What happens if there is a left and right neutral element in a group?
Back
<p><strong>Lemma 5.1</strong>: If \(\langle S; * \rangle\) has both a left and a right neutral element, then they are <strong>equal</strong>.</p><p>\(e * e' = e\) (\(e'\) right inverse)</p><p>\(e * e' = e'\) (\(e\) left inverse)</p>
State Corollary 5.9 about the relationship between element order and group order for a finite group \(G\). (Proof included)
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\). <i>(Proof included)</i></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>
Consider the poset \((A; \preceq)\) and \( S \subseteq A\).
\(a \in A\) is a lower (upper) bound of \(S\) if \(a \preceq b\) (\(a \succeq b) \) 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
Consider the poset \((A; \preceq)\) and \( S \subseteq A\).<br><br><div>\(a \in A\) is a {{c1::<b>lower (upper) bound</b> of \(S\)}} if {{c2::\(a \preceq b\) (\(a \succeq b) \) 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)\)
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><ol><li>{{c1::\((\forall x \, F) \land H\)}} \( \equiv\) {{c2::\( \forall x \, (F \land H)\)}}</li><li>{{c3::\((\forall x \, F) \lor H \)}} \(\equiv\) {{c4::\(\forall x \, (F \lor H)\)}}</li><li>{{c5::\((\exists x \, F) \land H \)}} \(\equiv\) {{c6:: \(\exists x \, (F \land H)\)}}</li><li>{{c7::\((\exists x \, F) \lor H\)}} \(\equiv\) {{c8:: \(\exists x \, (F \lor H)\)}}</li></ol>
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 Fermat's little theorem.
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 <b>number and the order of the group</b> (modulo remainder) to be <i>coprime</i>, i.e. \(\gcd(9, 11) = 1\).<br><br><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 Fermat's little theorem.</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".
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><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 \(\gcd(a, m)=1\), it is an element of \(\mathbb{Z}_m^*\) and thus an element of a group. \(\langle a \rangle\) therefore must be a subgroup with an order that divides \(\mathbb{Z}_m^* = \varphi(m)\)\(\iff \varphi(m) = \operatorname{ord}(a) \cdot k\) (Lagrange's) .
<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 \(\gcd(a, m)=1\), it is an element of \(\mathbb{Z}_m^*\) and thus an element of a group. \(\langle a \rangle\) therefore must be a subgroup with an order that divides \(\mathbb{Z}_m^* = \varphi(m)\)\(\iff \varphi(m) = \operatorname{ord}(a) \cdot k\) (Lagrange's) .</p><p>\(\implies (a^{\operatorname{ord}(a)})^k = a^{\varphi(m)} \equiv_m 1\)</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::\[{{c1::\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::\[{{c1::\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::\[{{c1::\mathcal{K}(F)}} = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
If the prime factorization of \(m\) is \(m = \prod_{i=1}^r p_i^{e_i}\) then \(\varphi(m)\) is?
\[\varphi(m) = \prod_{i=1}^r (p_i - 1)p_i^{e_i - 1}\] Explanation: For primes: a number is not coprime to \(p^e\) \(\iff\) it contains a factor of \(p\). These are \(p, 2p, 3p, \ldots, p^{e-1}p\) (exactly \(p^{e-1}\) numbers) \(\implies\)\(\varphi(p^e) = p^e - p^{e - 1} = (p-1)p^{e-1}\) For all numbers: \(\varphi(mn)=\varphi(m)\varphi(n)\) if \(m\) and \(n\) are coprime, so we end up w/ a product.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>If the prime factorization of \(m\) is \(m = \prod_{i=1}^r p_i^{e_i}\) then \(\varphi(m)\) is?</p>
Back
\[\varphi(m) = \prod_{i=1}^r (p_i - 1)p_i^{e_i - 1}\]<br><b>Explanation:<br></b><i>For primes:</i> a number is not coprime to \(p^e\) \(\iff\) it contains a factor of \(p\). These are \(p, 2p, 3p, \ldots, p^{e-1}p\) (exactly \(p^{e-1}\) numbers) \(\implies\)\(\varphi(p^e) = p^e - p^{e - 1} = (p-1)p^{e-1}\)<br><i>For all numbers:</i> \(\varphi(mn)=\varphi(m)\varphi(n)\) if \(m\) and \(n\) are coprime, so we end up w/ a product.<br>
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\)? How can this be proven?
\(\mathbb{Z}_n\) is generated by all \(a \in \mathbb{Z}_n\) for which \(\gcd(a, n) = 1\) (all elements coprime to \(n\)).
Proof:
\(a\) generator \(\implies\)\(\gcd(a, n) = 1\) \(\mathbb{Z}_n = \langle a \rangle\) \(\implies\)\(1 \in \langle a \rangle\) \(\implies\)\(a^u = au \equiv_n 1\) for some \(u\) \(\implies\)\(\gcd(a, n) = 1\) (\(\gcd\) must divide both \(au-qn\) and 1).
\(\gcd(a, n) = 1 \implies\)\(a\) generator \(\gcd(a, n) = 1\) \(\implies\)\(ua + un = 1\) for some \(u, n\) (Bézout) \(\implies\)\(ua = a^u \equiv_n 1\) \(\implies\)for every element \(b\), \(\exists c\) s.t. \(b = c \cdot u \cdot a = (a^u)^c = a^{u \cdot c}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Which elements generate \(\mathbb{Z}_n\)? How can this be proven?</p>
Back
<p>\(\mathbb{Z}_n\) is generated by <strong>all \(a \in \mathbb{Z}_n\) for which \(\gcd(a, n) = 1\)</strong> (all elements coprime to \(n\)).</p>
<p><strong>Proof:</strong></p><p>\(a\) generator \(\implies\)\(\gcd(a, n) = 1\)<br>\(\mathbb{Z}_n = \langle a \rangle\)<br>\(\implies\)\(1 \in \langle a \rangle\)<br>\(\implies\)\(a^u = au \equiv_n 1\) for some \(u\)<br>\(\implies\)\(\gcd(a, n) = 1\) (\(\gcd\) must divide both \(au-qn\) and 1).</p>\(\gcd(a, n) = 1 \implies\)\(a\) generator<br>\(\gcd(a, n) = 1\)<br>\(\implies\)\(ua + un = 1\) for some \(u, n\) (Bézout)<br>\(\implies\)\(ua = a^u \equiv_n 1\)<br>\(\implies\)for every element \(b\), \(\exists c\) s.t. \(b = c \cdot u \cdot a = (a^u)^c = a^{u \cdot c}\)
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}}: </p><p>{{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)\]}}
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)\]}}
\((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology
{{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><ol><li>{{c1::\(\{F_1, \dots, F_k\} \models G\)}}</li><li>{{c2::\((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology}}</li><li>{{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.</li></ol>
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><ol><li>{{c2::An atomic formula is a formula}}</li><li>If \(F\) and \(G\) are formulas, then also {{c3::\(\lnot F\), \(F \lor G\), \(F \land G\)}}.</li></ol>
How can we test whether 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 whether 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 assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \({{c1(F) \subseteq \{1, \dots, k\}\) of the indices}}.
The semantics of a logic defines a function \(free\) which assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \({{c1(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 \({{c1::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\).
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
Consider the poset \((A;\preceq)\). <br><br>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
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:</p><ol><li>{{c2::G1 (associativity)}}</li><li>{{c3::G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).}}</li><li>{{c4::G3 (inverse) G3' -> you only need to prove the existence of a right inverse}}</li></ol>
What exponentiation operation is valid in modular arithmetic?
This is allowed:
\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)
But this on the other hand is illegal:
\(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
This is allowed:<br><ul><li>\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)<br></li></ul><div>But this on the other hand is illegal:</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::R<b>ectify</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\)?
Complete relation \(A \times A\) → single equivalence class \(A\)
{{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><ol><li>{{c1:: <strong>Complete relation</strong> \(A \times A\) → single equivalence class \(A\)}}</li><li>{{c2:: <strong>Identity relation</strong> → equivalence classes are all singletons \(\{a\}\)}}</li></ol>
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]\):: Substitution}}</li><li>{{c3::\(\exists x G\)}}\(\equiv\){{c4::\(\exists y G[x/y]\):: Substitution}}</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>
An integral domain is a commutative ring without zerodivisors (\( \forall a \ \forall b \quad ab = 0 \rightarrow a = 0 \lor b = 0\) ).
A domain of elements behaving like integers.
Examples: \(\mathbb{Z}, \mathbb{R}\)
Counterexample: \(\mathbb{Z}_m, m\) not prime
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
An {{c1::integral domain}} is a {{c2::commutative ring without zerodivisors (\( \forall a \ \forall b \quad ab = 0 \rightarrow a = 0 \lor b = 0\) ).}}
Extra
<div><i>A domain of elements behaving like integers.</i></div><br>Examples: \(\mathbb{Z}, \mathbb{R}\)<div>Counterexample: \(\mathbb{Z}_m, m\) not prime</div>
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?
Set notation (subset of \(A \times B\))
Boolean matrix (1 if \((a,b) \in \rho\), 0 otherwise)
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><ol><li>{{c1:: <strong>Set notation</strong> (subset of \(A \times B\))}}</li><li>{{c2:: <strong>Boolean matrix</strong> (1 if \((a,b) \in \rho\), 0 otherwise)}}</li><li>{{c3:: <strong>Directed graph</strong> (nodes are elements, edges are relations)}}</li></ol>
State Lemma 5.18 about the units of a ring and the property their set satisfies? (Proof included)
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 their set satisfies? <i>(Proof included)</i></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 .
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 {{c1::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}\)
Non-trivial: {0} is not a field. In particular, 1 = 0 (neutral element of mult. = neutral element of add.) causes trouble.
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
<b>Example:</b> \(\mathbb{R}\), but not \(\mathbb{Z}\)<br><br><b>Non-trivial:</b> {0} is not a field. In particular, 1 = 0 (neutral element of mult. = neutral element of add.) causes trouble.
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>
<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><p><b>Explanation:</b> <br>You can easily create an isomophism. For any\([a], [b] \in \mathbb{Z}_n\),</p><p>\(\varphi([a] + [b]) = \varphi([a+b])\)\(= g^{a+b} = g^a g^b = \varphi([a]) \varphi([b]).\)</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.
What are the restrictions on the universe \(U\) of an interpretation?
cannot be empty
not necessarily a set (can be the universe of all sets, which is a proper class, for example)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What are the restrictions on the universe \(U\) of an interpretation?
Back
<ul><li><b>cannot be empty</b></li><li>not necessarily a <i>set </i>(can be the universe of all sets, which is a proper class, for example)</li></ul>
Give the formal definition of "\(a\) divides \(b\)" (denoted \(a \mid b\)).
\[a \mid 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 \mid b\)).
Back
\[a \mid 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\).
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 a {{c1::subset}} of {{c1::\(A\times B\).}} <br><br>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}\) (since you need at least two primes for a composite integer, and \(n = \sqrt{n} \cdot \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}\) (since you need at least two primes for a composite integer, and \(n = \sqrt{n} \cdot \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>}}. <br><br>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\), a variable \(x\) and a term \(t\), {{c1::\(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)
The Diffie-Hellman Key-Agreement selects two public values:
a large prime \(p\)
a basis \(g\), which is then exponentiated
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The Diffie-Hellman Key-Agreement selects two public values:<br><ol><li>{{c1:: a large prime \(p\)}}</li><li>{{c2:: a 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)
What are the three properties of an equivalence relation?
Reflexivity
Symmetry
Transitivity
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What are the three properties of an equivalence relation?<br><ol><li>{{c1::Reflexivity}}<br></li><li>{{c2::Symmetry}}<br></li><li>{{c3::Transitivity}}<br></li></ol>
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><ul><li>{{c1::\(\mathcal{A}(F) = \mathcal{A}(A_i)\) for any atomic formula \(A_i\)}}</li></ul>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, \psi, \xi)\) where:
\(U\) is a non-empty universe
\(\phi\) (phi) assigns function symbols to functions \(U^k \rightarrow U\)
{{c3::\(\psi\) (psi) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}}
\(\xi\) (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, \psi, \xi)\) where:<br><ol><li>{{c1::\(U\) is a <b>non-empty</b> universe}}</li><li>{{c2::\(\phi\) (phi) assigns function symbols to functions \(U^k \rightarrow U\)}}</li><li>{{c3::\(\psi\) (psi) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}}</li><li>{{c4::\(\xi\) (xi) assigns variable symbols to values in \(U\)}}</li></ol>
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\)?
The number of divisors of \(n\) (as the order of each subgroup divides the group order (which is n here) by Lagrange).
If \(n\) is written \(n = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\).
Note: This only holds because \(\mathbb{Z}_n\) is cyclic and therefore the subgroups are unique.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the number of subgroups of \(\mathbb{Z}_n\)?
Back
The number of divisors of \(n\) (as the order of each subgroup divides the group order (which is n here) by Lagrange). <br><br>If \(n\) is written \(n = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\).<br><br><i>Note:</i> This only holds because \(\mathbb{Z}_n\) is cyclic and therefore the subgroups are unique.
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\).
neutral to neutral: \(\psi(e_G) = e_h\)
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 </p><ul><li>{{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).</li><li>{{c1::neutral to neutral: \(\psi(e_G) = e_h\)}}</li></ul>
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 function \(f: A \rightarrow B\) has a right inverse if and only if \(f\) is surjective (not in script).
We can create a function \(g\) that outputs a unique value in \(A\) for every input \(b\). We can then revert it with \(f\). Therefore, \(\forall (f \circ g) b = b \iff f \circ g = \text{id}_B\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>A function \(f: A \rightarrow B\) has a {{c1::right inverse}} if and only if \(f\) is {{c2::surjective}} (not in script).</p>
Extra
We can create a function \(g\) that outputs a unique value in \(A\) for every input \(b\). We can then revert it with \(f\). Therefore, \(\forall (f \circ g) b = b \iff f \circ g = \text{id}_B\)
\(\psi(g_1 \cdot g_2) = \psi(g_1) + \psi(g_2)\) for all \(g_1, g_2\) in \(G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>To verify the {{c1::homomorphism property}}, check that: </p><p>{{c2::\(\psi(g_1 \cdot g_2) = \psi(g_1) + \psi(g_2)\)}} for all \(g_1, g_2\) in \(G\).</p>
A monoidis an algebra \( \langle S; *, e \rangle\) where \(*\) is associative and \(e\) is the neutral element.
Difference to group: Absence of inverse
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>
We take the field \(GF(p)[x]_{m(x)}\) where \(m(x)\) is an irreducible polynomial of degree \(q\).
Then \(GF(p)[x]_{m(x)}\) has \({|F|}^q\) polynomials in it, as all of degree less than \(q\) are coprime to \(m(x)\), by definition of irreducible. And this field is isomorphic to \(GF(p^q)\).
Example: The field \(GF(2)[x]\) \({x^2 + x + 1}\) is isomorphic to \(GF(2^2 = 4)\).
We can see this is the case as \(GF(2)[x]_{x^2 + x + 1}\) has \(4\) elements, \(\{0, 1, x, x + 1\}\), which we can basically map to \(GF(4)\) as \(\{0, 1, 2, 3\}\).
Indeed \(1 + x = x + 1\) in \(GF(2)[x]_{x^2 + 1 + 1}\) and \(1 + 2 = 3\) which is \(x + 1\) in the isomorphism.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we construct a field \(GF(p^q)\)?
Back
We take the field \(GF(p)[x]_{m(x)}\) where \(m(x)\) is an irreducible polynomial of degree \(q\).<br><br>Then \(GF(p)[x]_{m(x)}\) has \({|F|}^q\) polynomials in it, as all of degree less than \(q\) are coprime to \(m(x)\), by definition of irreducible. <br>And this field is isomorphic to \(GF(p^q)\).<br><br><div>
<strong>Example</strong>: The field \(GF(2)[x]\) \({x^2 + x + 1}\) is isomorphic to \(GF(2^2 = 4)\). </div><div>We can see this is the case as \(GF(2)[x]_{x^2 + x + 1}\) has \(4\) elements, \(\{0, 1, x, x + 1\}\), which we can basically map to \(GF(4)\) as \(\{0, 1, 2, 3\}\).</div><div><br></div><div>Indeed \(1 + x = x + 1\) in \(GF(2)[x]_{x^2 + 1 + 1}\) and \(1 + 2 = 3\) which is \(x + 1\) in the isomorphism.</div>
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\)}}.
Russell's Paradox proposes the (problematic) set \(R=\) {{c1::\(R = \{ A \mid A \notin A \}\)}}.
Assume R contains itself
Then R should not contain itself (because R only contains sets that do not contain themselves).
➜ Contradiction.
Assume R does not contain itself
Then it does meet the rule for membership in R, so it should contain itself.
➜ Contradiction.
A barber that shaves all and only those men who do not shave themselves. Does he shave himself?
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Russell's Paradox proposes the (problematic) set \(R=\) {{c1::\(R = \{ A \mid A \notin A \}\)}}.
Extra
<div><ol><li>
<div><b>Assume R contains itself</b><b></b></div>
<div>Then R should <i>not</i> contain itself (because R only contains sets that do not contain themselves).</div>
<div>➜ Contradiction.</div>
</li><li>
<div><b>Assume R does not contain itself</b><b></b></div>
<div>Then it <i>does</i> meet the rule for membership in R, so it should contain itself.</div>
<div>➜ Contradiction.</div></li></ol></div><i>A barber that shaves all and only those men who do not shave themselves. Does he shave himself?</i><br>
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><br>{{c1::\(\psi(a*b) = \psi(a)\star\psi(b)\)}}.<br><br>If \(\psi\) is {{c2::a bijection from \(G\) to \(H\)}}, then it is called an <i>isomorphism</i>.
Derivation/inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)::Notation}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Derivation/inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)::Notation}} 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><i>inference</i> rule: <br>{{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)::Notation}} 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, \(\psi\) assigns {{c2::predicate symbols \(P\) to functions, \(\psi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
In predicate logic interpretation, \(\psi\) assigns {{c2::predicate symbols \(P\) to functions, \(\psi(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::\(\psi\)}} assigns {{c2::<b>predicate</b> symbols \(P\) to functions, \(\psi(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})\]}}
Which group operations work for \(\mathbb{Z}_m\) and \(\mathbb{Z}_m^*\)?
\(\mathbb{Z}_m\)
\(\mathbb{Z}_m^*\)
\(\oplus\)
Yes (forms a group)
No
\(\odot\)
No
Yes (forms a group)
Key point: \(\mathbb{Z}_m\) with addition \(\oplus\) is a group. \(\mathbb{Z}_m^*\) (coprime elements) with multiplication \(\odot\) is a group.
\(\mathbb{Z}_m^*\) is not a group under addition b/c it doesn't contain the neutral element 0.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Which group operations work for \(\mathbb{Z}_m\) and \(\mathbb{Z}_m^*\)?</p>
Back
<table>
<thead>
<tr>
<th></th>
<th>\(\mathbb{Z}_m\)</th>
<th>\(\mathbb{Z}_m^*\)</th>
</tr>
</thead>
<tbody>
<tr>
<td>\(\oplus\)</td>
<td><strong>Yes</strong> (forms a group)</td>
<td>No</td>
</tr>
<tr>
<td>\(\odot\)</td>
<td>No</td>
<td><strong>Yes</strong> (forms a group)</td>
</tr>
</tbody>
</table>
<p><strong>Key point</strong>: \(\mathbb{Z}_m\) with addition \(\oplus\) is a group. \(\mathbb{Z}_m^*\) (coprime elements) with multiplication \(\odot\) is a group.</p><p>\(\mathbb{Z}_m^*\) is not a group under addition b/c it doesn't contain the neutral element 0.</p>
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. <br><br>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:
Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\)
{{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><ol><li>{{c1::Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\)}}</li><li>{{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}</li></ol>
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}}.
A set of symbols \(\mathcal{Z} \subseteq \Lambda\)
\(\Lambda\) is the "alphabet" or collection of all available symbols
\(\mathcal{Z}\) is the subset of symbols we're actually interpreting
A domain for each symbol
For each symbol in \(\mathcal{Z}\), there's a set of possible values it could take
Often the domain is defined in terms of the universe \(U\) where a symbol can be a function, predicate or element of \(U\).
An assignment function
For each symbol in \(\mathcal{Z}\), the function picks one specific value from its domain
This gives meaning to each symbol
An interpretation can be described either as
one big assignment function over typed symbols, or
a structured tuple that spells out those assignments separately.
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
<ol><li><b>A set of symbols</b> \(\mathcal{Z} \subseteq \Lambda\)<ul>
<li>\(\Lambda\) is the "alphabet" or collection of all available symbols
</li>
<li>\(\mathcal{Z}\) is the subset of symbols we're actually interpreting
</li>
</ul>
</li>
<li><b>A domain for each symbol</b>
<ul>
<li>For each symbol in \(\mathcal{Z}\), there's a set of possible values it could take
</li>
<li>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\).<br><ol></ol></li>
</ul>
</li>
<li><b>An assignment function</b>
</li><ul>
<li>For each symbol in \(\mathcal{Z}\), the function picks one specific value from its domain
</li>
<li>This gives meaning to each symbol</li></ul></ol><b>An interpretation can be described either as</b><br><ul><li>one big assignment function over typed symbols,<b> or</b><br></li><li>a structured tuple that spells out those assignments separately.</li></ul><ol>
<h2></h2></ol>
This is important as \((\rho \circ \tau) \circ (\rho \circ \tau) = \rho \circ (\tau \circ \rho) \circ \tau\) is really useful in some exercises.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Relation and function composition is {{c1::associative}}.
Extra
This is important as \((\rho \circ \tau) \circ (\rho \circ \tau) = \rho \circ (\tau \circ \rho) \circ \tau\) is really useful in some exercises.
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.
---
\(F\) should evaluate to true if we don't have the first zero row, not the second zero row, and so on. De Morgan flips the conjunction of the literals to a disjunction and adds the negation.
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.<br><br>---<br><br>\(F\) should evaluate to true if we don't have the first zero row, not the second zero row, and so on. De Morgan flips the conjunction of the literals to a disjunction and adds the negation.
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\).
Propositional logic is (in relation to predicate logic):
embedded into predicate logic as a special case. We extend it by the concept of predicates.
Predicates of the form \(P()\) act as propositional symbols.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Propositional logic is (in relation to predicate logic):
Back
<i>embedded</i> into predicate logic as a <i>special case</i>. <br>We extend it by the concept of <b>predicates</b>.<br><br>Predicates of the form \(P()\) act as propositional symbols.
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 (the arity).
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 (the arity).
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 arity)}}.
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 parentheses (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 parentheses (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>}}.
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 it clearly is not injective.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Does every homomorphism have to be injective?</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 it clearly is not injective.</p>
Every element has order 1 or \(|G|\) (Lagrange). Therefore, it is either the neutral element or a generator of the entire group.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>For which order is every group cyclic?</p>
Back
<p>If the <strong>order of the group</strong> is <strong>prime</strong>, it is cyclic!</p><p>Every element has order 1 or \(|G|\) (Lagrange). Therefore, it is either the neutral element or a generator of the entire group.</p>
The set of units of \(R\) is denoted by \(R^*\) and it 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 it 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 {{c1::\(R^*\)}} and it is a {{c3::group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds :: Monoid/Group and why?}}.</p>
Provide 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>Provide 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>
How are the ideals \((a, b)\) and \((a)\) defined?
\[(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
How are the ideals \((a, b)\) and \((a)\) defined?
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>
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\).
Why unique: If there are two solutions, then, for all \(i\): \(x \equiv_{m_i} a_i\) and \(x' \equiv_{m_i} a_i\) \(\implies m_i \mid (x - x')\) for all \(i\) \(\implies M = \prod_{i=1}^{r} m_i \mid (x - x')\) since the \(m_i\) are pairwise coprime \(\implies\) any two solutions differ by a multiple of \(M\) (so there is at most one solution with \(0 \le 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 <b>pairwise relatively prime</b> 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 <b>unique solution</b> \(x\) satisfying \(0 \leq x < M\).<br><br><b>Why unique:</b> <br>If there are two solutions, then, for all \(i\):<br>\(x \equiv_{m_i} a_i\) and \(x' \equiv_{m_i} a_i\) <br>\(\implies m_i \mid (x - x')\) for all \(i\)<br>\(\implies M = \prod_{i=1}^{r} m_i \mid (x - x')\) since the \(m_i\) are pairwise coprime<br>\(\implies\) any two solutions differ by a multiple of \(M\) (so there is at most one solution with \(0 \le x < M\)).<br>
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 \(m\)).
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 \(m\)).</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 \mid 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 \mid 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. (Proof included)
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. <i>(Proof included)</i></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>
So \(f\) is not surjective → no bijection exists → \(A\) uncountable
Key idea: \(b\) differs from the \(n\)-th element in the \(n\)-th position, so it "escapes" any enumeration.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Uncountability Proof by Diagonalisation
Back
<ol>
<li><strong>Assume countable:</strong> Suppose \(f: \mathbb{N} \to A\) is a bijection. Therefore we can enumerate elements of \(A\): \(a_1, a_2, a_3, \ldots\)</li>
<li><strong>Represent elements:</strong> Let \(a_{i,j} \) represent the \(j\)-th number in the \(i\)-th element.<ul>
</ul>
</li>
<li><strong>Construct diagonal element \(b\):</strong> Define \(b\) by setting each element<ul>
<li>We need to have: \(b_i \neq a_{i,i}\) for all \(i\) </li>
<li>\(b_i = 1 - a_{i,i}\) (flip the bit) or \(b_i = \begin{cases} 4 & \text{if } a_{i,i} \neq 4 \\ 5 & \text{if } a_{i,i} = 4 \end{cases}\) (simply change element)</li>
</ul>
</li>
<li><strong>Show \(b\) not in list:</strong> For any \(i\), we have \(b_i \neq a_{i,i}\)
<ul>
<li>Therefore \(b \neq a_i\) for all \(i\)</li>
</ul>
</li>
<li><strong>Contradiction:</strong> But \(b \in A\), yet \(b \notin \{a_1, a_2, \ldots\}\)
<ul>
<li>So \(f\) is not surjective → no bijection exists → \(A\) uncountable</li>
</ul>
</li>
</ol>
<p><strong>Key idea:</strong> \(b\) differs from the \(n\)-th element in the \(n\)-th position, so it "escapes" any enumeration.</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)
In a finite group of order \(|G|\), for \(x^e = y\), \(d\) is the inverse such that \(y^d = x\) iff: (Proof included)
\(ed \equiv_{|G|} 1\), i.e. \(d\) is the multiplicative inverse of \(e\) modulo \(|G|\).
Proof
\(ed = k \cdot |G| + 1\) (multiplicative inverse)
\((x^e)^d = x^{ed} = x^{k\cdot |G| + 1}\)
\((x^{|G|})^k \cdot x = 1^k \cdot x = x\)
Thus this returns \(x\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
In a finite group of order \(|G|\), for \(x^e = y\), \(d\) is the inverse such that \(y^d = x\) iff: <i>(Proof included)</i>
Back
\(ed \equiv_{|G|} 1\), i.e. \(d\) is the multiplicative inverse of \(e\) modulo \(|G|\).<br><br><b>Proof</b><br><ol><li>\(ed = k \cdot |G| + 1\) (multiplicative inverse)</li><li>\((x^e)^d = x^{ed} = x^{k\cdot |G| + 1}\)</li><li>\((x^{|G|})^k \cdot x = 1^k \cdot x = x\)</li></ol><div>Thus this returns \(x\).</div>
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 \(\mathbb{Z}^*_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).
Why it doesn't contradict that every group of prime order is cyclic, with every element except the neutral element being a generator: \(\{2\} \cup [\text{all odd primes}]\)\(= [\text{all primes}]\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
For what \(m\) is \(\mathbb{Z}^*_m\) cyclic? (Theorem 5.15)
Back
The group \(\mathbb{Z}^*_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\)) <br><br><b>Example:</b> Is \(\mathbb{Z}^*_{19}\) cyclic? What is a generator? Yes, \(\mathbb{Z}^*_{19}\) is cyclic (since \(19\) is an odd prime). <br><ul><li>2 is a generator.</li><li>Powers of 2: 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10, 1</li><li>Other generators: 3, 10, 13, 14, 15</li></ul><div><span style="color: rgb(255, 255, 255);"><b>Why it doesn't contradict </b>that every group of prime order is cyclic, with every element except the neutral element being a generator: </span>\(\{2\} \cup [\text{all odd primes}]\)\(= [\text{all primes}]\)</div><div><br></div>
If a ring \(R\) is non-trivial (has more than one element), then \(1 \neq 0\). (Proof in Extra)
Proof: Assume \(1 = 0\) for contradiction. For any \(a \in R\)
\(a = a \cdot 1\)
\(a = a \cdot 0\) (by assumption)
\(a = 0\)
Thus there is only the zero element, which is a contradiction to the non-triviality.
Lemma 5.17(4)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<p>If a ring \(R\) is {{c1::non-trivial (has more than one element)}}, then {{c2::\(1 \neq 0\)}}. <i>(Proof in Extra)</i></p>
Extra
Proof: Assume \(1 = 0\) for contradiction. For any \(a \in R\)<br><ol><li>\(a = a \cdot 1\)</li><li>\(a = a \cdot 0\) (by assumption)</li><li>\(a = 0\)</li><li>Thus there is only the zero element, which is a contradiction to the non-triviality.</li></ol><div><strong>Lemma 5.17(4)</strong><br></div>
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 \mid a\) and \(d \mid m\), then \(d \mid ax\) and \(d \mid km\) for any \(x\). Thus \(d \mid (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 \mid a\) and \(d \mid m\), then \(d \mid ax\) and \(d \mid km\) for any \(x\).<br>Thus \(d \mid (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>
This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\) (same as for the mult. inverse since \(a^{m-1}\) is the inverse).
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
\((a^{\operatorname{ord}(a)})^q \cdot a^r \equiv_n a^r\)<br><br>This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\) (same as for the mult. inverse since \(a^{m-1}\) <i>is</i> the inverse).
What property do the orders of elements in finite groups have?
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.)
Proof: Since the order is finite, elements must repeat. That means, there exist \(m > n \geq 0\) s.t. \(g^m = g^n\) \(\implies g^{m-n} = e\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>What property do the orders of elements in finite groups have?</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><p><b>Proof:</b> Since the order is finite, elements must repeat. That means, there exist \(m > n \geq 0\) s.t. \(g^m = g^n\)<br>\(\implies g^{m-n} = e\)<br></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\).}}
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\).}}
Extra
We know \(a^{\operatorname{order}(a)} \equiv_m 1\). Since \(\operatorname{order}(a)\) divides \(| \mathbb{Z}_m^* | = \varphi(m)\) (Lagrange's), \(a^{\varphi(m)} \equiv_m a^{k \cdot \operatorname{order}(a)} \equiv_m (a^{\operatorname{order}(a)})^k \equiv_m 1^k \equiv_m 1\)<br><br>This theorem is used for RSA.
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')\)}}
The Hasse diagram of a poset \((A; \preceq)\) is defined as 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 defined as 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 defined as {{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?. <i>(Proof included)</i></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. <br><br>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). (Proof Included)
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 \mid p\) and \(p \mid 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; Lagrange).
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). <i>(Proof Included)</i></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 \mid p\) and \(p \mid 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; Lagrange).</p>
Does \( p \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a \) hold? (Proof included)
Yes, but this has to be reproven before using.
The proof technique is important. Replacing a neutral element by something it's equal to often is 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 \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a \) hold? <i>(Proof included)</i>
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 to often is a smart move.<br><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>
Can we apply the CRT to this system? \[\begin{align*} x \equiv_{10} 3 \\ x \equiv_{2} 1 \\ x \equiv_3 2 \end{align*}\]
Yes we can, even though \(\gcd(10, 2) = 2\), as we can decompose \(x \equiv_{10} 3\) into \(x \equiv_5 3\) and \(x \equiv_2 3 \equiv_2 1\) which matches the other equation.
Thus the solution is still unique.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Can we apply the CRT to this system? \[\begin{align*} x \equiv_{10} 3 \\ x \equiv_{2} 1 \\ x \equiv_3 2 \end{align*}\]
Back
Yes we can, even though \(\gcd(10, 2) = 2\), as we can decompose \(x \equiv_{10} 3\) into \(x \equiv_5 3\) and \(x \equiv_2 3 \equiv_2 1\) which matches the other equation. <br><br>Thus the solution is still unique.
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>What is the definition of the prenex form?</b>
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 \(b\)
- Every common divisor of \(a\) and \(b\) divides \(d\)
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 \(b\)<br>
- Every common divisor of \(a\) and \(b\) divides \(d\) </p><p>Formally:\[d \ | \ a \ \land \ d \ | \ b \ \land \ \forall c ((c \ | \ a \ \land \ c \ | \ b) \rightarrow c \ | \ d)\]<br></p>
When is a relation \(\rho\) on set \(A\) irreflexive?
When \(a \ \not\rho \ a\) is true for all \(a \in A\), i.e., \(\rho \cap \text{id} = \emptyset\).
Note that irreflexive is NOT the negation of reflexive!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
When is a relation \(\rho\) on set \(A\) irreflexive?
Back
When \(a \ \not\rho \ a\) is true for all \(a \in A\), i.e., \(\rho \cap \text{id} = \emptyset\).<br><br>Note that irreflexive is NOT the negation of reflexive!
What is the meaning of the multiplicative inverse of some number \(a\) modulo \(m\)?
It is 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 meaning of the multiplicative inverse of some number \(a\) modulo \(m\)?
Back
It is 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\).
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}}. <br><br>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>
<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\)}}
How is Lagrange interpolation for polynomials in a field defined?
Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\) where \(\alpha_i\) distinct for all \(i.\)
\(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{(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}{(\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 \(\alpha_i - \alpha_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>How is Lagrange interpolation for polynomials in a field defined?</p>
Back
<p>Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\) where \(\alpha_i\) distinct for all \(i.\)</p><p><br>\(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{(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}{(\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 \(\alpha_i - \alpha_j \neq 0\) for \(i \neq j\) (as they are all distinct).</p>
Funktion verifizieren: Zeige dass \(f\) well-defined und total ist, und \(f(b) \in A\) für alle \(b\).
Injektivität beweisen: Zeige \(f(b) = f(b’) \ \implies b = b’\) oder direkt \(b \not = b’ \ \implies \ f(b) \not = f(b’)\).
Schluss: We now know \(\{0, 1\}^\infty \preceq A\) as there's an injection. Annahme \(A \preceq \mathbb{N} \implies \{0, 1\}^\infty \preceq \mathbb{N}\) via transitivity -> Contradiction. Thus \(A\) is uncountable: \(\lnot (A \preceq\mathbb{N})\).
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 either {{c1::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 Hamming distance between any two codewords.
The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the minimum 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 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]\).
Result: we can construct a finite field with \(p^d\) elements by using an irreducible polynomial of degree \(d\) to cap the number of coefficients at \(d\)
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><b>Result:</b> we can construct a <strong>finite field</strong> with \(p^d\) elements by using an irreducible polynomial of degree \(d\) to cap the number of coefficients at \(d\)</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 \(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\): \[\psi(a * b) = \psi(a) \star \psi(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\): \[\psi(a * b) = \psi(a) \star \psi(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\): \[\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 {{c3:: the unique \(e\)-th root \(x = y^d\), with \(de \equiv_{|G|} 1\)}}.
Proof:
We have \(ed = k \cdot |G| + 1\) for some \(k\). Thus, for any \(x \in G\) we have\[(x^e)^d = x^{ed} = x^{k \cdot |G| + 1} = \underbrace{(x^{|G|})^k}_{=1} \cdot x = x\]which means that the function \(y \mapsto y^d\) is the inverse function of the function \(x \mapsto x^e\) (which is hence a bijection). The under-braced term is equal to 1 because the order of \(x\) must divide the order of \(G\) (Lagrange).
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><br>For \(x^e = y\), the inverse of \(y\) is {{c3:: the <b>unique</b> \(e\)-th root \(x = y^d\), with \(de \equiv_{|G|} 1\)}}.
Extra
<b>Proof:<br></b><div>We have \(ed = k \cdot |G| + 1\) for some \(k\). Thus, for any \(x \in G\) we have\[(x^e)^d = x^{ed} = x^{k \cdot |G| + 1} = \underbrace{(x^{|G|})^k}_{=1} \cdot x = x\]which means that the function \(y \mapsto y^d\) is the inverse function of the function \(x \mapsto x^e\) (which is hence a bijection). The under-braced term is equal to 1 because the order of \(x\) must divide the order of \(G\) (Lagrange).</div>
An irreducible polynomial has no roots in the field. It has to have degree \(\geq 2\). (Proof included)
Note that this is not a sufficient condition (no roots does not imply irreducible)!
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 has {{c3::no roots}} in the field. It has to have {{c2::degree \(\geq 2\)}}. <i>(Proof included)</i></p>
Extra
<strong>Note that this is not a sufficient condition (no roots does not imply irreducible)!<br><br>Proof</strong>: If it had a root \(\alpha\), then \((x - \alpha)\) would divide it by Lemma 5.29, contradicting irreducibility.
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>
If \(\{a,b\}\) has 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
Consider the poset \((A;\preceq)\). <br><br>If \(\{a,b\}\) has 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))\). <br><br>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).
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>
A euclidean domain is an integral domain \(D\) together with a degree function \(d: D \setminus {0} \rightarrow \mathbb{N}\) such that:
For every \(a\) and \(b \neq 0\) in \(D\) there exist \(q\) and \(r\) such that \(a = bq + r\) and \(d(r) < d(b)\) or \(r = 0\)
For all nonzero \(a\) and \(b\) in \(D\), \(d(a) \leq d(ab)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What's the definition of an Euclidean domain?
Back
<div>A euclidean domain is an integral domain \(D\) together with a degree function \(d: D \setminus {0} \rightarrow \mathbb{N}\) such that:</div><ul><li>For every \(a\) and \(b \neq 0\) in \(D\) there exist \(q\) and \(r\) such that \(a = bq + r\) and \(d(r) < d(b)\) or \(r = 0\)</li><li>For all nonzero \(a\) and \(b\) in \(D\), \(d(a) \leq d(ab)\).</li></ul>
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>
<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>
A prominent example for an uncomputable function is the Halting problem.
Given as input a program (encoded as a bit-string or natural number) together with an input (to the program), determine whether the program will eventually stop (function value 1) or loop forever (function value 0) on that input.
This function is uncomputable. If a halting-decider existed, one could build a program that uses it to do the opposite of what the decider predicts about itself, creating a contradiction: it halts if the halting program returns 0, and does not halt if it returns 1.
This is usually stated as: The Halting problem is undecidable.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A prominent example for an uncomputable function is {{c1::the <i>Halting problem</i>}}<i>.</i>
Extra
Given as input a program (encoded as a bit-string or natural number) together with an input (to the program), determine whether the program will eventually stop (function value 1) or loop forever (function value 0) on that input. <br><br>This function is uncomputable. If a halting-decider existed, one could build a program that uses it to do the <i>opposite</i> of what the decider predicts about itself, creating a contradiction: it halts if the halting program returns 0, and does not halt if it returns 1.<br><br>This is usually stated as: The Halting problem is undecidable.
We can transform every formula into:<br><ul><li>{{c1::P<b>renex</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 elements coprime to the group order.
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 elements coprime to the group order.
You can divide, because 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, because in a field the multiplicative monoid is also a <em>group</em> (without \(0\), thus \(0\) cannot be divided by - no inverse).</p>
What are the three properties of a partial order relation?
Reflexivity
Antisymmetry
Transitivity
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What are the three properties of a partial order relation?<br><ol><li>{{c1:: <b>Reflexivity</b>}}</li><li>{{c2:: <b>Antisymmetry</b>}}</li><li>{{c3:: <b>Transitivity</b>}}</li></ol>
A relation \(\rho\) on a set A is called irreflexive if \(a \ \not \rho \ a\) for all a ∈ A, i.e., if \(\rho \ \cap \ \text{id} = \emptyset\).
Not that this is not the negation of reflexive!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Definition of irreflexive
Back
A relation \(\rho\) on a set A is called <b>irreflexive</b> if \(a \ \not \rho \ a\) for all a ∈ A, i.e., if \(\rho \ \cap \ \text{id} = \emptyset\).<br><br>Not that this is not the negation of reflexive!
Euler's totient function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}
Euler's totient 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
{{c1::Euler's totient function::Name?}} \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}
Give the formal definition of the least common multiple \(\text{lcm}(a, b)\).
\[a \mid l \land b \mid l \land \forall m \ ((a \mid m \land b \mid m) \rightarrow l \mid 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 \mid l \land b \mid l \land \forall m \ ((a \mid m \land b \mid m) \rightarrow l \mid 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 of \(\deg d - 1\) has \(d\) coefficients (from \(0, \dots, d - 1\)), 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 of \(\deg d - 1\) has \(d\) coefficients (from \(0, \dots, d - 1\)), 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 never appear in the same predicate
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 never appear in the same predicate}}</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)\).
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\)}}. <br><br>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><ol><li>{{c2::reflexive}}</li><li>{{c3::antisymmetric}}</li><li>{{c4::transitive}}</li></ol></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 more useful than \(\mathbb{Z}_m\), because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), which we would need for RSA}}.
\(\mathbb{Z}_m^*\) is more useful than \(\mathbb{Z}_m\), because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), which we would need for RSA}}.
Not all elements in \(\mathbb{Z}_m\) have an inverse, something which \(\mathbb{Z}_m^*\) on the other hand guarantees via Bézout.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(\mathbb{Z}_m^*\) is more useful than \(\mathbb{Z}_m\), because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), which we would need for RSA}}.
Extra
Not all elements in \(\mathbb{Z}_m\) have an inverse, something which \(\mathbb{Z}_m^*\) on the other hand guarantees via Bézout.
All \(a \in \mathbb{Z}_n\) such that \(\gcd(a, n) = 1\).<br><div><ul><li>
<div>If \(\gcd(a,n) = d > 1\), then all multiples of a are divisible by d, so you only hit every d-th residue mod n.</div>
</li><li>
<div>If \(\gcd(a,n) = 1\), then multiples of a eventually hit <b>every</b> residue class mod n.</div></li></ul></div>
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). As we can write every formula in CNF (or DNF) this prooves it.
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 <b>CNF</b> (or DNF) then NANDs (by simply replacing). As we can write every formula in CNF (or DNF) this prooves it.
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>.
NO! Antisymmetry is NOT the negation of symmetry. They are independent properties.
A relation is both symmetric and antisymmetric if and only if it's a subset of the identity relation (i.e., \(R \subseteq \{(a, a) : a \in A\}\)). This includes the empty relation \(R = \emptyset\) as a degenerate case.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Is antisymmetric the negation of symmetric?
Back
<strong>NO!</strong> Antisymmetry is NOT the negation of symmetry. They are independent properties.<br><br>A relation is both symmetric and antisymmetric if and only if it's a subset of the identity relation (i.e., \(R \subseteq \{(a, a) : a \in A\}\)). This includes the empty relation \(R = \emptyset\) as a degenerate case.
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
The Diffie-Hellman Key-Agreement 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\) invertible 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>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><p><strong>Counterexample</strong>: The identity matrix \(I_3\) is the unique neutral element for the group of \(3 \times 3\) <i>invertible</i> 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 (b/c \(k\) coefficients = degree \(k-1\) due to the constant part of the polynomial). Two codewords cannot agree at \(k\) positions (else they'd be equal), i.e. they agree at most at \(k-1\) positions, 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 (b/c \(k\) coefficients = degree \(k-1\) due to the constant part of the polynomial). Two codewords cannot agree at \(k\) positions (else they'd be equal), i.e. they agree at most at \(k-1\) positions, 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.
Why: to construct an extension field, use \(\mathbb{Z}_p\) for coefficients. To be a field, \(p\) must be prime. In a polynomial with degree \(k-1\), each coefficient can take any of the \(p\) values from the coefficient field.
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><p><br></p><p><b>Why:</b> to construct an extension field, use \(\mathbb{Z}_p\) for coefficients. To be a field, \(p\) must be prime. In a polynomial with degree \(k-1\), each coefficient can take any of the \(p\) values from the coefficient field.</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)
Explain the mechanical analog of the Diffie-Hellman protocol.
A padlock without a key.
Alice and Bob can exchange their locks (closed) and keep a copy in the open state. Then they can both generate the same configuration, namely the two locks interlocked. For the adversary, this is impossible without breaking open one of the locks.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Explain the mechanical analog of the Diffie-Hellman protocol.
Back
A padlock without a key.<br><br>Alice and Bob can exchange their locks (closed) and keep a copy in the open state. Then they can both generate the same configuration, namely the two locks interlocked. For the adversary, this is impossible without breaking open one of the locks.<br><br><img src="paste-39931b24c512906843c903f461b7c1cc9f5a6685.jpg">
No, \(\langle S; * \rangle\) can have at most one neutral element.
There can be a distinct left and right neutral though. Example: \(3 \times 4\) matrices
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<p>Can there be more than one neutral element?</p>
Back
No, \(\langle S; * \rangle\) can have <strong>at most one neutral element</strong>.<br><br>There can be a distinct left and right neutral though. <br>Example: \(3 \times 4\) matrices
For Diffie-Hellman key agreement, 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 \(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 Diffie-Hellman key agreement, 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 \(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 Diffie-Hellman key agreement, both Alice and Bob {{c1:: choose \(x_A, x_B\) (their private keys) at random}}.<br><br>They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and \(y_B\) analogously, which are their public keys}} which is {{c2:: sent over the network to their partner}}.<br><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>0\) 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>0\) 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>0\) 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 does the Hasse diagram of a poset \((A; \preceq)\) look like?
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 does the Hasse diagram of a poset \((A; \preceq)\) look like?
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\).<br><br><img src="paste-f73994d226c864f7b27dfb8150666efd3d3b8bf6.jpg">
What two properties must a relation \(f: A \to B\) have to be a function?
Total-definedness: \(\forall a \in A \ \exists b \in B : a \ f \ b\)
Well-definedness: \(\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><ol><li>{{c1:: <strong>Total-definedness</strong>: \(\forall a \in A \ \exists b \in B : a \ f \ b\) }}</li><li>{{c2:: <strong>Well-definedness</strong>: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)}}</li></ol>
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, includes neutral element, inverses exist).
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, includes neutral element, 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, includes neutral element, <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 coprime, 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 coprime, GF(q) is <b>not</b> Z_q.</i></p>
no variable occurs both as a bound and as a free variable
all quantifiers use distinct variable names
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><b> quantifiers</b> use distinct variable names}}</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\).
Every proper finite extension field of \(\mathbb{R}\) is 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>Every proper finite extension field of \(\mathbb{R}\) is 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 \mid 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\)\(\implies c_1 = c_2\).
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 \mid 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\)\(\implies c_1 = c_2\).</p>
How does the GCD change when we subtract a multiple? (Lemma 4.2)
Not at all.
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
Not at all.<br><br>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>
Verify that \(\equiv_m\) is reflexive, symmetric, and transitive.
Reflexive: \(a \equiv_m a\) since \(m \mid (a - a) = 0\) ✓
Symmetric: \(a \equiv_m b \Rightarrow m \mid (a-b) \Rightarrow m \mid (b-a) \Rightarrow b \equiv_m a\) ✓
Transitive: If \(m \mid (a-b)\) and \(m \mid (b-c)\), then \(m \mid (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 \mid (a - a) = 0\) ✓}}</li><li><strong>Symmetric</strong>: {{c2:: \(a \equiv_m b \Rightarrow m \mid (a-b) \Rightarrow m \mid (b-a) \Rightarrow b \equiv_m a\) ✓}}</li><li><strong>Transitive</strong>: {{c3:: If \(m \mid (a-b)\) and \(m \mid (b-c)\), then \(m \mid (a-b+b-c) = (a-c)\) ✓}}</li></ul>
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
After they have no roots anymore, try all monic polynomials up to degree d/2 to find irreducible factors.
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>After they have no roots anymore, try all monic polynomials up to degree d/2 to find irreducible factors.</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>
\(a \in A\) is the least (greatest) element of \(A\) if \(a \preceq b\) (\(a \succeq b) \) for all \(b \in A\)
Note that a least or a greatest element need not exist. However, there can be at most one least element, as suggested by the word “the” in the definition.
This follows directly from the antisymmetry of \(\preceq\). If there were two least elements, they would be mutually comparable, and hence must be equal.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Consider the poset \((A; \preceq)\).<br><br><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>
Extra
Note that a least or a greatest element need not exist. However, there can be at most one least element, as suggested by the word “the” in the definition. <br><br>This follows directly from the antisymmetry of \(\preceq\). If there were two least elements, they would be mutually comparable, and hence must be equal.
Thus, it's both an equivalence and a partial order relation!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What properties does the relation \(=\) satisfy?
Back
<ul><li>Reflexivity</li><li>Symmetry</li><li>Antisymmetry</li><li>Transitivity</li></ul><div>Thus, it's both an <b>equivalence and a partial order relation!</b></div>
An <b>abelian group</b> has the following properties:<br><ol><li>{{c1::Closure}}</li><li>{{c2::Associativity}}</li><li>{{c3::Identity}}</li><li>{{c4::Inverse}}</li><li>{{c5::Commutativity}}</li></ol>
Consider the poset \((A; \preceq)\) and \( 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\).
Consider the poset \((A; \preceq)\) and \( 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
Consider the poset \((A; \preceq)\) and \( S \subseteq A\).<br><br><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 F and G are equivalent, i.e., their truth values are equal for all truth assignments to the propositional symbols appearing in \(F\) or \(G\).
\(F \equiv G\) means F and G are equivalent, 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::F and G are equivalent}}, 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\) (and \(x*a = b\)) has a unique solution \(x\) for any \(a\) and \(b\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a group, the equation \(a * x = b\) (and \(x*a = b\)) has {{c1:: a unique solution \(x\)}} for any \(a\) and \(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></p><ol><li>\(\phi\) is a {{c1::homomorphism}}</li><li>\(\phi\) is a {{c2::bijection}}.</li></ol>
When is a field an integral domain? (Proof included)
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? <i>(Proof included)</i></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\) only contains {{c3::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\) only contains {{c3::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\) only contains {{c3::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>
An interface defines a set of methods that any class that implements it has to have. We use class Test implements Tester {}; to define such a relationship.
Back
ETH::1._Semester::EProg::13._Interfaces
An interface defines a set of methods that any class that implements it has to have. We use class Test implements Tester {}; to define such a relationship.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>An <code>interface</code> defines {{c1::a set of methods that any class that implements it has to have}}. We use <code>class Test implements Tester {};</code> to define such a relationship.</div>
The Arrays class has helper methods that make simple operations quicker:
Arrays.equals(a, b) to compare arrays
Arrays.copyOf(arr, l) that returns a new copied array of length l
Sorting using Arrays.sort(arr)
toString() and deepToString()
Back
ETH::1._Semester::EProg::4._Sequences
The Arrays class has helper methods that make simple operations quicker:
Arrays.equals(a, b) to compare arrays
Arrays.copyOf(arr, l) that returns a new copied array of length l
Sorting using Arrays.sort(arr)
toString() and deepToString()
Arrays.deepToString() converts a nested/multidimensional array to a readable string representation, recursively handling inner arrays.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The Arrays class has helper methods that make simple operations quicker:<br><ul><li>{{c1::<b>Arrays.equals(a, b)</b> to compare arrays::Compare}}<br></li><li>{{c2::<b>Arrays.copyOf(arr, l)</b> that returns a new copied array of length l::Transfer values}}</li><li>{{c3::Sorting using <b>Arrays.sort(arr)::Order</b>}}</li><li>{{c4::<b>toString()</b> and <b>deepToString()</b>::Print}}</li></ul>
Extra
Arrays.deepToString() converts a nested/multidimensional array to a readable string representation, recursively handling inner arrays.
i <= n (the equality holds as we execute + 1 after the final execution)
In general: x < n becomes x <= n and x <= n becomes x <= n + 1
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
while (i < n) {<br> result = result * k;<br> i = i + 1;<br>}<br><br>For the loop invariant, what bounds hold for i?
Back
<div><code>i <= n</code> (the equality holds as we execute <code>+ 1</code> after the final execution)<br><br><div>In general: x < n becomes x <= n and x <= n becomes x <= n + 1</div></div>
default: package scoped, only available in same package.
public: by everyone
private: only accessible from within the object itself (not shared with other instances, unlike static)
static: no initialisation needed, can be accessed through Math.PI
final: prevents overwriting, like const
protected: only by this class and subclasses
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
Attribute access modifiers:
default: package scoped, only available in same package.
public: by everyone
private: only accessible from within the object itself (not shared with other instances, unlike static)
static: no initialisation needed, can be accessed through Math.PI
final: prevents overwriting, like const
protected: only by this class and subclasses
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Attribute access modifiers:<br><ul><li>default: {{c1:: package scoped, only available in same package.}}</li><li>public: {{c2:: by everyone}}</li><li>private: {{c3:: only accessible from within the object itself (not shared with other instances, unlike static)}}</li><li>static: {{c4:: no initialisation needed, can be accessed through <b>Math.PI</b>}}<br></li><li>final: {{c5:: prevents overwriting, like const}}</li><li>protected: {{c6:: only by this class and subclasses}}</li></ul>
Private attributes are accessible by all objects of this class.
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
Private attributes are accessible by all objects of this class.
public class Rational {
private int x;
// Copy constructor
public Rational(Rational other) {
this.x = other.x; // We CAN access another objects private attributes
}
}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Private attributes are accessible by {{c1:: all objects of this class}}.
Extra
<pre><code>public class Rational {
private int x;
// Copy constructor
public Rational(Rational other) {
this.x = other.x; // We CAN access another objects private attributes
}
}
</code></pre>
Note that a class canimplement multiple interfaces.
If a method is defined in multiple of those interfaces, it of course has to be implemented only once.
Back
ETH::1._Semester::EProg::13._Interfaces
Note that a class canimplement multiple interfaces.
If a method is defined in multiple of those interfaces, it of course has to be implemented only once.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Note that a class can<b> </b>{{c1::<b>implement multiple interfaces</b>}}.</div><div>If a method is defined in {{c1::multiple of those interfaces}}, it {{c1::of course has to be implemented only once}}.</div>
When a function is called in dynamic dispatch, the attributes of the type in which the actual function is executed will be used.
class T {
int data = 50;
public void s2() { System.out.println("T " + data); }
}
class S extends T {
int data = 100;
public void s2() { System.out.println(this.data); }
}
class R extends S {
int data = 200;
}
T r = new R();
r.s2(); // Prints "100"
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
When a function is called in dynamic dispatch, the attributes of {{c1::the type in which the actual function is executed}} will be used.
Extra
<code>
class T {
<br> int data = 50;
<br> public void s2() { <br> System.out.println("T " + data); <br> }
<br>}
<br><br>class S extends T {
<br> int data = 100;
<br> public void s2() { System.out.println(this.data); <br> }
<br>}
<br><br>class R extends S {
<br> int data = 200;
<br>}
<br><br>T r = new R();
<br>r.s2(); // Prints "100"
</code>
In a dynamic dispatch, the "this"-keyword still refers to the dynamic type, thus even if the method is in a superclass, it will always try to use the "most overriden" method.
In a dynamic dispatch, the "this"-keyword still refers to the dynamic type, thus even if the method is in a superclass, it will always try to use the "most overriden" method.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a dynamic dispatch, the "this"-keyword still refers to the dynamic type, thus {{c1:: even if the method is in a superclass, it will always try to use the "most overriden" method}}.
Java double can be initialised with <br><ul><li>{{c1:: <b>32.300</b> "." seperated numbers}}</li><li>{{c2:: <b>1e-2</b> exponentials}}</li></ul>
class A {
public int x = 5;
}
class B extends A {
public int y = 6;
public int test() { return 0; }
public B(int i) { super(); }
}
A a1 = new B(1);
a1.y; // leads to a compile error, as A doesn't have x a1.test(); // leads to a compile error, as A doesn't have test()
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<pre><code>class A {
public int x = 5;
}
class B extends A {
public int y = 6;
public int test() { return 0; }</code></pre><pre><code><div> public B(int i) {<br> super();<br> }</div></code></pre><pre><span style="font-family: "Liberation Sans";">}</span><br></pre><code>
A a1 = new B(1);
<br>a1.y; // {{c1:: leads to a compile error, as A doesn't have x}}
<br>a1.test(); // </code>{{c2:: leads to a compile error, as A doesn't have test()}}
Instance of returns true if:<br><ul><li>{{c1::Implements the interface}}</li><li>{{c2::Is of the same dynamic type}}</li><li>{{c3::Is a subtype of the dynamic type}}</li></ul>
class A { public int x = 5; public void fct1() { System.out.println(this.x); } }
class B extends A { public B() { super.x = 10; } public B(int a) { super.x = a; } }
A a1 = new B(1);
A a2 = new B(12); // As these are different instances, their attributes are separate
B b1 = new B(1);
B b2 = new B(12);
a1.fct1(); // 1 -> Even though static type is A a2.fct1(); // 12 -> Different output as a2's instance of A has 12 b1.fct1(); // 1 -> same here, even though it dynamic dispatches b2.fct1(); // 12
class A { public int x = 5; public void fct1() { System.out.println(this.x); } }
class B extends A { public B() { super.x = 10; } public B(int a) { super.x = a; } }
A a1 = new B(1);
A a2 = new B(12); // As these are different instances, their attributes are separate
B b1 = new B(1);
B b2 = new B(12);
a1.fct1(); // 1 -> Even though static type is A a2.fct1(); // 12 -> Different output as a2's instance of A has 12 b1.fct1(); // 1 -> same here, even though it dynamic dispatches b2.fct1(); // 12
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<code>class A { <br> public int x = 5; <br> public void fct1() { <br> System.out.println(this.x); <br> } <br>} <br><br>class B extends A { <br> public B() { <br> super.x = 10; <br> } <br> public B(int a) { <br> super.x = a; <br> } <br>}
<br><br>A a1 = new B(1);
<br>A a2 = new B(12); // As these are different instances, their attributes are separate
<br>B b1 = new B(1);
<br>B b2 = new B(12);
<br>a1.fct1(); // {{c1::1 -> Even though static type is A}}
<br>a2.fct1(); // {{c1:: 12 -> Different output as a2's instance of A has 12}}
<br>b1.fct1(); // {{c1::1 -> same here, even though it dynamic dispatches}}
<br>b2.fct1(); // {{c1::12}}
</code>
public class Lorenz extends Students {
@Override
public void someMethod() {
...
super.someMethod(); // Can call super's implementation of this
}
}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we implement a subtype in Java?
Back
<code>public class Lorenz extends Students {
<br> @Override
public void someMethod() {
...
<br> super.someMethod(); // Can call super's implementation of this
<br> }
<br>}
</code>
How could someone modify a private variable (aliasing)?
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
How could someone modify a private variable (aliasing)?
public class AliasingProblem { private Point center; // Problematic - exposes internal reference public Point getCenter() { return center; // Returns alias to internal object }
}
main() {
Point center = new AliasingProblem().getCenter();
center.setX(2); // Changes private attribute!!
}
If we get a reference to a private object, we can indeed change it's values!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How could someone modify a private variable (aliasing)?
Back
<code>public class AliasingProblem { <br> private Point center; // Problematic - exposes internal reference <br> public Point getCenter() { <br> return center; // Returns alias to internal object <br> }
<br>}
<br><br>main() {
<br> Point center = new AliasingProblem().getCenter();
<br> center.setX(2); // Changes private attribute!!
<br>}</code>
<br><br>If we get a reference to a private object, we can indeed change it's values!
In a subclass, we can access the parent's methods and attributes using super.
Back
ETH::1._Semester::EProg::10._Inheritance
In a subclass, we can access the parent's methods and attributes using super.
You cannot use super.super.xxx, nor x.super.xxx to access super methods or attributes. This gives a compile error.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a subclass, we can access the parent's methods and attributes using {{c1:: super}}.
Extra
<div>You cannot use <code>super.super.xxx</code>, nor <code>x.super.xxx</code> to access super methods or attributes. This gives a <strong>compile</strong> error.</div>
The cases where instanceof causes a compile error:
Primitives - instanceof only works with reference types
Generics - type erasure means List<String> becomes just List at runtime, so the check is impossible t instanceof List<String>
Unrelated types:
Animal -> Dog and Animal -> Cat. Check for animal instanceof Dog/Cat allowed, but dog = new Dog(); dog instanceof Cat throws compile error.
Final class - if a class is final and doesn't implement an interface, no subclass could ever implement it, so the check is provably always false.
However: Animal a = getanimal() could get a Dog which might implement List thus a instanceof List is not a compile error.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The cases where instanceof causes a compile error:<br><ol><li>{{c1::<b>Primitives - instanceof only works with reference types</b>}}</li><li>{{c2::Generics - type erasure means List<String> becomes just List at runtime, so the check is impossible<br><code> t instanceof List<String></code>}} </li><li>{{c3::Unrelated types:<br><div><code> Animal -> Dog</code> and <code>Animal -> Cat</code>. <br> Check for <code>animal instanceof Dog/Cat</code> allowed, but <code>dog = new Dog(); dog instanceof Cat</code> throws compile error.</div>}}</li><li><div>{{c4::Final class - if a class is final and doesn't implement an interface, no subclass could ever implement it, so the check is provably always false.}}</div></li></ol>
Extra
However:<br><code>Animal a = getanimal()</code> could get a <code>Dog</code> which might <code>implement List</code> thus <code>a instanceof List</code> is not a compile error.
<div><code>Animal cat = null; </code></div><div><code>(Cat) cat;</code> </div><div>Leads to a {{c1:: no error, this is always allowed}}.</div>
Every primitive variable must be both declared and initialized before being used.
This is only true for local variables! Instance variables can be left uninitialised.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Every primitive variable must be {{c1:: both declared and initialized}} before being used.
Extra
This is only true for <b>local</b> variables! Instance variables can be left uninitialised.<br><br><img src="paste-a119684222f3e74cbbcfa0830461d164b54afb9a.jpg">
Trying to access a method or attribute on a class with a different dynamic than static type leads to a compile error if the static type doesn't define that attribute or method.
Trying to access a method or attribute on a class with a different dynamic than static type leads to a compile error if the static type doesn't define that attribute or method.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Trying to access a method or attribute on a class with a different dynamic than static type leads to a compile error if {{c1:: the static type doesn't define that attribute or method}}.
(Husky) dog; Casting further down than dynamic type
(Cat) dog; Casting into sibling type
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Runtime Errors for Casting:<br><ol>
<li><code>{{c1::(Husky) dog; </code>Casting further down than dynamic type}}</li>
<li><code>{{c2:: (Cat) dog;</code> Casting into sibling type}}</li></ol>
In a subclass, we can only make methods more visible .
protected -> public is okay
private -> public okay
public to default or default to private are not possible.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a subclass, we can only make methods {{c1:: more visible :: access modifiers}}.
Extra
<ul><li>protected -> public is okay</li><li>private -> public okay</li></ul><div>public to default or default to private are not possible.</div>
(a / b) * b + (a % b) = a (with a / b being division with rest)
In general, if the a is negative, the result is negative.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How is a % b defined in Java?
Back
<div>(a / b) * b + (a % b) = a (with a / b being division with rest)</div><div><br></div><div><div><b>In general, if the a is negative, the result is negative.</b></div></div>
We cannot override attributes inside a subclass, they are shadowed.
class Animal {
String name = "Animal";
String getName() { return "Animal"; }
}
class Dog extends Animal {
String name = "Dog"; // Shadows Animal.name (doesn't override it) @Override
String getName() { return Dog"; } // Overrides Animal.getName() }
Animal a = new Dog();
System.out.println(a.name); // "Animal" — field access uses static type System.out.println(a.getName()); // "Dog" — method call uses dynamic type
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We cannot override {{c1::attributes inside a subclass}}, they are {{c1::shadowed}}.
void test(Integer k) { k = Integer.valueOf(1); This only changes it locally! (Shadowing) // k.value = 1; This changes the value for the caller as well }
Back
ETH::1._Semester::EProg::99._Shadowing
What is the result of:
void test(Integer k) { k = Integer.valueOf(1); This only changes it locally! (Shadowing) // k.value = 1; This changes the value for the caller as well }
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
What is the result of:<br><br><b>void test(Integer k) {</b><br> <b>k = Integer.valueOf(1); </b>{{c1:: This only changes it locally! (Shadowing)}}<br>//<br> <b>k.value = 1; </b>{{c1:: This changes the value for the caller as well}}<br><b>}</b>
go from string to enum using Status.valueOf("PAID")
Ordering using order in declaration Status.SUBMITTED < Status.PAID
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Enums have some convenient features:<br><ul><li>{{c1::can compare using <code>==::compare}}</code></li>
<li>{{c2::use <code>.name()</code> to get string representation::string}}</li>
<li>{{c3::go from string to enum using <code>Status.valueOf("PAID")::string conversion}}</code></li>
<li>{{c4:: Ordering using order in declaration <code>Status.SUBMITTED < Status.PAID::order</code>}}</li></ul>
class T {
int data = 50;
public void s2() { System.out.println("T " + data); }
}
class S extends T {
int data = 100;
public void s2() { System.out.println(this.data); }
}
class R extends S {
int data = 200;
}
T r = new R();
r.s2(); // Prints "100"
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<code>class T {
<br> int data = 50;
<br> public void s2() { <br> System.out.println("T " + data); <br> }
<br>}
<br><br>class S extends T {
<br> int data = 100;
<br> public void s2() { <br> System.out.println(this.data); <br> }
<br>}
<br><br>class R extends S {
<br> int data = 200;
<br>}
<br><br>T r = new R();
<br>r.s2(); // Prints {{c1::"100"}}
</code>
String s = (String) new Integer(5); Casting between unrelated classes
Animal a2 = new Cat();
Dog d2 = (Dog) a2; ClassCastException!
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Possible casting problems:<br><ul><li>{{c1::String s = (String) new Integer(5); Casting between unrelated classes }}</li><li>{{c2::Animal a2 = new Cat();
Dog d2 = (Dog) a2; ClassCastException!}}</li></ul>
Shadowing is when an inner scope variable makes an outer scope one inaccessible.
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
Shadowing is when an inner scope variable makes an outer scope one inaccessible.
public class Person { private String name; // instance variable
public void setName(String name) { // parameter shadows instance variable this.name = name; // use 'this' to access the instance variable } }
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Shadowing is when an {{c1:: inner scope variable makes an outer scope one inaccessible}}.
Extra
public class Person {<br> private String name; // instance variable<br><br> public void setName(String name) { // parameter shadows instance variable<br> this.name = name; // use 'this' to access the instance variable<br> }<br>}
If we override an attribute inherited from the parentclass, it will override the parents attribute.
class A { public int x = 5; public void fct1() { System.out.println(this.x); } }
class B extends A { public B() { super.x = 10; } public B(int a) { super.x = a; } }
A a1 = new B(1);
A a2 = new B(12); // As these are different instances, their attributes are separate
B b1 = new B(1);
B b2 = new B(12);
a1.fct1(); // 1 -> Even though static type is A
a2.fct1(); // 12 -> Different output as a2's instance of A has 12
b1.fct1(); // 1 -> same here, even though it dynamic dispatches
b2.fct1(); // 12
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If we override an attribute inherited from the parentclass, it will {{c1::override}} the parents attribute.
Extra
<code>class A { <br> public int x = 5; <br> public void fct1() { <br> System.out.println(this.x); <br> } <br>} <br><br>class B extends A { <br> public B() { <br> super.x = 10; <br> } <br> public B(int a) { <br> super.x = a; <br> } <br>}
<br><br>A a1 = new B(1);
<br>A a2 = new B(12); // As these are different instances, their attributes are separate
<br>B b1 = new B(1);
<br>B b2 = new B(12);
<br><br>a1.fct1(); // 1 -> Even though static type is A
<br>a2.fct1(); // 12 -> Different output as a2's instance of A has 12
<br>b1.fct1(); // 1 -> same here, even though it dynamic dispatches
<br>b2.fct1(); // 12
</code>
All methods are public (doesn’t have to be explicit).
Any attributes must be public and final.
Back
ETH::1._Semester::EProg::13._Interfaces
In an interface:
All methods are public (doesn’t have to be explicit).
Any attributes must be public and final.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>In an i<b>nterface:</b> </div><div><ul><li>All methods are {{c1::public (doesn’t have to be explicit).}}</li><li>Any attributes {{c2::<b>must be public and final</b>.}}</li></ul></div>
\(P \land \lnot a \implies Q\) when S2; is executed.
Dann kann man mit einem || beide Fälle in der Precondition verbinden: a && precondition1 OR !a && precondition2
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<pre><code>// {P}
if (a) {
S1;
} else {
S2;
}
// {Q}</code>
</pre>How can the precondition be found?
Back
Man muss zwei Fälle checken:<br><ul><li>\(P \land a \implies Q\) when S1; is executed.</li><li>\(P \land \lnot a \implies Q\) when S2; is executed. </li></ul>Dann kann man mit einem <b>||</b> beide Fälle in der Precondition verbinden: <code>a && precondition1</code> OR <code>!a && precondition2</code>
If P_1impliesP_2 then we can say that P_1 is a stronger precondition than P_2.
Back
ETH::1._Semester::EProg::5._Logisches_Schliessen
If P_1impliesP_2 then we can say that P_1 is a stronger precondition than P_2.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>If <code>P_1</code> {{c1::implies}} <code>P_2</code> then we can say that <code>P_1</code> is {{c2::a stronger precondition}} than <code>P_2</code>.</div>
Java has short circuiting for the && and || operators.
This means that if the left of
&& is false then the right isn't even executed
|| is true then the right isn't even executed
Keep this in mind if there's a runtime error on the right.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Java has short circuiting for the && and || operators.<br><br><div>This means that if the left of </div><div><ul><li><b>{{c1:: &&</b> is <b>false}}</b> then the right isn't even executed<br></li><li><b>{{c2:: ||</b> is <b>true}}</b> then the right isn't even executed<br></li></ul><div>Keep this in mind if there's a <b>runtime</b> error on the right.</div></div>
All implementations of an interface using implements must instantiate all methods declared by the interface , otherwise we get a compiler error.
Back
ETH::1._Semester::EProg::13._Interfaces
All implementations of an interface using implements must instantiate all methods declared by the interface , otherwise we get a compiler error.
(except if the class is abstract, then we don't have to implement them)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>All implementations of an interface using <code>implements</code> must instantiate {{c1::<strong>all</strong> methods}} declared by the interface , otherwise we get {{c1::a <strong>compiler error}}</strong>.</div>
Extra
(except if the class is abstract, then we don't have to implement them)
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}}.
What methods cannot be overriden in a subclass:<br><ul><li><code>{{c1::static}}</code></li>
<li><code>{{c2::final}}</code></li>
<li><code>{{c3::private</code> are not inherited either}}</li>
<li><code>{{c4::constructors}}</code></li></ul>
Given \(A \in \mathbb{R}^{n \times n}\) we say \(\lambda \in \mathbb{C}\) is an eigenvalue of \(A\) and \(v \in \mathbb{C}^{n} \setminus \{0\}\) is an eigenvector of \(A\) associated with the eigenvalue \(\lambda\) when the following holds: \[ Av = \lambda v \]
Given \(A \in \mathbb{R}^{n \times n}\) we say \(\lambda \in \mathbb{C}\) is an eigenvalue of \(A\) and \(v \in \mathbb{C}^{n} \setminus \{0\}\) is an eigenvector of \(A\) associated with the eigenvalue \(\lambda\) when the following holds: \[ Av = \lambda v \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given \(A \in \mathbb{R}^{n \times n}\) we say \(\lambda \in \mathbb{C}\) is an {{c2::<b>eigenvalue</b>}} of \(A\) and \(v \in \mathbb{C}^{n} \setminus \{0\}\) is an {{c2::<b>eigenvector</b> of \(A\) associated with the eigenvalue \(\lambda\)}} when the following holds: \[{{c1:: Av = \lambda v }}\]
The matrix \(A^k\) has EW-EV pair \(\lambda^k\) and \(v\) if \(A\) has \(\lambda, v\) as an EW-EV pair.
Intuitively, \(A\) on \(v\) scales it by \(\lambda\). Then scaling that already scaled \(\lambda v\) by \(A\) again gives us \(\lambda^2 v\), etc...
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The matrix \(A^k\) has EW-EV pair {{c1::\(\lambda^k\) and \(v\)}} if \(A\) has \(\lambda, v\) as an EW-EV pair.
Extra
<i>Intuitively</i>, \(A\) on \(v\) scales it by \(\lambda\). Then scaling that already scaled \(\lambda v\) by \(A\) again gives us \(\lambda^2 v\), etc...
Why is \(R\) upper triangular in the QR decomposition?
\(R\) is upper triangular because each \(q_k\) is orthogonal to every \(a_i\) for \(i < k\) (all after it), thus they are \(0\). You can see here, since \(q_2, \dots, q_m\) are by construction orthogonal to \(q_1\) thus \(a_1\), all entries below \(1\) in the first column are \(0\). The same goes for all entries below \(2\) in the second column.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why is \(R\) upper triangular in the QR decomposition?
Back
\(R\) is upper triangular because each \(q_k\) is orthogonal to every \(a_i\) for \(i < k\) (all after it), thus they are \(0\).<br><img src="paste-b807a5bb84b633acb85aab843fa9b2ac8f0e5cdf.jpg"><br>You can see here, since \(q_2, \dots, q_m\) are by construction orthogonal to \(q_1\) thus \(a_1\), all entries below \(1\) in the first column are \(0\). The same goes for all entries below \(2\) in the second column.
Let \(A\) be an invertible matrix. If \(\lambda\) and \(v\) are an EW-EV pair, then {{c1:: \(\frac{1}{\lambda}\) and \(v\)}} are an EW-EV pair of the matrix \(A^{-1}\). Proof Included
Let \(A\) be an invertible matrix. If \(\lambda\) and \(v\) are an EW-EV pair, then {{c1:: \(\frac{1}{\lambda}\) and \(v\)}} are an EW-EV pair of the matrix \(A^{-1}\). Proof Included
Proof: We have \(Av = \lambda v\) thus \(A^{-1}Av = \lambda A^{-1}v\) thus \(\frac{1}{\lambda} v = \frac{1}{\lambda} \lambda A^{-1}v\) and we get \(A^{-1}v = \frac{1}{\lambda} v\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an invertible matrix. If \(\lambda\) and \(v\) are an EW-EV pair, then {{c1:: \(\frac{1}{\lambda}\) and \(v\)}} are an EW-EV pair of the matrix \(A^{-1}\). <i>Proof Included</i>
Extra
<div><b>Proof:</b> We have \(Av = \lambda v\) thus \(A^{-1}Av = \lambda A^{-1}v\) thus \(\frac{1}{\lambda} v = \frac{1}{\lambda} \lambda A^{-1}v\) and we get \(A^{-1}v = \frac{1}{\lambda} v\).</div>
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)
The independent columns in the RREF form of matrix \(A\) are a basis of the column space and in particular: \(\dim(\textbf{C}(A)) = \textbf{rank}(A) = r\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we compute a basis for \(C(A)\)?
Back
The independent columns in the RREF form of matrix \(A\) are a basis of the column space and in particular: \(\dim(\textbf{C}(A)) = \textbf{rank}(A) = r\)
\[ P(z) = (-1)^n \det(A - z I) = \det(z I - A) = (z - \lambda_1)(z - \lambda_2) \dots (z - \lambda_n) \]
The polynomial \(P(z)\) is called the characteristic polynomial of the matrix \(A\).
The eigenvalues \(\lambda_1, \dots, \lambda_n\) as they show up in the polynomial are not all distinct in general.
The number of times an eigenvalue shows up is called the algebraic multiplicity of the eigenvalue.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>\[ P(z) = {{c22:: (-1)^n \det(A - z I) = \det(z I - A) = (z - \lambda_1)(z - \lambda_2) \dots (z - \lambda_n) }}\]</div><div>The polynomial \(P(z)\) is called {{c1::the characteristic polynomial of the matrix \(A\)}}.</div>
Extra
<div>The eigenvalues \(\lambda_1, \dots, \lambda_n\) as they show up in the polynomial are <b>not all distinct</b> in general.</div><div><br></div><div>The number of times an eigenvalue shows up is called the <b>algebraic multiplicity</b> of the eigenvalue.</div>
Orthogonal matrices preserve the norm and inner product of vectors.
In other words, if \(Q \in \mathbb{R}^{n \times n}\) is orthogonal, then, for all \(x, y \in \mathbb{R}^n\):
\[ ||Qx|| = ||x|| \text{ and } (Qx)^\top(Qy) = x^\top y \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Orthogonal matrices preserve the {{c1::norm}} and {{c1::inner product}} of vectors.
Extra
In other words, if \(Q \in \mathbb{R}^{n \times n}\) is orthogonal, then, for all \(x, y \in \mathbb{R}^n\):<br><br>\[ ||Qx|| = ||x|| \text{ and } (Qx)^\top(Qy) = x^\top y \]<br>
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive semidefinite if and only if {{c2::\(x^\top A x \geq 0\) for all \(x \in \mathbb{R}^n\)}}.
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive semidefinite if and only if {{c2::\(x^\top A x \geq 0\) for all \(x \in \mathbb{R}^n\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is {{c1::positive semidefinite}} if and only if {{c2::\(x^\top A x \geq 0\) for all \(x \in \mathbb{R}^n\)}}.
What is the sign of \(\pi\), defined as \(\pi(1) = 1\), \(\pi(2) = 3\) , \(\pi(3) = 2\) , \(\pi(4) = 4\)?
We have the pairs \((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\) for \(i < j\). For all these pairs \((i, j)\), \(\pi(i) < \pi(j)\) except for \((2, 3)\) which gives \((\pi(2), \pi(3)) = (3, 2)\). Thus \(\text{sgn}(\pi) = -1\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the sign of \(\pi\), defined as \(\pi(1) = 1\), \(\pi(2) = 3\) , \(\pi(3) = 2\) , \(\pi(4) = 4\)?
Back
We have the pairs \((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\) for \(i < j\).<br>For all these pairs \((i, j)\), \(\pi(i) < \pi(j)\) except for \((2, 3)\) which gives \((\pi(2), \pi(3)) = (3, 2)\). <br>Thus \(\text{sgn}(\pi) = -1\)
For the <b>co-factor</b> formula for the determinant what's the pattern of signs to multiply by?
Back
\(\begin{bmatrix} + & - & + & - & + & \dots \\ - & + & - & + & - & \dots \\ + & - & + & - & + & \dots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \end{bmatrix}\)
Notation: A matrix \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) has independent columns \(j_1, j_2, \dots, j_r\) and therefore rank \(r\).
Here the \(j_1, j_2, \dots, j_r\) are the indices of the independent columns.
Example: The identity matrix is in \(\text{RREF}(1, 2, \dots, m)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>Notation</b>: A matrix \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) has independent columns {{c1::\(j_1, j_2, \dots, j_r\)}} and therefore rank {{c1:: \(r\)}}.
Extra
<div>Here the \(j_1, j_2, \dots, j_r\) are the indices of the independent columns. </div><div><br></div><div>Example: The identity matrix is in \(\text{RREF}(1, 2, \dots, m)\).</div>
The algebraic multiplicity of a root is the number of times it appears in the factorisation \(P(z) = a_n (z-\lambda_1)(z - \lambda_2) \dots (z - \lambda_n)\).
The algebraic multiplicity of a root is the number of times it appears in the factorisation \(P(z) = a_n (z-\lambda_1)(z - \lambda_2) \dots (z - \lambda_n)\).
Example: If the algebraic multiplicity of \(\lambda_2\) is \(3\) then \((z - \lambda_2)^3 \ | \ P(z)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c1::algebraic multiplicity of a <i>root</i>}} is {{c2:: the number of times it appears in the factorisation \(P(z) = a_n (z-\lambda_1)(z - \lambda_2) \dots (z - \lambda_n)\)}}.
Extra
<div><strong>Example:</strong> If the algebraic multiplicity of \(\lambda_2\) is \(3\) then \((z - \lambda_2)^3 \ | \ P(z)\).</div>
\(A \in \mathbb{R}^{n \times n}\) needs to {{c1:: have \(n\) eigenvectors that form a basis of \(\mathbb{R}^n\)}} to be diagonalisable.
\[ A = V \Lambda V^{-1} \]where \(\Lambda\) is a diagonal matrix with \(\Lambda_{ii} = \lambda_i\) (and \(\Lambda_{ij} = 0\) for all \(i \neq j\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(A \in \mathbb{R}^{n \times n}\) needs to {{c1:: have \(n\) eigenvectors that form a basis of \(\mathbb{R}^n\)}} to be diagonalisable.
Extra
\[ A = V \Lambda V^{-1} \]where \(\Lambda\) is a <b>diagonal</b> matrix with \(\Lambda_{ii} = \lambda_i\) (and \(\Lambda_{ij} = 0\) for all \(i \neq j\)).
Let \(T : \mathbb{R}^n \rightarrow \mathbb{R}^m\) be a linear transformation. There is a?
There is a unique \(m \times n\) matrix A such that \(T = T_A\) meaning that \(T(x) = T_A(x) = Ax\) for all \(x \in \mathbb{R}^n\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Let \(T : \mathbb{R}^n \rightarrow \mathbb{R}^m\) be a linear transformation. There is a?
Back
There is a unique \(m \times n\) matrix A such that \(T = T_A\) meaning that \(T(x) = T_A(x) = Ax\) for all \(x \in \mathbb{R}^n\).
Let \(Q\) be an orthogonal matrix. If \(\lambda \in \mathbb{C}\) is an eigenvalue of \(Q\) then \(|\lambda| =\)\(1\).
The possible values for \(\lambda\) are then \(1, -1\) and all conjugate complex values with modulus \(1\) for example \(i, -i\).
This makes sense as \(Q\) orthogonal only turns and doesn't scale.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(Q\) be an orthogonal matrix. If \(\lambda \in \mathbb{C}\) is an eigenvalue of \(Q\) then \(|\lambda| =\){{c1::\(1\)}}.</div>
Extra
The possible values for \(\lambda\) are then \(1, -1\) and all conjugate complex values with modulus \(1\) for example \(i, -i\).<br><br>This makes sense as \(Q\) orthogonal only turns and doesn't scale.
The columns of \(A\) are independent if and only if \(x = 0\) is the only vector for which \(Ax = 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The columns of \(A\) are independent if and only if {{c1::\(x = 0\) is the only vector for which \(Ax = 0\)::Linear combination view}}.
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has neither full column nor full row rank?
We have to solve both projecting and finding \(||x||^2\) with the smallest norm at once.
We decompose \(A = CR'\) where \(C\) has full column and \(R'\) full row-rank. Then \(A^\dagger = R^\dagger C^\dagger\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has neither full column nor full row rank?
Back
We have to solve both projecting and finding \(||x||^2\) with the smallest norm at once.<br><br>We decompose \(A = CR'\) where \(C\) has full column and \(R'\) full row-rank.<br>Then \(A^\dagger = R^\dagger C^\dagger\).
Let \(V\) be a finitely generated vector space. Let \(G \subseteq V\) be a finite subset of size \(|G| < \dim(V)\). Then {{c1::\(\textbf{Span}(G) \neq V\)}}.
Using this lemma we can now state that computing a vector space means finding a basis.
Let \(V\) be a finitely generated vector space. Let \(G \subseteq V\) be a finite subset of size \(|G| < \dim(V)\). Then {{c1::\(\textbf{Span}(G) \neq V\)}}.
Using this lemma we can now state that computing a vector space means finding a basis.
No smaller set of vectors can fully describe a vector space.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a finitely generated vector space. Let \(G \subseteq V\) be a finite subset of size \(|G| < \dim(V)\). Then {{c1::\(\textbf{Span}(G) \neq V\)}}.<br><br>Using this lemma we can now state that <i>computing a vector space</i> means {{c1::finding a basis}}.
Extra
No smaller set of vectors can fully describe a vector space.
What is special about the characteristic polynomial?
The characteristic polynomial is always monic.
The polynomial \(\det(A - zI)\) has a leading \((-1)\) if the degree is odd. Therefore working with the characteristic one is easier.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is special about the characteristic polynomial?
Back
The characteristic polynomial is always <b>monic</b>.<br><br>The polynomial \(\det(A - zI)\) has a leading \((-1)\) if the degree is odd. Therefore working with the characteristic one is easier.
The eigenvectors of an eigenvalue are those and exactly those vectors \(v \neq 0\) in \(v \in N(A - \lambda I)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <b>eigenvectors</b> of an eigenvalue are <b>those and exactly those</b> vectors {{c1::\(v \neq 0\)}} in {{c1::\(v \in N(A - \lambda I)\)::subspace}}.
\(QQ^\top = I\) hold? No, the identity has holes on the diagonal.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(Q\) orthogonal is not square does:<br><ul><li>\(Q^\top Q = I\) hold? {{c1:: Yes.}}</li><li>\(QQ^\top = I\) hold? {{c2:: No, the identity has holes on the diagonal.}}</li></ul>
For Least Squares, \(A\) needs to have linearly independent columns which they are if \(t_i = t_j\) for all \(i \not = j\) .
This is guaranteed if all datapoints are unique in time.
Otherwise the projection is not defined, i.e. there's no unique solution to the normal equations.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For Least Squares, \(A\) needs to have {{c1:: linearly independent columns ::what property and also why? }} which they are if {{c1:: \(t_i = t_j\) for all \(i \not = j\) }}.<br><br>This is guaranteed if all {{c2:: datapoints are unique in time}}.
Extra
Otherwise the projection is not defined, i.e. there's no unique solution to the normal equations.
Let \(A \in \mathbb{R}^{n \times n}\). If \((\lambda, v)\) is an eigenvalue, eigenvector pair, then {{c1::\((\overline{\lambda}, \overline{v})\) }} is an eigenvalue, eigenvector pair.
Let \(A \in \mathbb{R}^{n \times n}\). If \((\lambda, v)\) is an eigenvalue, eigenvector pair, then {{c1::\((\overline{\lambda}, \overline{v})\) }} is an eigenvalue, eigenvector pair.
The conjugate is always also an EW, EV pair.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\). If \((\lambda, v)\) is an eigenvalue, eigenvector pair, then {{c1::\((\overline{\lambda}, \overline{v})\) }} is an eigenvalue, eigenvector pair.
SVD from rank 1 matrices with \(\sigma_1, \dots, \sigma_r\) be the non-zero singular values of \(A\), \(u_1, \dots, u_r\) the corresponding left singular vectors and \(v_1, \dots, v_r\) the corresponding right singular vectors.
SVD from rank 1 matrices with \(\sigma_1, \dots, \sigma_r\) be the non-zero singular values of \(A\), \(u_1, \dots, u_r\) the corresponding left singular vectors and \(v_1, \dots, v_r\) the corresponding right singular vectors.
We have:\[ A = \sum_{k = 1}^r \sigma_k u_k v_k^\top \] This follows directly from the compact SVD:
\[A = U_r \Sigma_r V_r^T = \begin{bmatrix} | & & | \\ \mathbf{u}_1 & \cdots & \mathbf{u}_r \\ | & & | \end{bmatrix} \begin{bmatrix} \sigma_1 & & \\ & \ddots & \\ & & \sigma_r \end{bmatrix} \begin{bmatrix} - & \mathbf{v}_1^T & - \\ & \vdots & \\ - & \mathbf{v}_r^T & - \end{bmatrix}\] Expanding the matrix multiplication, we get: \[A = \sigma_1 \mathbf{u}_1 \mathbf{v}_1^T + \sigma_2 \mathbf{u}_2 \mathbf{v}_2^T + \dots + \sigma_r \mathbf{u}_r \mathbf{v}_r^T = \sum_{i=1}^r \sigma_i \mathbf{u}_i \mathbf{v}_i^T\] Each term \(\sigma_i \mathbf{u}_i \mathbf{v}_i^T\) is a rank-1 matrix because it is the outer product of two vectors, \(\mathbf{u}_i\) and \(\mathbf{v}_i\), scaled by the singular value \(\sigma_i\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
SVD from rank 1 matrices with \(\sigma_1, \dots, \sigma_r\) be the non-zero singular values of \(A\), \(u_1, \dots, u_r\) the corresponding left singular vectors and \(v_1, \dots, v_r\) the corresponding right singular vectors.
Back
We have:\[ A = \sum_{k = 1}^r \sigma_k u_k v_k^\top \]<br>This follows directly from the compact SVD:<br><br>\[A = U_r \Sigma_r V_r^T = \begin{bmatrix} | & & | \\ \mathbf{u}_1 & \cdots & \mathbf{u}_r \\ | & & | \end{bmatrix} \begin{bmatrix} \sigma_1 & & \\ & \ddots & \\ & & \sigma_r \end{bmatrix} \begin{bmatrix} - & \mathbf{v}_1^T & - \\ & \vdots & \\ - & \mathbf{v}_r^T & - \end{bmatrix}\]<br>Expanding the matrix multiplication, we get: <br>\[A = \sigma_1 \mathbf{u}_1 \mathbf{v}_1^T + \sigma_2 \mathbf{u}_2 \mathbf{v}_2^T + \dots + \sigma_r \mathbf{u}_r \mathbf{v}_r^T = \sum_{i=1}^r \sigma_i \mathbf{u}_i \mathbf{v}_i^T\]<br>Each term \(\sigma_i \mathbf{u}_i \mathbf{v}_i^T\) is a rank-1 matrix because it is the outer product of two vectors, \(\mathbf{u}_i\) and \(\mathbf{v}_i\), scaled by the singular value \(\sigma_i\).
Express the Fibonacci formula \(f_n = f_{n - 1} + f_{n - 2}\) as a matrix equation?
{{c1::Let \(\mathbf{g}_{n+1} = M\mathbf{g}_n\), where \(M = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \)(matrix version of the recursion)}}
{{c2::The eigenvalues \(\lambda_1 = \frac{1+\sqrt{5} }{2}\) (golden ratio \(\phi\)) and \(\lambda_2 = \frac{1-\sqrt{5} }{2}\) are found, along with their eigenvectors \(v_1 = \begin{pmatrix} \lambda_1 \\ 1 \end{pmatrix}\) and \(v_2 = \begin{pmatrix} \lambda_2 \\ 1 \end{pmatrix}\) . These eigenvectors are independent since \(\lambda_1 \neq \lambda_2\) and thus they form a basis for \(\mathbb{R}^2\).}}
{{c3::The initial state \(\mathbf{g}_0\) is written as a linear combination of eigenvectors with coefficients \(\pm\frac{1}{\sqrt{5} }\): \(g_0 = \frac{1}{\sqrt{5} }v_1 - \frac{1}{\sqrt{5} }v_2\).}}
{{c4::Since \(M^n\mathbf{v}_i = \lambda_i^n\mathbf{v}_i\), we get the closed form: \[F_n = \frac{1}{\sqrt{5} } \left[\left(\frac{1+\sqrt{5} } {2}\right)^n - \left(\frac{1-\sqrt{5} } {2}\right)^n\right] \] }}
Express the Fibonacci formula \(f_n = f_{n - 1} + f_{n - 2}\) as a matrix equation?
{{c1::Let \(\mathbf{g}_{n+1} = M\mathbf{g}_n\), where \(M = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \)(matrix version of the recursion)}}
{{c2::The eigenvalues \(\lambda_1 = \frac{1+\sqrt{5} }{2}\) (golden ratio \(\phi\)) and \(\lambda_2 = \frac{1-\sqrt{5} }{2}\) are found, along with their eigenvectors \(v_1 = \begin{pmatrix} \lambda_1 \\ 1 \end{pmatrix}\) and \(v_2 = \begin{pmatrix} \lambda_2 \\ 1 \end{pmatrix}\) . These eigenvectors are independent since \(\lambda_1 \neq \lambda_2\) and thus they form a basis for \(\mathbb{R}^2\).}}
{{c3::The initial state \(\mathbf{g}_0\) is written as a linear combination of eigenvectors with coefficients \(\pm\frac{1}{\sqrt{5} }\): \(g_0 = \frac{1}{\sqrt{5} }v_1 - \frac{1}{\sqrt{5} }v_2\).}}
{{c4::Since \(M^n\mathbf{v}_i = \lambda_i^n\mathbf{v}_i\), we get the closed form: \[F_n = \frac{1}{\sqrt{5} } \left[\left(\frac{1+\sqrt{5} } {2}\right)^n - \left(\frac{1-\sqrt{5} } {2}\right)^n\right] \] }}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Express the Fibonacci formula \(f_n = f_{n - 1} + f_{n - 2}\) as a matrix equation?<br><ol><li>{{c1::Let \(\mathbf{g}_{n+1} = M\mathbf{g}_n\), where \(M = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \)(matrix version of the recursion)}}</li><li>{{c2::The eigenvalues \(\lambda_1 = \frac{1+\sqrt{5} }{2}\) (golden ratio \(\phi\)) and \(\lambda_2 = \frac{1-\sqrt{5} }{2}\) are found, along with their eigenvectors \(v_1 = \begin{pmatrix} \lambda_1 \\ 1 \end{pmatrix}\) and \(v_2 = \begin{pmatrix} \lambda_2 \\ 1 \end{pmatrix}\) . These eigenvectors are independent since \(\lambda_1 \neq \lambda_2\) and thus they form a basis for \(\mathbb{R}^2\).}}</li><li>{{c3::The initial state \(\mathbf{g}_0\) is written as a linear combination of eigenvectors with coefficients \(\pm\frac{1}{\sqrt{5} }\): \(g_0 = \frac{1}{\sqrt{5} }v_1 - \frac{1}{\sqrt{5} }v_2\).}}</li><li>{{c4::Since \(M^n\mathbf{v}_i = \lambda_i^n\mathbf{v}_i\), we get the closed form: \[F_n = \frac{1}{\sqrt{5} } \left[\left(\frac{1+\sqrt{5} } {2}\right)^n - \left(\frac{1-\sqrt{5} } {2}\right)^n\right] \] }}</li></ol>
In the SVD the diagonal elements of \(\Sigma\), \(\sigma_i = \Sigma_{ii}\) are called the singular values of \(A\) and are {{c1:: ordered as \(\sigma_1 \geq \dots \sigma_{\min\{m, n\} }\)}}.
In the SVD the diagonal elements of \(\Sigma\), \(\sigma_i = \Sigma_{ii}\) are called the singular values of \(A\) and are {{c1:: ordered as \(\sigma_1 \geq \dots \sigma_{\min\{m, n\} }\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In the SVD the diagonal elements of \(\Sigma\), \(\sigma_i = \Sigma_{ii}\) are called {{c1::the singular values}} of \(A\) and are {{c1:: ordered as \(\sigma_1 \geq \dots \sigma_{\min\{m, n\} }\)}}.
The singular values are the square-root of the eigenvalues of \(A^\top A\) (or \(AA^\top\)). Proof Included
Note that \(A^\top A\) and \(AA^\top\) share all non-zero eigenvalues. This can be seen easily as \(A^\top A\) is symmetric thus \(A^\top A = V^\top \Lambda V V(\Sigma^\top \Sigma) V^\top\) which implies that \(\Lambda = \Sigma^\top \Sigma\) and thus \(\lambda_i = \sigma_i^2\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The singular values are the {{c1::square-root}} of the {{c2::eigenvalues of \(A^\top A\) (or \(AA^\top\))}}. <i>Proof Included</i>
Extra
Note that \(A^\top A\) and \(AA^\top\) share all non-zero eigenvalues. This can be seen easily as \(A^\top A\) is symmetric thus \(A^\top A = V^\top \Lambda V V(\Sigma^\top \Sigma) V^\top\) which implies that \(\Lambda = \Sigma^\top \Sigma\) and thus \(\lambda_i = \sigma_i^2\).
If \(A \in \mathbb{R}^{m \times n}\) has rank \(r = m\), then \(Ax = b\) has a solution for {{c1::every \(b \in \mathbb{R}^m\) (equivalent to saying that \(\textbf{C}(A) = \mathbb{R}^m\))}}.
We call \(A\) solvable (invertible \(A\) is a special case of this).
If \(A \in \mathbb{R}^{m \times n}\) has rank \(r = m\), then \(Ax = b\) has a solution for {{c1::every \(b \in \mathbb{R}^m\) (equivalent to saying that \(\textbf{C}(A) = \mathbb{R}^m\))}}.
We call \(A\) solvable (invertible \(A\) is a special case of this).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(A \in \mathbb{R}^{m \times n}\) has rank \(r = m\), then \(Ax = b\) has a solution for {{c1::every \(b \in \mathbb{R}^m\) (equivalent to saying that \(\textbf{C}(A) = \mathbb{R}^m\))}}.<br><br>We call \(A\) {{c1::solvable (invertible \(A\) is a special case of this)::name and special case}}.
Proof that the Rayleigh Quotient has it's maximum and minimum at the largest/smallest EWs?
Back
<div>It is easy to see that \(R(v_{\max}) = \lambda_{\max}\) and \(R(v_{\min}) = \lambda_{\min}\). </div><div><br></div><div>See: </div><div>\(R(v_{\text{max}}) = \frac{v_{\text{max}}^\top A v_{\text{max}}}{v_{\text{max}}^\top v_{\text{max}}} = \frac{v_{\text{max}}^\top (\lambda_{\text{max}} v_{\text{max}})}{v_{\text{max}}^\top v_{\text{max}}} = \lambda_{\text{max}}\)</div>
<div>Let \(Q\) be the \(m \times n\) matrix whose columns are an orthonormal basis of \(C(A)\).</div><div><br></div><div>Then the projection matrix that projects to \(C(A)\) is given by {{c1::\(QQ^\top\)}}. <i>Proof Included</i></div>
Extra
\(Q^\top Q\) simplifies to \(I\) in the case where our \(Q\) is orthogonal. <br><br>Thus \(P = Q (Q^\top Q)^{-1} Q^\top\) simplifies to \(P = QQ^\top\).
Given a symmetric matrix \(A \in \mathbb{R}^{n \times n}\) the Rayleigh Quotient defined for \(x \in \mathbb{R}^n \setminus {0}\), as \[ R(x) = {{c1::\frac{x^\top Ax}{x^\top x} }}\]attains it’s
maximum at {{c2::\(R(v_{\text{max} }) = \lambda_{\text{max} }\)}}
minimum at {{c2::\(R(v_{\text{min} }) = \lambda_{\text{min} } \)}}
where {{c2::\(\lambda_{\text{max} }\) and \(\lambda_{\text{min} }\) are respectively the largest and smallest eigenvalues of \(A\) and \(v_{\text{max} }\) and \(v_{\text{min} }\) their associated eigenvectors}}.
Given a symmetric matrix \(A \in \mathbb{R}^{n \times n}\) the Rayleigh Quotient defined for \(x \in \mathbb{R}^n \setminus {0}\), as \[ R(x) = {{c1::\frac{x^\top Ax}{x^\top x} }}\]attains it’s
maximum at {{c2::\(R(v_{\text{max} }) = \lambda_{\text{max} }\)}}
minimum at {{c2::\(R(v_{\text{min} }) = \lambda_{\text{min} } \)}}
where {{c2::\(\lambda_{\text{max} }\) and \(\lambda_{\text{min} }\) are respectively the largest and smallest eigenvalues of \(A\) and \(v_{\text{max} }\) and \(v_{\text{min} }\) their associated eigenvectors}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Given a symmetric matrix \(A \in \mathbb{R}^{n \times n}\) the Rayleigh Quotient defined for \(x \in \mathbb{R}^n \setminus {0}\), as \[ R(x) = {{c1::\frac{x^\top Ax}{x^\top x} }}\]attains it’s</div><div><ul><li>maximum at {{c2::\(R(v_{\text{max} }) = \lambda_{\text{max} }\)}}</li><li>minimum at {{c2::\(R(v_{\text{min} }) = \lambda_{\text{min} } \)}}</li></ul><div>where {{c2::\(\lambda_{\text{max} }\) and \(\lambda_{\text{min} }\) are respectively the largest and smallest eigenvalues of \(A\) and \(v_{\text{max} }\) and \(v_{\text{min} }\) their associated eigenvectors}}.</div></div><blockquote><ul>
</ul></blockquote>
Every matrix \(A \in \mathbb{R}^{m \times n}\) has an SVD decomposition. In other words:
Every linear transformation is diagonal when viewed in the bases of the singular vectors.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Every matrix \(A \in \mathbb{R}^{m \times n}\) has an SVD decomposition. In other words:</div><div>{{c1::Every linear transformation is diagonal when viewed in the bases of the singular vectors.}}</div>
For every \(i \in [r]\), column \(j_i\) of \(R\) is the standard unit vector \(e_i\)
All entries \(r_{ij}\) “below the staircase” are \(0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
A matrix \(R\) is in RREF if:
Back
<ol>
<li>For every \(i \in [r]\), column \(j_i\) of \(R\) is the standard unit vector \(e_i\)</li><li>All entries \(r_{ij}\) “below the staircase” are \(0\).</li></ol><div><img src="paste-68d858bb3f866342909dc81c609228626cb1c514.jpg"></div>
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.
A function which is described as follows:<br><br>\(\delta_{i, j} = \begin{cases} \text{0} &\quad\text{if }i \neq j \\ \text{1} &\quad\text{if }i = j \end{cases}\)
Given a triangular (either upper or lower) matrix \(T \in \mathbb{R}^{n \times n}\), we have \[ \det(T) = {{c1:: \prod_{k = 1}^n T_{kk} }}\]
For a triangular matrix, if we choose an element off the diagonal, we are then forced to choose one in the \(0\)s thus making that factor \(0\). The only valid permutation is thus the \(\text{id}\), which means we just multiply the diagonals.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given a <b>triangular</b> (either upper or lower) matrix \(T \in \mathbb{R}^{n \times n}\), we have \[ \det(T) = {{c1:: \prod_{k = 1}^n T_{kk} }}\]
Extra
For a triangular matrix, if we choose an element off the diagonal, we are then forced to choose one in the \(0\)s thus making that factor \(0\). The only valid permutation is thus the \(\text{id}\), which means we just multiply the diagonals.
The determinant expressed in terms of co-factors is: \[\det(A) = {{c1:: \sum_{j = 1}^n A_{ij}C_{ij} }}\]
in which we multiply the cofactor of every element by the element itself, as is clear in the example for a 3x3.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The determinant expressed in terms of <b>co-factors</b> is: \[\det(A) = {{c1:: \sum_{j = 1}^n A_{ij}C_{ij} }}\]<br>
Extra
in which we multiply the cofactor of every element by the element itself, as is clear in the example for a 3x3.<br><img src="paste-5b306ce2f1c5340a372c470f868d00a247f2c566.jpg">
\(A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}\) is invertible but not diagonalisable since the EW \(1\) has algebraic multiplicity 2 but geometric multiplicity 1.
\(A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}\) is invertible but not diagonalisable since the EW \(1\) has algebraic multiplicity 2 but geometric multiplicity 1.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}\) is invertible but not {{c1::diagonalisable}} since {{c1::the EW \(1\) has algebraic multiplicity 2 but geometric multiplicity 1}}.
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>
We know that \(\forall x \in \mathbb{R}^n\), there exist \(x_0 \in N(A)\) and \(x_1 \in R(A)\) such that \(x = x_0 + x_1 \) and \(x_1^\top x_0 = 0\) as \(N(A) = C(A^\top)^\perp\) are orthogonal complements.
We know that \(\forall x \in \mathbb{R}^n\), there exist \(x_0 \in N(A)\) and \(x_1 \in R(A)\) such that \(x = x_0 + x_1 \) and \(x_1^\top x_0 = 0\) as \(N(A) = C(A^\top)^\perp\) are orthogonal complements.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We know that \(\forall x \in \mathbb{R}^n\), there exist {{c1::\(x_0 \in N(A)\)}} and {{c1::\(x_1 \in R(A)\)}} such that \(x = {{c2:: x_0 + x_1 }}\) and {{c3::\(x_1^\top x_0 = 0\)}} as {{c3::\(N(A) = C(A^\top)^\perp\) are orthogonal complements}}.
The determinant is linear in each row (or each column). In other words for any \(a_0, a_1, a_2, \dots, a_n \in \mathbb{R}^n\) and \(\alpha_0, \alpha_1 \in \mathbb{R}\) we have: (Two linearity properties)
The determinant is linear in each row (or each column). In other words for any \(a_0, a_1, a_2, \dots, a_n \in \mathbb{R}^n\) and \(\alpha_0, \alpha_1 \in \mathbb{R}\) we have: (Two linearity properties)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
The determinant is linear in each row (or each <i>column</i>). In other words for any \(a_0, a_1, a_2, \dots, a_n \in \mathbb{R}^n\) and \(\alpha_0, \alpha_1 \in \mathbb{R}\) we have: (<i>Two linearity properties)</i>
Then \(V \cap W = \) {{c1:: \(\{0\}\) (as all subspaces contain the \(0\) vector)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) and \(W\) be orthogonal subspaces.</div><div><br></div><div>Then \(V \cap W = \) {{c1:: \(\{0\}\) (as all subspaces contain the \(0\) vector)}}.</div>
If \(\lambda, v\) an EW-EV pair of \(A\) then \(A(Bv) = (AB)v = B(Av) = \lambda Bv\) thus \(Bv\) is an eigenvector of \(A\).
Then \(Bv\) is a multiple of some \(v\) of that EW \(\lambda\) (easiest to see for \(A\) complete set of real EVs) \(\implies\) \(Bv = \lambda'v\) thus that \(v\) is also an EV of \(B\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(AB = BA\), then {{c1::\(A,B\) share an EV::EVs of A, B}}.
Extra
Assume \(AB = BA\).<br><br>If \(\lambda, v\) an EW-EV pair of \(A\) then \(A(Bv) = (AB)v = B(Av) = \lambda Bv\) thus \(Bv\) is an eigenvector of \(A\).<br><br>Then \(Bv\) is a multiple of some \(v\) of that EW \(\lambda\) (easiest to see for \(A\) complete set of real EVs) \(\implies\) \(Bv = \lambda'v\) thus that \(v\) is also an EV of \(B\).
{{c1::\(T_A : \mathbb{R}^m \rightarrow \mathbb{R}^m\) is bijective.::Transformation}}
There is an \(m \times m\) matrix \(B\) such that \(BA = I\).
The columns of \(A\) are linearly independent.
The third one can be derived from the fact that if \(BA = I\), there is only a single \(x \in \mathbb{R}^m\) such that \(A \textbf{x} = 0\).
It is also intuitively clear that if not all columns were linearly independent, we'd actually have a tall linear transformation and would be losing information.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Three equivalent statements:<br><ol><li>{{c1::\(T_A : \mathbb{R}^m \rightarrow \mathbb{R}^m\) is bijective.::Transformation}}</li><li>{{c2::There is an \(m \times m\) matrix \(B\) such that \(BA = I\).}}</li><li>{{c3::The columns of \(A\) are linearly independent.}}</li></ol>
Extra
The third one can be derived from the fact that if \(BA = I\), there is only a single \(x \in \mathbb{R}^m\) such that \(A \textbf{x} = 0\).<br><br>It is also intuitively clear that if not all columns were linearly independent, we'd actually have a tall linear transformation and would be losing information.
In a vector space \(V\) three important properties hold:
\(0v = 0\) for all \(v\)
there is only one \(0\)
one unique inverse \(-v\) for all \(v\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In a vector space \(V\) three important properties hold:<br><ul><li>{{c1::\(0v = 0\) for all \(v\)}}</li><li>{{c2:: there is only one \(0\)}}</li><li>{{c3:: one unique inverse \(-v\) for all \(v\)}}</li></ul>
What happens if \(A\) itself is invertible for the projection matrix?
Since \(A\) is invertible, it spans \(\mathbb{R}^m\) and any projection is simply the point itself.
This is beautifully reflected in the fact that if we simplify \(P = A A^{-1} (A^\top)^{-1} A^\top\) then we simply get \(P = I\).
In general it may look like we can simplify the expression for the projection matrix \(P\), this is however not the case, UNLESS \(A\) is invertible:
\((A^\top A)^{-1} = A^{-1} (A^\top)^{-1}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What happens if \(A\) itself is invertible for the projection matrix?
Back
Since \(A\) is <b>invertible</b>, it spans \(\mathbb{R}^m\) and any projection is simply the point itself.<br><br>This is <i>beautifully reflected</i> in the fact that if we simplify \(P = A A^{-1} (A^\top)^{-1} A^\top\) then we simply get \(P = I\).<br><br>In general it may look like we can simplify the expression for the projection matrix \(P\), this is however not the case, UNLESS \(A\) is invertible:<br><br>\((A^\top A)^{-1} = A^{-1} (A^\top)^{-1}\)
Let \(A\) be an \(m \times n\) matrix and \(b \in \mathbb{R}^m\). The set \[ \textbf{Sol}(A, b) := \{x \in \mathbb{R}^n : Ax = b\} \subseteq \mathbb{R}^n \] is the solution space of \(Ax = b\).
Let \(A\) be an \(m \times n\) matrix and \(b \in \mathbb{R}^m\). The set \[ \textbf{Sol}(A, b) := \{x \in \mathbb{R}^n : Ax = b\} \subseteq \mathbb{R}^n \] is the solution space of \(Ax = b\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an \(m \times n\) matrix and \(b \in \mathbb{R}^m\).<br>The set \[ \textbf{Sol}(A, b) := \{x \in \mathbb{R}^n : Ax = b\} \subseteq \mathbb{R}^n \] is {{c1:: the <i>solution space</i> of \(Ax = b\)}}.
Let \(V\) be a vector space. A nonempty set \(U \subseteq V\) is called a subspace of \(V\) if the following two axioms of a subspace are true for all \(v, w \in U\) and all \(\lambda \in \mathbb{R}\):
Let \(V\) be a vector space. A nonempty set \(U \subseteq V\) is called a subspace of \(V\) if the following two axioms of a subspace are true for all \(v, w \in U\) and all \(\lambda \in \mathbb{R}\):
\(v + w \in U\) (closure addition)
\(\lambda v \in U\) (closure multiplication)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) be a vector space. A nonempty set \(U \subseteq V\) is called a subspace of \(V\) if the following two axioms of a subspace are true for all \(v, w \in U\) and all \(\lambda \in \mathbb{R}\):</div><div><ul><li>{{c2::\(v + w \in U\) (closure addition)}}</li><li>{{c3::\(\lambda v \in U\) (closure multiplication)}}</li></ul></div><blockquote><ul>
</ul></blockquote>
We can write \(\mathbf{p} = \lambda\mathbf{a}, \lambda \in \mathbb{R}\) since we know {{c1::the projection vector is on the line spanned by \(\mathbf{a}\) and hence \(\mathbf{p}\) is a scalar multiple of \(\textbf{a}\)}}.
Where we first used \(\mathbf{v} \perp \mathbf{u} \iff \mathbf{v}^\top\mathbf{u} = 0\), then plugged in for \(\lambda a\) for \(p\), then used the distributivity of the vector multiplication.
We can divide by \(a^\top a\)(\(a\) is a nonzero real number, as is a nonzero vector)
We can then plug in \(\lambda\) into \(p = \lambda \mathbf{a}\) to get the projection vector \[ \mathbf{p} = \frac{a^\top b}{a^\top a}a = \frac{aa^\top}{a^\top a} b \]We can do this since \(a^\top b\) is a scalar so \((a^\top b)a = a(a^\top b) = (a a^\top) b\) (commute and associativity).
We can write \(\mathbf{p} = \lambda\mathbf{a}, \lambda \in \mathbb{R}\) since we know {{c1::the projection vector is on the line spanned by \(\mathbf{a}\) and hence \(\mathbf{p}\) is a scalar multiple of \(\textbf{a}\)}}.
Where we first used \(\mathbf{v} \perp \mathbf{u} \iff \mathbf{v}^\top\mathbf{u} = 0\), then plugged in for \(\lambda a\) for \(p\), then used the distributivity of the vector multiplication.
We can divide by \(a^\top a\)(\(a\) is a nonzero real number, as is a nonzero vector)
We can then plug in \(\lambda\) into \(p = \lambda \mathbf{a}\) to get the projection vector \[ \mathbf{p} = \frac{a^\top b}{a^\top a}a = \frac{aa^\top}{a^\top a} b \]We can do this since \(a^\top b\) is a scalar so \((a^\top b)a = a(a^\top b) = (a a^\top) b\) (commute and associativity).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Intuition on the projection formula (in 2d):<br><br><ul><li>Assume \(\mathbf{a} \perp \mathbf{e}\) \(\implies\) \(\mathbf{a} \perp (\mathbf{b} - \mathbf{p})\) (define error vector \(\mathbf{e} = \mathbf{b} - \mathbf{p}\)).</li><li>We can write \(\mathbf{p} = \lambda\mathbf{a}, \lambda \in \mathbb{R}\) since we know {{c1::the projection vector is on the line spanned by \(\mathbf{a}\) and hence \(\mathbf{p}\) is a scalar multiple of \(\textbf{a}\)}}.</li><li>\[ \begin{align} \mathbf{a} \perp (\mathbf{b} - \mathbf{p}) &\iff {{c1:: \mathbf{a}^\top(\mathbf{b} - \mathbf{p}) = 0 \\ &\iff \mathbf{a}^\top(\mathbf{b} - \lambda\mathbf{a}) = 0 \\ &\iff \mathbf{a}^\top\mathbf{b} - \mathbf{a}^\top\lambda\mathbf{a} = 0 \\ &\iff \mathbf{a}^\top\mathbf{b} = \mathbf{a}^\top\lambda\mathbf{a} \\ &\iff \mathbf{a}^\top\mathbf{b} = \lambda\mathbf{a}^\top\mathbf{a} \\ &\iff \lambda = \frac{\mathbf{a}^\top\mathbf{b} }{\mathbf{a}^\top\mathbf{a} } }} \end{align} \]</li><li>Where we first used \(\mathbf{v} \perp \mathbf{u} \iff \mathbf{v}^\top\mathbf{u} = 0\), then plugged in for \(\lambda a\) for \(p\), then used the distributivity of the vector multiplication.</li><li>We can divide by \(a^\top a\)(\(a\) is a nonzero real number, as is a nonzero vector)</li></ul>We can then plug in \(\lambda\) into \(p = \lambda \mathbf{a}\) to get the projection vector \[ \mathbf{p} = \frac{a^\top b}{a^\top a}a = \frac{aa^\top}{a^\top a} b \]We can do this since \(a^\top b\) is a scalar so \((a^\top b)a = a(a^\top b) = (a a^\top) b\) (commute and associativity).
By the spectral theorem, for any symmetric \(A\) we can write:
\[ A = V \Lambda V^\top \]where \(\Lambda \in \mathbb{R}^{n \times n}\) is a diagonal matrix with the eigenvalues of \(A\) in it's diagonal, and \(V\) orthogonal matrix containing the eigenvectors \(V^\top V = I\).
By the spectral theorem, for any symmetric \(A\) we can write:
\[ A = V \Lambda V^\top \]where \(\Lambda \in \mathbb{R}^{n \times n}\) is a diagonal matrix with the eigenvalues of \(A\) in it's diagonal, and \(V\) orthogonal matrix containing the eigenvectors \(V^\top V = I\).
This decomposition is called an eigen-decomposition.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
By the spectral theorem, for any symmetric \(A\) we can write: <br><br>\[ A = {{c1::V \Lambda V^\top }}\]where \(\Lambda \in \mathbb{R}^{n \times n}\) is {{c2::a diagonal matrix with the eigenvalues of \(A\) in it's diagonal}}, and \(V\) {{c2::orthogonal matrix containing the eigenvectors \(V^\top V = I\)}}.
Extra
This decomposition is called an eigen-decomposition.
Let \(\{v_1, \dots, v_m\}\) be a basis of \(V\). For each \(v \in V\), there are unique scalars \(\lambda_1, \dots, \lambda_n\) such that \[ v = \sum_{j = 1}^{m} \lambda_j v_j \]This means that in a basis each vector can be written as a unique linear combination.
Let \(\{v_1, \dots, v_m\}\) be a basis of \(V\). For each \(v \in V\), there are unique scalars \(\lambda_1, \dots, \lambda_n\) such that \[ v = \sum_{j = 1}^{m} \lambda_j v_j \]This means that in a basis each vector can be written as a unique linear combination.
This holds as all basis vectors are linearly independent by definition.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(\{v_1, \dots, v_m\}\) be a basis of \(V\). For each \(v \in V\), there are unique scalars \(\lambda_1, \dots, \lambda_n\) such that \[ v = \sum_{j = 1}^{m} \lambda_j v_j \]This means that {{c1::in a basis each vector can be written as a <b>unique</b> linear combination}}.
Extra
This holds as all basis vectors are linearly independent by definition.
Let \(A\) and \(v_1, \dots, v_k \in \mathbb{R}^n\) be the EVs of \(\lambda_1, \dots, \lambda_k \in \mathbb{R}^n\).
If the \(\lambda_1, \dots, \lambda_k\)s are all distinct then the EVs \(v_1, \dots, v_k\) are all linearly independent.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A\) and \(v_1, \dots, v_k \in \mathbb{R}^n\) be the EVs of \(\lambda_1, \dots, \lambda_k \in \mathbb{R}^n\).</div><div>If the \(\lambda_1, \dots, \lambda_k\)s are all distinct then {{c1::the EVs \(v_1, \dots, v_k\) are all linearly independent}}.</div>
We can adapt least squares to do more than just linear regression, we could also fit a parabola (or anything else) by changing the entries in \(A\) to match the coefficients of our formula.
We can adapt least squares to do more than just linear regression, we could also fit a parabola (or anything else) by changing the entries in \(A\) to match the coefficients of our formula.
We could have \(A = \begin{bmatrix} 1 & t_1 & t_1^2 \\ 1 & t_2 & t_2^2 \\ \vdots & \vdots & \vdots \\ 1 & t_m & t_m^2 \end{bmatrix}\) for a parabola.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We can adapt least squares to do more than just linear regression, we could also fit a parabola (or anything else) by {{c1:: changing the entries in \(A\) to match the coefficients of our formula}}.
Extra
We could have \(A = \begin{bmatrix} 1 & t_1 & t_1^2 \\ 1 & t_2 & t_2^2 \\ \vdots & \vdots & \vdots \\ 1 & t_m & t_m^2 \end{bmatrix}\) for a parabola.
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). <br><br>Beispiel: Ebene in \(\mathbb{R}^3\)
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), the pseudo-inverse \(A^\dagger \in \mathbb{R}^{n \times m}\) is a right inverse of \(A\): \[ A A^\dagger = I \]Proof Included
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), the pseudo-inverse \(A^\dagger \in \mathbb{R}^{n \times m}\) is a right inverse of \(A\): \[ A A^\dagger = I \]Proof Included
Proof Since \(A^\top\) has full column rank, \(((A^\top)^\top A^\top) = AA^\top\) is invertible: \(AA^\dagger = AA^\top(A A^\top)^{-1} = I\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), the <b>pseudo-inverse</b> \(A^\dagger \in \mathbb{R}^{n \times m}\) is {{c1::a right inverse}} of \(A\): \[ {{c1:: A A^\dagger = I }}\]<i>Proof Included</i>
Extra
<div><b>Proof</b> Since \(A^\top\) has full column rank, \(((A^\top)^\top A^\top) = AA^\top\) is invertible: \(AA^\dagger = AA^\top(A A^\top)^{-1} = I\).</div>
If the columns of \(A\) are pairwise orthogonal, we get \(A^\top A\) a diagonal matrix which is very easy to invert, i.e. makes Least Squares easier.
We can convert any \(A\) to have orthogonal columns by making sure that the sum of all the \(t_k = 0\), which can be achieved by shifting the graph on the x-axis.
If the columns of \(A\) are pairwise orthogonal, we get \(A^\top A\) a diagonal matrix which is very easy to invert, i.e. makes Least Squares easier.
We can convert any \(A\) to have orthogonal columns by making sure that the sum of all the \(t_k = 0\), which can be achieved by shifting the graph on the x-axis.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>If the columns of \(A\) are pairwise orthogonal, we get \(A^\top A\) a diagonal matrix which is very easy to invert, i.e. makes Least Squares easier.</div><div><br></div><div>We can convert any \(A\) to have orthogonal columns by {{c1:: making sure that the sum of all the \(t_k = 0\), which can be achieved by shifting the graph on the x-axis}}.</div>
The projection of a vector \(b \in \mathbb{R}^m\) to the subspace \(S = C(A)\) is well-defined.
It can be written as \(proj_S(b) = A\hat{x}\) where \(\hat{x}\) satisfies the normal equations{{c1:: \(A^\top A \hat{x} = A^\top b\) }}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The projection of a vector \(b \in \mathbb{R}^m\) to the subspace \(S = C(A)\) is well-defined. <br><br>It can be written as \(proj_S(b) = A\hat{x}\) where \(\hat{x}\) satisfies the <b>normal equations</b>{{c1:: \(A^\top A \hat{x} = A^\top b\) }}.
For a permutation \(\sigma\), if \(\sigma(i) \neq i\) then there exists a \(j\) such that \(\sigma(j) \neq j\).
We're going to have to venture off the diagonal for at least one other element.
If we have a matrix \(A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\), the only permutation that doesn't produce a \(0\) product is the \(\text{id}\) permutation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a permutation \(\sigma\), if \(\sigma(i) \neq i\) then {{c1:: there exists a \(j\) such that \(\sigma(j) \neq j\)}}.
Extra
We're going to have to venture off the diagonal for at least one other element.<br><br>If we have a matrix \(A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\), the only permutation that doesn't produce a \(0\) product is the \(\text{id}\) permutation.
How do we find the inverse of \(A\) using Gauss-Jordan?
We do \(\text{RREF}(A, I)\) which gives us \((R, j_1, \dots, j_r, M)\) where in the case that \(A\) is invertible:
\(R\) is \(I\) and \(r = n\)
\(M = A^{-1}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<div>How do we find the inverse of \(A\) using Gauss-Jordan?</div>
Back
We do \(\text{RREF}(A, I)\) which gives us \((R, j_1, \dots, j_r, M)\) where in the case that \(A\) is invertible:<br><ul><li>\(R\) is \(I\) and \(r = n\)</li><li>\(M = A^{-1}\)</li></ul>
Given \(A \in \mathbb{R}^{m \times n}\) (can have any rank) and a vector \(b \in \mathbb{R}^m\), the uniquesolution to \[ \min_{x \in \mathbb{R}^n} ||x||^2 \] such that \(A^\top Ax = A^\top b\) is given by {{c2::\(\hat{x} = A^\dagger b\)}}.
Given \(A \in \mathbb{R}^{m \times n}\) (can have any rank) and a vector \(b \in \mathbb{R}^m\), the uniquesolution to \[ \min_{x \in \mathbb{R}^n} ||x||^2 \] such that \(A^\top Ax = A^\top b\) is given by {{c2::\(\hat{x} = A^\dagger b\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given \(A \in \mathbb{R}^{m \times n}\) (can have any rank) and a vector \(b \in \mathbb{R}^m\), the {{c1::<b>unique</b>}}<b> </b>solution to \[ \min_{x \in \mathbb{R}^n} ||x||^2 \] such that {{c1::\(A^\top Ax = A^\top b\)}} is given by {{c2::\(\hat{x} = A^\dagger b\)}}.
\(A^\top A\) has full rank when \(A\) has full column rank. Proof Included
If \(A^\top A x = 0\), then \(x^\top A^\top A x = ||Ax||^2 = 0\), so \(Ax = 0\). If A has full column rank \(N(A) = \{0\}\), thus \(x = 0\), proving \(A^\top A\) is invertible - full rank (as \(A^\top A \in \mathbb{R}^{n \times n}\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(A^\top A\) has full rank when \(A\) has {{c1::full column rank}}. <i>Proof Included</i>
Extra
<div>If \(A^\top A x = 0\), then \(x^\top A^\top A x = ||Ax||^2 = 0\), so \(Ax = 0\). If A has full column rank \(N(A) = \{0\}\), thus \(x = 0\), proving \(A^\top A\) is invertible - full rank (as \(A^\top A \in \mathbb{R}^{n \times n}\)).</div><div><br></div>
Let \(V\) be a subspace of \(\mathbb{R}^n\). We define the orthogonal complement of \(V\) as: \[ V^\perp = {{c2:: \{ w \in \mathbb{R}^n \ | \ w^\top v = 0 \ \text{for all } v \in V \} }}\]
Let \(V\) be a subspace of \(\mathbb{R}^n\). We define the orthogonal complement of \(V\) as: \[ V^\perp = {{c2:: \{ w \in \mathbb{R}^n \ | \ w^\top v = 0 \ \text{for all } v \in V \} }}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a subspace of \(\mathbb{R}^n\). We define the {{c1::orthogonal complement}} of \(V\) as: \[{{c1:: V^\perp }} = {{c2:: \{ w \in \mathbb{R}^n \ | \ w^\top v = 0 \ \text{for all } v \in V \} }}\]
Let \(A\) with \(n\) distinct real eigenvalues (meaning that the zeros of \(\det(A- \lambda I)\) as described in Corollary 8.1.3 are all distinct, algebraic multiplicity \(1\)), then {{c2::there is a basis of \(\mathbb{R}^n\) made up of EVs of \(A\)}}.
Let \(A\) with \(n\) distinct real eigenvalues (meaning that the zeros of \(\det(A- \lambda I)\) as described in Corollary 8.1.3 are all distinct, algebraic multiplicity \(1\)), then {{c2::there is a basis of \(\mathbb{R}^n\) made up of EVs of \(A\)}}.
We also call this the Eigenbasis or a complete set of real EVs, which will come in handy later for Diagonalisation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A\) with \(n\) {{c1::distinct real eigenvalues (meaning that the zeros of \(\det(A- \lambda I)\) as described in Corollary 8.1.3 are all distinct, algebraic multiplicity \(1\))::property and in terms of algebraic}}, then {{c2::there is a basis of \(\mathbb{R}^n\) made up of EVs of \(A\)}}.</div>
Extra
<div>We also call this the <b>Eigenbasis</b> or a <b>complete set of real EVs</b>, which will come in handy later for Diagonalisation.</div>
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>
Multilinearity of the determinant:\[\begin{vmatrix} a + a' & b + b' \\ c & d \end{vmatrix} = {{c1:: \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a' & b' \\ c & d \end{vmatrix} }}\]
Multilinearity of the determinant:\[\begin{vmatrix} a + a' & b + b' \\ c & d \end{vmatrix} = {{c1:: \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a' & b' \\ c & d \end{vmatrix} }}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Multilinearity of the determinant:\[\begin{vmatrix} a + a' & b + b' \\ c & d \end{vmatrix} = {{c1:: \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a' & b' \\ c & d \end{vmatrix} }}\]
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.
How could we use the certificate of no solution to show that a vector \(b\) is linearly independent from a set of vectors \(a_1, \dots, a_n\)?
We just put them into the matrix equation \(Ax = b\). If there is no solution, \(b\) is independent.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How could we use the certificate of no solution to show that a vector \(b\) is linearly independent from a set of vectors \(a_1, \dots, a_n\)?
Back
We just put them into the matrix equation \(Ax = b\). If there is no solution, \(b\) is independent.
The nullspace of \(N(A) \) is equal to the nullspace of \(N(A^\dagger)\). Proof Included
Intuitively this holds as \(A^\dagger\) projects onto the \(C(A)\).
Thus anything in \(C(A)^\bot = N(A^\top)\) is projected to \(0\). In other words, \(\forall x \in C(A^\top)^\bot = N(A^\top)\) we have \(A^\dagger x = 0\). We conclude that \(N(A) = C(A^\top)^\bot = N(A^\dagger)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The <b>nullspace of </b>\(N(A) \) is equal to {{c1:: the nullspace of \(N(A^\dagger)\)::Pseudoinverse}}. <i>Proof Included</i>
Extra
Intuitively this holds as \(A^\dagger\) projects onto the \(C(A)\).<br><br>Thus anything in \(C(A)^\bot = N(A^\top)\) is projected to \(0\). <br>In other words, \(\forall x \in C(A^\top)^\bot = N(A^\top)\) we have \(A^\dagger x = 0\).<br>We conclude that \(N(A) = C(A^\top)^\bot = N(A^\dagger)\).
\(AA^\top\) has full rank when \(A\) has full row rank.
\(AA^\top x = 0\) implies \(x^\top AA^\top x = 0 \implies ||A^\top x||^2 = 0\) thus \(x \in N(A^\top)\). And for \(A\) full row rank, \(N(A^\top) = \{0\}\). Thus \(x = 0\) and \(AA^\top \) has full rank - invertible.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(AA^\top\) has full rank when \(A\) has {{c1::full row rank}}.
Extra
\(AA^\top x = 0\) implies \(x^\top AA^\top x = 0 \implies ||A^\top x||^2 = 0\) thus \(x \in N(A^\top)\). And for \(A\) full row rank, \(N(A^\top) = \{0\}\). Thus \(x = 0\) and \(AA^\top \) has full rank - invertible.
\(A \in \mathbb{R}^{n \times n}\) arbitrary non-symmetric has rank \(n - \dim(N(A))\) so it's \(n\) minus the geometric multiplicity of \(\lambda = 0\) .
\(A \in \mathbb{R}^{n \times n}\) arbitrary non-symmetric has rank \(n - \dim(N(A))\) so it's \(n\) minus the geometric multiplicity of \(\lambda = 0\) .
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(A \in \mathbb{R}^{n \times n}\) arbitrary non-symmetric has rank {{c1:: \(n - \dim(N(A))\) so it's \(n\) minus the geometric multiplicity of \(\lambda = 0\) ::in terms of multiplicities}}.
For \(R\) result of RREF on \(A\), \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) where \(R = \begin{bmatrix} R’ \in r \times n \\ 0 \in (m - r) \times n \end{bmatrix}\).
This \(R’\) is the \(R’\) from the CR decomposition (non-zero rows).
And \(C\) is the submatrix taking only \(j_1, j_2, \dots, j_r\) (independent columns).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can we find the CR-Decomposition from RREF?
Back
<div>For \(R\) result of RREF on \(A\), \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) where \(R = \begin{bmatrix} R’ \in r \times n \\ 0 \in (m - r) \times n \end{bmatrix}\).</div><div><ol><li>This \(R’\) is the \(R’\) from the CR decomposition (non-zero rows).</li><li>And \(C\) is the submatrix taking only \(j_1, j_2, \dots, j_r\) (independent columns).</li></ol><div><img src="paste-f744be89c3e7bb54b2aac0d9dbf4595e8ec7ec7e.jpg"></div></div>
Let \(V, W\) be orthogonal subspaces of \(\mathbb{R}^n\). Then the following statements are equivalent:
\(W = V^\perp\)
\(\dim(V) + \dim(W) = n\)
{{c3::Every \(u \in \mathbb{R}^n\) can be written as \(u = v + w\) with unique vectors \(v \in V\), \(w \in W\)}}
In words, this means that we can combine two orthogonal subspaces and create a new subspace, whose dimension is the sum of the two dimensions.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V, W\) be orthogonal subspaces of \(\mathbb{R}^n\). Then the following statements are equivalent:</div><div><ol><li>{{c1::\(W = V^\perp\)}}</li><li>{{c2::\(\dim(V) + \dim(W) = n\)}}</li><li>{{c3::Every \(u \in \mathbb{R}^n\) can be written as \(u = v + w\) with unique vectors \(v \in V\), \(w \in W\)}}</li></ol></div><blockquote><ul>
</ul></blockquote>
Extra
<i>In words, this means that</i> we can combine two orthogonal subspaces and create a new subspace, whose dimension is the sum of the two dimensions.
How can we use Gauss-Jordan to simplify the determinant calculations?
We can use Gauss-Jordan to make any matrix upper triangular (then the determinant is the product of the diagonals).
We are allowed to use:
Row addition / substraction
Exchanging rows (change sign)
Multiply rows (multiply the determinant at the end)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How can we use Gauss-Jordan to simplify the determinant calculations?
Back
We can use Gauss-Jordan to make any matrix upper triangular (then the determinant is the product of the diagonals).<br><br>We are allowed to use:<br><ul><li>Row addition / substraction</li><li>Exchanging rows (change sign)</li><li>Multiply rows (multiply the determinant at the end)</li></ul>
Given a square matrix \(A \in \mathbb{R}^{n \times n}\), the determinant \(\det(A)\) is defined as: \[ \det(A) = {{c1:: \sum_{\sigma \in \Pi_n} \text{sgn}(\sigma) \prod_{i = 1}^n A_{i, \sigma(j)} }}\] where \(\Pi_n\) is the set of all permutations of \(n\) elements (of which there are \(n!\)).
Given a square matrix \(A \in \mathbb{R}^{n \times n}\), the determinant \(\det(A)\) is defined as: \[ \det(A) = {{c1:: \sum_{\sigma \in \Pi_n} \text{sgn}(\sigma) \prod_{i = 1}^n A_{i, \sigma(j)} }}\] where \(\Pi_n\) is the set of all permutations of \(n\) elements (of which there are \(n!\)).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given a square matrix \(A \in \mathbb{R}^{n \times n}\), the determinant \(\det(A)\) is defined as: \[ \det(A) = {{c1:: \sum_{\sigma \in \Pi_n} \text{sgn}(\sigma) \prod_{i = 1}^n A_{i, \sigma(j)} }}\] where {{c1:: \(\Pi_n\) is the set of all permutations of \(n\) elements (of which there are \(n!\))}}.
For \(A\) a matrix and \(M\) an invertible matrix:
\(C(A) = \) {{c1::Not equal to \(\textbf{C}(MA)\), the column space changes!}}
\(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) after RREF is \(\begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}\) which spans a completely different line.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>For \(A\) a matrix and \(M\) an invertible matrix:</div><div><br></div>\(C(A) = \) {{c1::N<b>ot equal to </b>\(\textbf{C}(MA)\), the column space changes!}}
Extra
\(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) after RREF is \(\begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}\) which spans a completely different line.
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = n\), the pseudoinverse \(A^\dagger\) is a left inverse of \(A\), meaning: \[ A^\dagger A = I \]Proof Included
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = n\), the pseudoinverse \(A^\dagger\) is a left inverse of \(A\), meaning: \[ A^\dagger A = I \]Proof Included
Proof: Since \(A\) has full column rank, \(A^\top A\) invertible and then \(A^\dagger A = ((A^\top A)^{-1} A^\top)A\) \(= (A^\top A)^{-1} (A^\top A) = I\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = n\), the pseudoinverse \(A^\dagger\) is {{c1::a left inverse}} of \(A\), meaning: \[{{c1:: A^\dagger A = I }}\]<i>Proof Included</i>
Extra
<b>Proof: </b>Since \(A\) has full column rank, \(A^\top A\) invertible and then \(A^\dagger A = ((A^\top A)^{-1} A^\top)A\) \(= (A^\top A)^{-1} (A^\top A) = I\).
If \(Ax = b\) has a solution, then \(\textbf{Sol}(A, b)\) has dimension \(n - r\), where \[ \dim(\textbf{Sol}(A, b)) := {{c1::\dim(\textbf{N}(A)) }}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(Ax = b\) has a solution, then \(\textbf{Sol}(A, b)\) has dimension {{c1::\(n - r\)}}, where \[ \dim(\textbf{Sol}(A, b)) := {{c1::\dim(\textbf{N}(A)) }}\]
Let \(V\) be a finitely generated vector space and let \(G \subseteq V\) be a finite subset with \(\textbf{Span}(G) = V\).
Then \(V\) has a basis \(B \subseteq G\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a finitely generated vector space and let \(G \subseteq V\) be a finite subset with \(\textbf{Span}(G) = V\). <br><br>Then \(V\) {{c1::has a basis \(B \subseteq G\)}}.
Because \(R(A) = C(A^\top)\) and \(N(A)\) are orthogonal, we can decompose any vector \(x \in \mathbb{R}^n\) into \(x = x_r + x_n\) where \(x_r \in R(A) \) is unique and \(x_n \in N(A)\) can be any value.
Because \(R(A) = C(A^\top)\) and \(N(A)\) are orthogonal, we can decompose any vector \(x \in \mathbb{R}^n\) into \(x = x_r + x_n\) where \(x_r \in R(A) \) is unique and \(x_n \in N(A)\) can be any value.
We can take any \(x_n \in N(A)\) because when doing \(Ax = Ax_r + Ax_n = Ax_r\) as \(Ax_n = 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Because \(R(A) = C(A^\top)\) and \(N(A)\) are orthogonal, we can decompose any vector \(x \in \mathbb{R}^n\) into {{c1:: \(x = x_r + x_n\) where \(x_r \in R(A) \) is unique and \(x_n \in N(A)\) can be any value}}.
Extra
We can take any \(x_n \in N(A)\) because when doing \(Ax = Ax_r + Ax_n = Ax_r\) as \(Ax_n = 0\).<br><img src="paste-528b4c56a915a99153a081b8b57edb99a74f759c.jpg">
What happens in the case of linearly dependent vectors in \(A\) during Gram-Schmidt?
Since in a linearly dependent set of vectors one of them is a linear combination of the previous ones, you'd get \(0\) in the subtraction step for it. By excluding those \(0\)'s you'd still get an orthonormal basis.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What happens in the case of linearly dependent vectors in \(A\) during Gram-Schmidt?
Back
Since in a linearly dependent set of vectors one of them is a linear combination of the previous ones, you'd get \(0\) in the subtraction step for it. By excluding those \(0\)'s you'd still get an orthonormal basis.
Certificate of no solutions:\[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = \emptyset\]is equivalent to:
\[{{c1:: \{z \in \mathbb{R}^m \ | \ A^\top z = 0, b^\top z = 1 \} \not = \emptyset }}\]
Note that we don’t need it to be \(1\), it just has to be \(\neq 0\).
In words: our LSE \(Ax = b\) does not have any solutions if and only if there exists a vector \(z\) that is orthogonal to all columns of \(A\) but not orthogonal to \(b\).
The blue vector \(z\) is orthogonal to all in \(C(A)\), the blue subspace. If \(b\) is not orthogonal to \(z\), this means that it cannot possibly be in the subspace, it must be slightly above/below it. Therefore \(b \not \in C(A)\) and thus there's no solution.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div><b>Certificate</b> of no solutions:\[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = \emptyset\]is <b>equivalent to:</b></div><br>\[{{c1:: \{z \in \mathbb{R}^m \ | \ A^\top z = 0, b^\top z = 1 \} \not = \emptyset }}\]<div>Note that we don’t need it to be \(1\), it just has to be \(\neq 0\).</div>
Extra
<i>In words</i>: our LSE \(Ax = b\) does not have any solutions if and only if there exists a vector \(z\) that is orthogonal to all columns of \(A\) but not orthogonal to \(b\).<br><br><img src="paste-ec06b0f642f6f657a4c518d3e69158b4b6efec24.jpg"><br>The blue vector \(z\) is orthogonal to all in \(C(A)\), the blue subspace.<br>If \(b\) is not orthogonal to \(z\), this means that it cannot possibly be in the subspace, it must be slightly above/below it. Therefore \(b \not \in C(A)\) and thus there's no solution.
Get \(C\) by taking the independent columns of \(A\) (those corresponding to the pivot columns in RREF)
Get \(R'\) by removing the \(0\) rows of the RREF form of \(A\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
To compute the CR decomposition, we:
Back
<div>Compute the RREF of \(A\)</div><ol><li>Get \(C\) by taking the independent columns of \(A\) (those corresponding to the pivot columns in RREF)</li><li>Get \(R'\) by removing the \(0\) rows of the RREF form of \(A\).</li></ol><div><img src="paste-6d1e5417f3fb9c6ffbcbc63fa2de4c554a3315b1.jpg"></div>
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda \in \mathbb{C}\) be an eigenvalue of \(A\), then {{c1::\(\lambda \in \mathbb{R}\)::property of the EW}}. Proof Included
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda \in \mathbb{C}\) be an eigenvalue of \(A\), then {{c1::\(\lambda \in \mathbb{R}\)::property of the EW}}. Proof Included
Proof \(v \in \mathbb{C}^n\) be EV of \(\lambda\). Thus we have \(Av = \lambda v\). Since \(A\) is symmetric we have \(A^ = A\). \[\begin{align} \overline{\lambda}||v||^2 &= \overline{\lambda} v^*v \\ &= (\lambda v)^*v \\ &= (Av)^*v = v^*A^*v \\ &= v^* Av \text{ (uses } A^* = A \text{) } \\ &= v^*\lambda v \\ &= \lambda ||v||^2 \end{align}\]Since \(v \neq 0\), then \(||v|| \neq 0\) and so \(\lambda = \overline{\lambda}\) thus \(\lambda \in \mathbb{R}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda \in \mathbb{C}\) be an eigenvalue of \(A\), then {{c1::\(\lambda \in \mathbb{R}\)::property of the EW}}. <i>Proof Included</i>
Extra
<div><strong>Proof</strong> \(v \in \mathbb{C}^n\) be EV of \(\lambda\). Thus we have \(Av = \lambda v\). Since \(A\) is symmetric we have \(A^ = A\). \[\begin{align} \overline{\lambda}||v||^2 &= \overline{\lambda} v^*v \\ &= (\lambda v)^*v \\ &= (Av)^*v = v^*A^*v \\ &= v^* Av \text{ (uses } A^* = A \text{) } \\ &= v^*\lambda v \\ &= \lambda ||v||^2 \end{align}\]Since \(v \neq 0\), then \(||v|| \neq 0\) and so \(\lambda = \overline{\lambda}\) thus \(\lambda \in \mathbb{R}\).</div>
A minimiser of \(\min_{\hat{x} \in \mathbb{R}^n} || A\hat{x} - b||^2\) is also a solution of \(A^\top A \hat{x} = A^\top b\).
When \(A\) has independent columns the unique minimiser of \(\hat{x}\) is given by: \[ \hat{x} = {{c2::(A^\top A)^{-1} A^\top b }}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>A minimiser of \(\min_{\hat{x} \in \mathbb{R}^n} || A\hat{x} - b||^2\) is also a solution of \(A^\top A \hat{x} = A^\top b\).</div><div><br></div><div>When \(A\) has {{c1::<b>independent columns</b>}} the {{c1::<b>unique</b>}} minimiser of \(\hat{x}\) is given by: \[ \hat{x} = {{c2::(A^\top A)^{-1} A^\top b }}\]</div>
Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the non-zero eigenvalues of \(A^\top A\) are the same ones as of \(AA^\top\). Proof Included
Shared EWs: For \((A^\top A)v_k = \lambda_k v_k\) we get \(AA^\top A v_k = \lambda_k Av_k\) and thus \(Av_k\) EV and \(\lambda_k\) is an EW of \(AA^\top\).
Orthogonality: For \(j \neq k\) we have \((Av_j)^\top (Av_k) = v_j^\top A^\top Av_k = v_j^\top \lambda_k v_k = \lambda_k v_j^\top v_k = 0\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the {{c1::non-zero eigenvalues}} of {{c2::\(A^\top A\)}} are the same ones as of {{c2::\(AA^\top\)}}. <i>Proof Included</i></div>
Extra
<b>Shared EWs:</b> For \((A^\top A)v_k = \lambda_k v_k\) we get \(AA^\top A v_k = \lambda_k Av_k\) and thus \(Av_k\) EV and \(\lambda_k\) is an EW of \(AA^\top\).<br><br><b>Orthogonality:</b> For \(j \neq k\) we have \((Av_j)^\top (Av_k) = v_j^\top A^\top Av_k = v_j^\top \lambda_k v_k = \lambda_k v_j^\top v_k = 0\)<div></div><div></div>
Any degree \(n\) polynomial \(P(z) = a_n z^n + a_{n-1} z^{n-1} + \dots + a_1 z + a_0\) (with \(n \geq 1\) and \(a_n \neq 0\)) has at least one zero \(\lambda \in \mathbb{C}\) such that \(P(\lambda) = 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the fundamental theorem of algebra?
Back
<div>Any degree \(n\) polynomial \(P(z) = a_n z^n + a_{n-1} z^{n-1} + \dots + a_1 z + a_0\) (with \(n \geq 1\) and \(a_n \neq 0\)) has at least one zero \(\lambda \in \mathbb{C}\) such that \(P(\lambda) = 0\).</div>
Suppose that \(\{x \in \mathbb{R}^n \ | \ Ax = b \} \not = \emptyset\). Then \[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = x_1 + N(A) \] where \(x_1 \in R(A)\) is unique such that \(Ax_1 = b\).
This means that if there's more than one solution to the system (i.e. the nullspace is not \(= \{0\}\)), then the set of all solutions is a specific solution + the entire nullspace.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Suppose that \(\{x \in \mathbb{R}^n \ | \ Ax = b \} \not = \emptyset\). Then \[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = {{c1::x_1 + N(A) }}\] where {{c1:: \(x_1 \in R(A)\) is unique such that \(Ax_1 = b\)}}.
Extra
This means that if there's more than one solution to the system (i.e. the nullspace is not \(= \{0\}\)), then the set of all solutions is a specific solution + the entire nullspace.
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent rows?
Because \(rank(A) = r = m\) and thus \(n \geq m\)
\(C(A)\) spans \(\mathbb{R}^m\) (columns span the space)
\(R(A) \subseteq\) \(\mathbb{R}^n\)
There could be multiple \(x \in \mathbb{R}^n\) that map to \(T_A(x) = b\). We pick the one with the smallest norm \(||x||^2\).
We know \(x = x_r + x_n\) for \(x_r \in R(A)\) and \(x_n \in N(A)\) thus we pick \(x = x_r + 0\) to get the smallest norm.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent rows?
Back
Because \(rank(A) = r = m\) and thus \(n \geq m\)<ul><li>\(C(A)\) spans \(\mathbb{R}^m\) (columns span the space)</li><li>\(R(A) \subseteq\) \(\mathbb{R}^n\)</li></ul>There could be multiple \(x \in \mathbb{R}^n\) that map to \(T_A(x) = b\). We pick the one with the smallest norm \(||x||^2\).<br><br>We know \(x = x_r + x_n\) for \(x_r \in R(A)\) and \(x_n \in N(A)\) thus we pick \(x = x_r + 0\) to get the smallest norm.<br><br><div> <img src="paste-4707a6f9abbe720721f1a4ab781ab8c8fda3c76a.jpg"></div>
For an eigenvalue \(\lambda\) of \(M\), \(\lambda + c\) is a real eigenvalue of the matrix \(M + cI\).
Intuitively this makes sense as by adding \(cI\) we're increasing the values on the diagonal, meaning we have to increase the value of \(\lambda\) by the same amount so that we get \(0\) again.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For an eigenvalue \(\lambda\) of \(M\), {{c1::\(\lambda + c\)}} is a real eigenvalue of the matrix {{c2::\(M + cI\)}}.
Extra
Intuitively this makes sense as by adding \(cI\) we're increasing the values on the diagonal, meaning we have to increase the value of \(\lambda\) by the same amount so that we get \(0\) again.
\(QQ^\top\) is the projection on the span of the \(q_i\)'s and thus also on the \(a_i\)'s (\(C(Q) = C(A)\)).
Thus \(QQ^\top A = A\) and therefore \(QR = QQ^\top A = A\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Why does \(QR\) give \(A\)?
Back
\(QQ^\top\) is the projection on the span of the \(q_i\)'s and thus also on the \(a_i\)'s (\(C(Q) = C(A)\)).<br><br>Thus \(QQ^\top A = A\) and therefore \(QR = QQ^\top A = A\).
If \(b \neq 0\), \(\textbf{Sol}(A, b)\) is {{c1::not a subspace of \(\mathbb{R}^n\)}}.
Because it doesn't contain the zero vector!
If \(b \neq 0\), the the solution space is "shifted" off the origin:
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If {{c2::\(b \neq 0\)}}, \(\textbf{Sol}(A, b)\) is {{c1::not a subspace of \(\mathbb{R}^n\)}}.
Extra
Because it doesn't contain the zero vector!<br><br>If \(b \neq 0\), the the solution space is "shifted" off the origin:<br><img src="paste-6a57d261438b0237aa2afbd05a1cb6e451fd99f1.jpg">
Let \(S\) be a subspace in \(\mathbb{R}^m\) and \(A\) a matrix whose columns are a basis of \(S\).
The projection matrix \(P\) to a matrix \(A\) is given by: {{c1::\(P = A (A^\top A)^{-1} A^\top\)}}
The projection of \(b \in \mathbb{R}^m\) to \(S\) is given by \(\text{proj}_S(b) = Pb\).
Note the condition for the columns to be a basis - this forces them to be independent, which means \(A^\top A\) invertible by Lemma 5.2.4.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(S\) be a subspace in \(\mathbb{R}^m\) and \(A\) a matrix whose <b>columns</b> are a <b>basis</b> of \(S\).<br><br>The projection matrix \(P\) to a matrix \(A\) is given by: {{c1::\(P = A (A^\top A)^{-1} A^\top\)}}<br><br>The projection of \(b \in \mathbb{R}^m\) to \(S\) is given by \(\text{proj}_S(b) = Pb\).
Extra
Note the condition for the columns to be a basis - this forces them to be independent, which means \(A^\top A\) invertible by Lemma 5.2.4.
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
Name 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.
Name 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
Name 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>
Every symmetric PSD matrix \(M\) is a Gram matrix of an upper triangular matrix \(C\).
\(M = C^\top C\) is known as the Cholesky decomposition. Proof Included
Thus all PSD matrices are decomposable as \(C^\top C\) with \(C\) upper triangular!
Proof: Since \(M\) is symmetric PSD, we can say \(M = V \Lambda V^\top\) with \(\Lambda\) diagonal matrix with EWs in the diagonal.
Since \(M\) is PSD, the eigenvalues (the diagonals) of \(\Lambda\) are \(\geq 0\) (non-negative) and thus we can build \(\Lambda^{1/2}\) by taking the square root of each diagonal entry.
To make them be upper triangular, we take the QR-decomposition (\(V\Lambda^{1/2}\) has linearly independent columns) \((V \Lambda^{1/2})^\top = QR\) with \(Q\) such that \(Q^\top Q = I\) and \(R\) upper triangular.
We then have \(M = (V \Lambda^{1/2})(V \Lambda^{1/2})^\top\)\( = (QR)^\top (QR) = \)\(R^\top Q^\top Q R = R^\top R\)
Taking \(C = R\) we get \(M = C^\top C\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Every symmetric PSD matrix \(M\) is a {{c1::Gram matrix of an upper triangular matrix}} \(C\).<br><br>\(M = {{c2::C^\top C}}\) is known as the {{c2::Cholesky decomposition}}.<br><i>Proof Included</i>
Extra
Thus all PSD matrices are decomposable as \(C^\top C\) with \(C\) upper triangular!<br><br><div><b>Proof:</b> Since \(M\) is symmetric PSD, we can say \(M = V \Lambda V^\top\) with \(\Lambda\) diagonal matrix with EWs in the diagonal. </div><div><ul><li>Since \(M\) is PSD, the eigenvalues (the diagonals) of \(\Lambda\) are \(\geq 0\) (non-negative) and thus we can build \(\Lambda^{1/2}\) by taking the square root of each diagonal entry.</li><li>To make them be upper triangular, we take the QR-decomposition (\(V\Lambda^{1/2}\) has linearly independent columns) \((V \Lambda^{1/2})^\top = QR\) with \(Q\) such that \(Q^\top Q = I\) and \(R\) upper triangular. </li><li>We then have \(M = (V \Lambda^{1/2})(V \Lambda^{1/2})^\top\)\( = (QR)^\top (QR) = \)\(R^\top Q^\top Q R = R^\top R\) </li></ul></div><div>Taking \(C = R\) we get \(M = C^\top C\).</div>
The \(\det\) of \(U\) upper (or lower) triangular is \(\det U = {{c1:: (u_{11})(u_{22}) \dots (u_{nn}) }}\). Intuition included
(The product of the diagonal entries.)
This is because any permutation except the \(\text{id}\) permutation chooses a \(0\) at least once.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The \(\det\) of \(U\) upper (or lower) triangular is \(\det U = {{c1:: (u_{11})(u_{22}) \dots (u_{nn}) }}\). <i>Intuition included</i>
Extra
(The product of the diagonal entries.)<br><br>This is because any permutation except the \(\text{id}\) permutation chooses a \(0\) at least once.
{{c3::The columns form an orthonormal basis for \(\mathbb{R}^n\).}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Assume \(Q\) is orthogonal and <b>square</b>. Then:</div><div><ul><li>{{c1::\(QQ^\top = I\)}}</li><li>{{c2::\(Q^{-1} = Q^\top\)}}</li><li>{{c3::The columns form an orthonormal basis for \(\mathbb{R}^n\).}}</li></ul></div><blockquote><ul>
</ul></blockquote>
Spectral Theorem: Any symmetric matrix \(A \in \mathbb{R}^{n \times n}\) has \(n\) real eigenvalues and {{c1::an orthonormal basis of \(\mathbb{R}^{n \times n}\) consisting of it's eigenvectors::EV}}.
Spectral Theorem: Any symmetric matrix \(A \in \mathbb{R}^{n \times n}\) has \(n\) real eigenvalues and {{c1::an orthonormal basis of \(\mathbb{R}^{n \times n}\) consisting of it's eigenvectors::EV}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<b>Spectral Theorem: </b>Any symmetric matrix \(A \in \mathbb{R}^{n \times n}\) has {{c1::\(n\) real eigenvalues::EW}} and {{c1::an orthonormal basis of \(\mathbb{R}^{n \times n}\) consisting of it's eigenvectors::EV}}.
If \(A^T A\) is invertible, we have a unique solution \(\hat{x}\) that satisfies the equation: \[ p = A\hat{x} = {{c1:: A (A^\top A)^{-1} A^\top b }}\]
If \(A^T A\) is invertible, we have a unique solution \(\hat{x}\) that satisfies the equation: \[ p = A\hat{x} = {{c1:: A (A^\top A)^{-1} A^\top b }}\]
From \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\) we can construct a formula for \(\mathbf{p}\):
\((A^\top A)^{-1}(A^\top A) \mathbf{\hat{x}} = (A^\top A)^{-1}A^\top \mathbf{b}\)
(\(A^\top A\) invertible if the columns of \(A\) are independent), which gives us:
\(A \mathbf{\hat{x}} = A (A^\top A)^{-1} A^\top \mathbf{b} = \mathbf{p}\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>If \(A^T A\) is invertible, we have a unique solution \(\hat{x}\) that satisfies the equation: \[ p = A\hat{x} = {{c1:: A (A^\top A)^{-1} A^\top b }}\]</div>
Extra
From \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\) we can construct a formula for \(\mathbf{p}\): <br><br> \((A^\top A)^{-1}(A^\top A) \mathbf{\hat{x}} = (A^\top A)^{-1}A^\top \mathbf{b}\) <br><br>(\(A^\top A\) invertible if the columns of \(A\) are independent), which gives us:<br><br> \(A \mathbf{\hat{x}} = A (A^\top A)^{-1} A^\top \mathbf{b} = \mathbf{p}\).
Let \(A\) be an \(m \times n\) matrix with linearly independentcolumns. The QR decomposition is given by: \[ A = QR \]where
\(Q\) is an \(m \times n\) matrix with orthonormal columns (they are the output of Gram-Schmidt)
\(R\) is an upper triangular matrix given by \(R = Q^\top A\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A\) be an \(m \times n\) matrix with {{c1::<b>linearly independent</b>}}<b> </b>columns. The QR decomposition is given by: \[ A = QR \]where</div><div><ul><li>\(Q\) is {{c1::an \(m \times n\) matrix with orthonormal columns (they are the output of Gram-Schmidt) }}</li><li>\(R\) is {{c2:: an upper triangular matrix given by \(R = Q^\top A\)}}.</li></ul></div>
Scalar product properties: \(u, v, w \in \mathbb{R}^m\) be vectors and \(\lambda \in \mathbb{R}\) a scalar.
\(v \cdot w = w \cdot v\) (symmetry / commutatitivity
\((\lambda v) \cdot w = \lambda (v \cdot w)\) (scalars move freely)
\(u \cdot (v + w) = u \cdot v + u \cdot w\) and \((u + v) \cdot w = u\cdot w + v \cdot w\) (distributivity)
\(v \cdot v \geq 0\) with equality if and only if \(v = 0\) (positive definiteness
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Scalar product properties: \(u, v, w \in \mathbb{R}^m\) be vectors and \(\lambda \in \mathbb{R}\) a scalar.<br><ol><li>{{c1::\(v \cdot w = w \cdot v\) (symmetry / commutatitivity}}</li><li>{{c2:: \((\lambda v) \cdot w = \lambda (v \cdot w)\) (scalars move freely)}}</li><li>{{c3:: \(u \cdot (v + w) = u \cdot v + u \cdot w\) and \((u + v) \cdot w = u\cdot w + v \cdot w\) (distributivity)}}</li><li>{{c4:: \(v \cdot v \geq 0\) with equality if and only if \(v = 0\) (positive definiteness}}</li></ol>
When doing Least Squares we represent our data as \(A\) and \(b\) which are?
\(A = \begin{bmatrix} 1 & t_1 \\ 1 & t_2 \\ \vdots & \vdots \\ 1 & t_{m-1} \\ 1 & t_m \end{bmatrix}\) is a matrix containing the coefficients for \(\alpha_0\) and \(\alpha_1\) in our fitting equation, so here \(\alpha_1 t + \alpha_0\).
\(b = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{pmatrix}\) is the vector with the result of each equation (the datapoints).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
When doing Least Squares we represent our data as \(A\) and \(b\) which are?
Back
\(A = \begin{bmatrix} 1 & t_1 \\ 1 & t_2 \\ \vdots & \vdots \\ 1 & t_{m-1} \\ 1 & t_m \end{bmatrix}\) is a matrix containing the coefficients for \(\alpha_0\) and \(\alpha_1\) in our fitting equation, so here \(\alpha_1 t + \alpha_0\).<br><br>\(b = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{pmatrix}\) is the vector with the result of each equation (the datapoints).
Let \(A \in \mathbb{R}^{m \times n}\) and \(x, y \in C(A^\top)\).
We have: \[ Ax = Ay \Leftrightarrow x = y \]
This is because \(x, y\) have unique decompositions into the two fundamental subspaces. \[ Ax = Ay \Leftrightarrow x - y \in N(A) \Leftrightarrow \](this holds as \(\implies A(x - y) = 0\)).
\[x^\top(x - y) = 0 = y^\top(x - y) \Leftrightarrow\]because of orthogonality of the subspaces\[ (x - y)^\top(x - y) = 0 \]and from this follows that \(||x - y||^2 = 0 \implies x - y = 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{m \times n}\) and \(x, y \in C(A^\top)\). <br><br>We have: \[ {{c1::Ax = Ay}} \Leftrightarrow {{c2:: x = y }}\]
Extra
This is because \(x, y\) have unique decompositions into the two fundamental subspaces. \[ Ax = Ay \Leftrightarrow x - y \in N(A) \Leftrightarrow \](this holds as \(\implies A(x - y) = 0\)).<br><br>\[x^\top(x - y) = 0 = y^\top(x - y) \Leftrightarrow\]because of orthogonality of the subspaces\[ (x - y)^\top(x - y) = 0 \]and from this follows that \(||x - y||^2 = 0 \implies x - y = 0\).
Exchanging two rows flips the sign of the determinant.
Subtracting two rows does not change the \(\det\). (we can use Gauss-Jordan (only row substractions) to simplify calculations…)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<ol>
<li>{{c1::\(\det(A) = \det(A^T)\)}}</li><li>\(\det(I) = {{c2::1}}\)</li><li>\(\det(A) = 0\) if {{c3::linearly dependent columns.}}</li><li>{{c4::Exchanging two rows flips the sign of the determinant.::Effect of row exchange?}}</li><li>{{c5::Subtracting two rows does not change the \(\det\). (we can use Gauss-Jordan (only row substractions) to simplify calculations…)::Subtraction}}</li></ol>
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \det(A) = {{c1:: \prod_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Be careful to include each eigenvalue as often as their algebraic multiplicity in these sums/products. You can use this to double check calculations.
Intuition: The eigenvalues describe how much each eigenvector is scaled. Thus by multiplying the scaling of each dimension, we can figure out the volume of the unit cube which is the determinant.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \det(A) = {{c1:: \prod_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Extra
<div><strong>Be careful</strong> to include each eigenvalue as often as their <em>algebraic multiplicity</em> in these sums/products. You can use this to double check calculations.</div><div><br></div><div><i>Intuition:</i> The eigenvalues describe how much each eigenvector is scaled. Thus by multiplying the scaling of each dimension, we can figure out the <i>volume of the unit cube</i> which is the determinant.</div>
\(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices. The matrix \(A\) has a complete set of real eigenvectors if and only if \(B\) does . Proof Included
\(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices. The matrix \(A\) has a complete set of real eigenvectors if and only if \(B\) does . Proof Included
Proof \(\lambda, v\) EW, EV pair for matrix \(A\) iff \(Av = \lambda v \Leftrightarrow \lambda S^{-1}v = S^{-1}Av = S^{-1}ASS^{-1}v = B(S^{-1}v)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
\(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices. The matrix \(A\) has {{c1::a complete set of real eigenvectors if and only if \(B\) does :: EVs}}. <i>Proof Included</i>
Extra
<div><b>Proof </b>\(\lambda, v\) EW, EV pair for matrix \(A\) iff \(Av = \lambda v \Leftrightarrow \lambda S^{-1}v = S^{-1}Av = S^{-1}ASS^{-1}v = B(S^{-1}v)\)<b>.</b></div>
\(\textbf{Sol}(A, 0) = \textbf{N}(A)\) as we search for the zeros. We thus first find the nullspace, and then shift it by an arbitrary solution of \(Ax = b\). Let \(s\) be some solution of \(Ax = b\). Then \[ \textbf{Sol}(A, b) = \{s + x : x \in \textbf{N}(A)\} \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Express \(\text{Sol}(A, b)\) in standard form:
Back
\(\textbf{Sol}(A, 0) = \textbf{N}(A)\) as we search for the zeros. We thus first find the nullspace, and then shift it by an arbitrary solution of \(Ax = b\).<br>Let \(s\) be some solution of \(Ax = b\). Then \[ \textbf{Sol}(A, b) = \{s + x : x \in \textbf{N}(A)\} \]
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)\)}}
Using QR decomposition the normal equations \(A^\top A x = A^\top b\) simplify to:
\(A^\top A = (QR)^\top (QR) = R^\top Q^\top Q R= R^\top R\) and thus we get:\[ R^\top R \hat{x} = R^\top Q^\top b \]Since \(R\) is invertible we simplify to: \[ R\hat{x} = Q^\top b \]which can efficiently be solved by back substitution since \(R\) is a triangular matrix.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Using QR decomposition the normal equations \(A^\top A x = A^\top b\) simplify to:
Back
\(A^\top A = (QR)^\top (QR) = R^\top Q^\top Q R= R^\top R\) and thus we get:\[ R^\top R \hat{x} = R^\top Q^\top b \]Since \(R\) is invertible we simplify to: \[ R\hat{x} = Q^\top b \]which can efficiently be solved by back substitution since \(R\) is a triangular matrix.<br><img src="paste-bba0016ef7ccad1dad42a31c02e8c787f3e3dea9.jpg">
Let \(T :V \rightarrow W\) be a bijective linear transformation between vector spaces \(V\) and \(W\) . Let \(B = {v1, v2, . . . , v_l} \subseteq V\) be a finite set of size \(l\), and let \[ T(B) = {T(v_1), T(v_2), \dots, T(v_l)} \subseteq Q \] be the transformed set.
Then \(|T(B)| = |B|\). Moreover, \(B\) is a basis of \(V\) if and only if \(T(B)\) is a basis of \(W\). We therefore also have \(\dim(V) = \dim(W)\).
Let \(T :V \rightarrow W\) be a bijective linear transformation between vector spaces \(V\) and \(W\) . Let \(B = {v1, v2, . . . , v_l} \subseteq V\) be a finite set of size \(l\), and let \[ T(B) = {T(v_1), T(v_2), \dots, T(v_l)} \subseteq Q \] be the transformed set.
Then \(|T(B)| = |B|\). Moreover, \(B\) is a basis of \(V\) if and only if \(T(B)\) is a basis of \(W\). We therefore also have \(\dim(V) = \dim(W)\).
This holds because of the bijectivity of the linear transformation.
Further, if there is one such bijective transformation, then we call the vector spaces isomorphic and \(T\) an isomorphism between \(V\) and \(W\) (Definition 4.28).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(T :V \rightarrow W\) be a bijective linear transformation between vector spaces \(V\) and \(W\) . Let \(B = {v1, v2, . . . , v_l} \subseteq V\) be a finite set of size \(l\), and let \[ T(B) = {T(v_1), T(v_2), \dots, T(v_l)} \subseteq Q \] be the transformed set.</div><div><br></div><div>Then {{c1::\(|T(B)| = |B|\)::cardinality comparison}}. Moreover, \(B\) is a basis of \(V\) if and only if {{c1::\(T(B)\) is a basis of \(W\)}}. We therefore also have {{c1::\(\dim(V) = \dim(W)\)}}.</div>
Extra
This holds because of the bijectivity of the linear transformation.<br><br>Further, if there is one such bijective transformation, then we call the vector spaces <i>isomorphic</i> and \(T\) an <i>isomorphism</i> between \(V\) and \(W\) (Definition 4.28).
Subspaces are orthogonal if their basis-vectors are orthogonal.
We can determine if two subspaces are orthogonal by only comparing their basis vectors, since if they are orthogonal, all their linear combinations will be as well.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Subspaces are orthogonal if {{c1::their basis-vectors are orthogonal::in terms of basis}}.
Extra
<div>We can determine if two <strong>subspaces are orthogonal by only comparing their basis vectors</strong>, since if they are orthogonal, all their linear combinations will be as well.</div>
Multilinearity of the determinant:\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = {{c1:: t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} }}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Multilinearity of the determinant:\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = {{c1:: t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} }}\]
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1,\lambda_2 \in \mathbb{R}\) be two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\):
\(v_1\) and \(v_2\) are orthogonal. Proof Included
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1,\lambda_2 \in \mathbb{R}\) be two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\):
\(v_1\) and \(v_2\) are orthogonal. Proof Included
Proof \(\lambda_1 v_1 ^\top v_2 = (Av_1)^\top v_2 = v_1^\top A ^\top v_2 = v_1^\top (Av_2) = \lambda_2 v_1^\top v_2\) Thus \(v_1^\top v_2\) must be \(0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1,\lambda_2 \in \mathbb{R}\) be two {{c2::distinct}} eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\):</div><div><br></div><div>\(v_1\) and \(v_2\) are {{c1::orthogonal:: property}}. <i>Proof Included</i></div>
Extra
<div><b>Proof</b> \(\lambda_1 v_1 ^\top v_2 = (Av_1)^\top v_2 = v_1^\top A ^\top v_2 = v_1^\top (Av_2) = \lambda_2 v_1^\top v_2\) Thus \(v_1^\top v_2\) must be \(0\).</div>
A matrix has a complete set of real eigenvectors if all its eigenvalues are real and the geometric multiplicities are the same as the algebraic multiplicities of all it's eigenvalues.
A matrix has a complete set of real eigenvectors if all its eigenvalues are real and the geometric multiplicities are the same as the algebraic multiplicities of all it's eigenvalues.
Example \(I\) has eigenvalue \(1\) with geometric multiplicity \(n\) (\(\dim(N(I - 1 \cdot I)) = n\)) and algebraic multiplicity \(n\) (As the characteristic polynomial of \(I\), \(P(z) = (z - 1)(z - 1) \dots (z - 1)\) with that repeated \(n\) times).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A matrix has a <b>complete set of real eigenvectors</b> if {{c1::all its eigenvalues are real and the geometric multiplicities are the same as the algebraic multiplicities of all it's eigenvalues::in terms of multiplicities}}.
Extra
<div><strong>Example</strong> \(I\) has eigenvalue \(1\) with geometric multiplicity \(n\) (\(\dim(N(I - 1 \cdot I)) = n\)) and algebraic multiplicity \(n\) (As the characteristic polynomial of \(I\), \(P(z) = (z - 1)(z - 1) \dots (z - 1)\) with that repeated \(n\) times).</div>
Let \(Q\) be the \(m \times n\) matrix whose columns are an orthonormal basis of \(A\).
Then the least squares solution \(Qx = b\) is given by {{c1:: \(\hat{x} = Q^\top b\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(Q\) be the \(m \times n\) matrix whose columns are an orthonormal basis of \(A\).</div><div><br></div><div>Then the least squares solution \(Qx = b\) is given by {{c1:: \(\hat{x} = Q^\top b\)}}.</div>
For RREF on \(A, I\) we get \(R, M\) with the property that \(R = MA\) and \(M\) invertible.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For RREF on \(A, I\) we get \(R, M\) with the property that {{c1::\(R = MA\)::equation}} and {{c1::\(M\) invertible:: property of M}}.
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.
Give an example of a matrix with complex valued EWs:
Eigenvalues of the \(90^\circ\) degree counterclockwise rotation matrix \(A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\).
The solutions to \(0 = \det(A - \lambda I) = -\lambda \cdot -\lambda - 1 \cdot (-1) = \lambda^2 + 1\) which are \(\lambda_1 = i\) and \(\lambda_2 = -i\). The eigenvectors are given by \(v_1 = \begin{pmatrix} i \\ 1 \end{pmatrix}\) \(v_2 = \begin{pmatrix} -i \\ 1 \end{pmatrix}\).
This makes sense because the only vector staying on it's axis in a 2d rotation of a plane by \(90^\circ\) is the vector pointing straight up, out from the plane.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Give an example of a matrix with complex valued EWs:
Back
Eigenvalues of the \(90^\circ\) degree counterclockwise rotation matrix \(A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\).<br><br>The solutions to \(0 = \det(A - \lambda I) = -\lambda \cdot -\lambda - 1 \cdot (-1) = \lambda^2 + 1\) which are \(\lambda_1 = i\) and \(\lambda_2 = -i\). The eigenvectors are given by \(v_1 = \begin{pmatrix} i \\ 1 \end{pmatrix}\) \(v_2 = \begin{pmatrix} -i \\ 1 \end{pmatrix}\).<br><br>This makes sense because the only vector staying on it's axis in a 2d rotation of a plane by \(90^\circ\) is the vector pointing straight up, out from the plane.
What are the four Moore-Penrose conditions?<br><ol><li>{{c1::\(AA^\dagger A = A\)}}<br></li><li>{{c2::\(A^\dagger A A^\dagger = A^\dagger\)}}<br></li><li>{{c3::\((AA^\dagger )^\top = AA^\dagger \)}}</li><li>{{c4::\((A^\dagger A)^\top = A^\dagger A\)}}<br></li></ol>
We say that \(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices if {{c2::there exists an invertible matrix \(S\) such that \(B = S^{-1}AS\)}}.
We say that \(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices if {{c2::there exists an invertible matrix \(S\) such that \(B = S^{-1}AS\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We say that \(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are {{c1::similar matrices}} if {{c2::there exists an invertible matrix \(S\) such that \(B = S^{-1}AS\)}}.
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \text{Tr}(A) = {{c1:: \sum_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Quite surprising, since the determinant and trace are \(\in \mathbb{R}\) where the eigenvalues in general must not be? It holds because complex eigenvalues \(z_1, z_2\) always show up in pairs: \(z_1 = \overline{z_2}\). And because \(z_1 \cdot \overline{z_1} = a^2 + b^2\) and \(z_1 + \overline{z_1} = 2a\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \text{Tr}(A) = {{c1:: \sum_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Extra
Quite surprising, since the determinant and trace are \(\in \mathbb{R}\) where the eigenvalues in general must not be?<br>It holds because complex eigenvalues \(z_1, z_2\) always show up in pairs: \(z_1 = \overline{z_2}\). And because \(z_1 \cdot \overline{z_1} = a^2 + b^2\) and \(z_1 + \overline{z_1} = 2a\).
If we have \(A\) with eigenvalues \(0, 1, 2\) then \(I + A^2\) has eigenvalues?
We have \(\lambda^2\) eigenvalues of \(A^2\) by lemma script. Thus \(0, 1, 4\) are EWs. Then \(1 + \lambda^2\) are the eigenvalues of \(I + A^2\) thus \(1, 2, 5\) are the EWs.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
If we have \(A\) with eigenvalues \(0, 1, 2\) then \(I + A^2\) has eigenvalues?
Back
We have \(\lambda^2\) eigenvalues of \(A^2\) by lemma script. Thus \(0, 1, 4\) are EWs.<br>Then \(1 + \lambda^2\) are the eigenvalues of \(I + A^2\) thus \(1, 2, 5\) are the EWs.
Then the transpose \(A^T\) is also invertible and: \( (A^T)^{-1} = \) {{c1:: \((A^{-1})^T \)}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an \(m \times m\) invertible matrix.<br><br>Then the transpose \(A^T\) is also invertible and: \( (A^T)^{-1} = \) {{c1:: \((A^{-1})^T \)}}
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 exact same vector of coefficients.
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 exact same vector of coefficients.<div><br></div><div>Linear combinations are unique if all vectors are independent.</div>
How do we find a basis for the row space \(R(A) = C(A^\top)\)?
The first \(r\) columns of \(R^\top\) where \(R\) is the RREF of \(A\) form a basis of the row space (the non-zero rows). In particular \(\dim(\textbf{R}(A)) = r\)
This works because as noted before, multiplying by an invertible matrix \(M\) does not change the row-space of \(MA\) on the left.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we find a basis for the row space \(R(A) = C(A^\top)\)?
Back
The first \(r\) columns of \(R^\top\) where \(R\) is the RREF of \(A\) form a basis of the row space (the non-zero rows). In particular \(\dim(\textbf{R}(A)) = r\)<br><br><div>This works because as noted before, multiplying by an invertible matrix \(M\) does not change the row-space of \(MA\) on the left.</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>
A vector \(v \in \mathbb{R}^n \setminus \{0\}\) is an eigenvector associated with the eigenvalue \(\lambda\) if and only if \(v \in N(A - \lambda I)\).
A vector \(v \in \mathbb{R}^n \setminus \{0\}\) is an eigenvector associated with the eigenvalue \(\lambda\) if and only if \(v \in N(A - \lambda I)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A vector \(v \in \mathbb{R}^n \setminus \{0\}\) is {{c1::an eigenvector associated with the eigenvalue \(\lambda\)}} if and only if {{c2::\(v \in N(A - \lambda I)\)::subspace}}.
Vectors \(q_1, \dots, q_n \in \mathbb{R}^m\) are orthonormal if they are orthogonal and have norm \(1\).
In other words, for all \(i, j \in \{1, \dots, n\}\): \[ q_i^\top q_j = {{c1::\delta_{ij} }}\]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Vectors \(q_1, \dots, q_n \in \mathbb{R}^m\) are orthonormal if {{c1::they are orthogonal and have norm \(1\)}}. <br><br>In other words, for all \(i, j \in \{1, \dots, n\}\): \[ q_i^\top q_j = {{c1::\delta_{ij} }}\]
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\)}}.
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\), let {{c1:: \(S \in \mathbb{R}^{m \times r}\) and \(T \in \mathbb{R}^{r \times n}\)}} such that \(A = ST\). Then \[ A^\dagger = T^\dagger S^\dagger \]
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\), let {{c1:: \(S \in \mathbb{R}^{m \times r}\) and \(T \in \mathbb{R}^{r \times n}\)}} such that \(A = ST\). Then \[ A^\dagger = T^\dagger S^\dagger \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\), let {{c1:: \(S \in \mathbb{R}^{m \times r}\) and \(T \in \mathbb{R}^{r \times n}\)}} such that \(A = ST\). Then \[ A^\dagger ={{c2:: T^\dagger S^\dagger }}\]
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><i>This essentially means that: the length of the projecton of v onto w is smaller than the both of their lengths multiplied.<br>This explains the equality part: if they are already aligned, their projection doesn't lose any length...</i>
We can view the matrix-vector product \(Ax\) in two ways:
Row view: The result is a vector where each entry is the scalar product of row \(i\) of \(A\) with \(x\): \((Ax)_{i} = A_i^\top x\).
Column view: The resulting vector is a linear combination of the columns of \(A\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
We can view the matrix-vector product \(Ax\) in two ways:
Back
<ul><li>Row view: The result is a vector where each entry is the scalar product of row \(i\) of \(A\) with \(x\): \((Ax)_{i} = A_i^\top x\).</li><li>Column view: The resulting vector is a linear combination of the columns of \(A\).</li></ul>
When solving Least Squares (asking for a minimiser of \(||Ax - b||^2\)) we are asking \(Ax\) to be the projection of \(b\) onto \(C(A)\).
Least Squares is basically projection without multiplying by \(A\) at the end.
It's also basically the Pseudoinverse.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
When solving Least Squares (asking for a minimiser of \(||Ax - b||^2\)) we are asking {{c1::\(Ax\) to be the projection of \(b\) onto \(C(A)\)}}.
Extra
Least Squares is basically projection without multiplying by \(A\) at the end.<br><br>It's also basically the Pseudoinverse.
By multilinearity, \(\det(\alpha A) = \) \(\alpha^n \det(A)\)Intuition included
the scaling affects all rows equally, thus the unit cube is scaled in all dimensions (power of n).
In other words, we have to extract \(\alpha\) from each row using multilinearity.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
By multilinearity, \(\det(\alpha A) = \) {{c1:: \(\alpha^n \det(A)\)}} <i>Intuition included</i>
Extra
the scaling affects all rows equally, thus the unit cube is scaled in all dimensions (power of n).<br><br>In other words, we have to extract \(\alpha\) from each row using <b>multilinearity</b>.
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.
For \(A\) and \(MA\) (\(M\) invertible) they have:
the independent columns at the same indices
the same rank
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A\) and \(MA\) (\(M\) invertible) they have:<br><ul><li>the independent columns {{c1:: at the same indices}}</li><li>the same {{c1::rank}}</li></ul>
Theorem: A matrix \(A \in \mathbb{R}^{m \times n}\) of rank \(r\) can be written as the matrix-matrix product \[ A = C R’ \] where \(C\) is the \(m \times r\) submatrix containing the independent columns and the unique \(R’ \in \mathbb{R}^{r \times n}\) matrix.
Theorem: A matrix \(A \in \mathbb{R}^{m \times n}\) of rank \(r\) can be written as the matrix-matrix product \[ A = C R’ \] where \(C\) is the \(m \times r\) submatrix containing the independent columns and the unique \(R’ \in \mathbb{R}^{r \times n}\) matrix.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div><b>Theorem</b>: A matrix \(A \in \mathbb{R}^{m \times n}\) of rank \(r\) can be written as the matrix-matrix product \[ A = C R’ \] where \(C\) is the \(m \times r\) submatrix containing {{c1:: the independent columns}} and the <b>unique</b> \(R’ \in \mathbb{R}^{r \times n}\) matrix.</div>
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}\)
\(\lambda \in \mathbb{R}\) is a real eigenvalue of \(A\) if and only if \(\det(A - \lambda I) = 0\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A \in \mathbb{R}^{n \times n}\).</div><div>\(\lambda \in \mathbb{R}\) is a {{c1::real eigenvalue}} of \(A\) if and only if {{c2::\(\det(A - \lambda I) = 0\)}}. </div>
For a full row rank matrix \(A\), the unique solution to\[{{c1:: \min_{x \in \mathbb{R}^n} ||x||^2 \text{ s.t. } Ax = b}}\] is given by the vector \(\hat{x} = A^\dagger b\). This \(\hat{x}\) is in \(C(A^\top)\). Proof Included
For a full row rank matrix \(A\), the unique solution to\[{{c1:: \min_{x \in \mathbb{R}^n} ||x||^2 \text{ s.t. } Ax = b}}\] is given by the vector \(\hat{x} = A^\dagger b\). This \(\hat{x}\) is in \(C(A^\top)\). Proof Included
Proof
By Lemma 6.4.5 we only need to show that \(\hat{x} = A^\dagger b\) satisfies \(A \hat{x} = b\) and that \(\hat{x} \in C(A^\top)\).
\(A\hat{x} = AA^\dagger b = AA^\top (AA^\top)^{-1}b = b\)
\(\hat{x} = A^\dagger b = A^\top ((AA^\top)^{-1} b) = A^\top y\) for some \(y\) thus \(x \in C(A^\top)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>For a <b>full row rank</b> matrix \(A\), the unique solution to\[{{c1:: \min_{x \in \mathbb{R}^n} ||x||^2 \text{ s.t. } Ax = b}}\] is given by the vector \(\hat{x} = A^\dagger b\). This \(\hat{x}\) is in {{c1:: \(C(A^\top)\)}}. <i>Proof Included</i></div>
Extra
<div><strong>Proof</strong> </div><div>By Lemma 6.4.5 we only need to show that \(\hat{x} = A^\dagger b\) satisfies \(A \hat{x} = b\) and that \(\hat{x} \in C(A^\top)\).</div><div><ul><li>\(A\hat{x} = AA^\dagger b = AA^\top (AA^\top)^{-1}b = b\) </li><li>\(\hat{x} = A^\dagger b = A^\top ((AA^\top)^{-1} b) = A^\top y\) for some \(y\) thus \(x \in C(A^\top)\).</li></ul></div>
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}}.
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent columns?
Because \(rank(A) = r = n\) and thus \(m \geq n\)
\(R(A)\) spans \(\mathbb{R}^n\)(rows span the space)
\(C(A) \subseteq\) \(\mathbb{R}^m\) (as \(A\) is not necessarily square)
We therefore first project \(b\) into \(C(A)\) and then invert, which is Least Squares.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent columns?
Back
Because \(rank(A) = r = n\) and thus \(m \geq n\)<br><ul><li>\(R(A)\) spans \(\mathbb{R}^n\)(rows span the space)</li><li>\(C(A) \subseteq\) \(\mathbb{R}^m\) (as \(A\) is not necessarily square)</li></ul><div>We therefore first project \(b\) into \(C(A)\) and then invert, which is <b>Least Squares.</b></div><br><div> <img src="paste-455009459e5a5c70fa5574bdbcedcfb838341523.jpg"></div>
Then \(\dim(V)\) the dimension of \(V\) is the size of an arbitrary basis \(B\) of \(V\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a finitely generated vector space.<br><br>Then {{c2::\(\dim(V)\) the dimension of \(V\)}} is {{c1::the size of an arbitrary basis \(B\) of \(V\)::given by which basis property?}}.
Let \(V\) and \(W\) be orthogonal subspaces of \(\mathbb{R}^n\). Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
The set of vectors \({v_1, \dots, v_k, w_1, \dots, w_l}\) is linearly independent.
Let \(V\) and \(W\) be orthogonal subspaces of \(\mathbb{R}^n\). Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
The set of vectors \({v_1, \dots, v_k, w_1, \dots, w_l}\) is linearly independent.
As all vectors are pairwise linearly independent, their union is also linearly independent. Therefore the union of two bases is still a basis of the sum of their subspaces:
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) and \(W\) be orthogonal subspaces of \(\mathbb{R}^n\). Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).</div><div><br></div><div>The set of vectors \({v_1, \dots, v_k, w_1, \dots, w_l}\) is {{c1::linearly independent}}.</div>
Extra
As all vectors are pairwise linearly independent, their <i>union is also linearly independent</i>. Therefore the <i>union of two bases is still a basis</i> of the sum of their subspaces:
Let \(S^\perp\) be the orthogonal complement of \(S\) and \(P\) the projection matrix onto \(S\).
Then \(I - P\) is the projection matrix that maps {{c2::\(b \in \mathbb{R}^m\) to \(\text{proj}_{S^\perp}(b)\)}}.
Proof Included
Since \(b = e + \text{proj}_S(b) = e + Pb\) with \(e \in S^\perp\) Thus \[ (I - P)b = b - Pb = e = \text{proj}_{S^\perp}(b) \]This is true, since it holds that indeed \(I - P\) is also idempotent: \((I - P)^2 = I - 2P + P^2 = I -P - P + P= I - P\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(S^\perp\) be the orthogonal complement of \(S\) and \(P\) the projection matrix onto \(S\).</div><div><br></div><div>Then {{c1::\(I - P\)}} is the projection matrix that maps {{c2::\(b \in \mathbb{R}^m\) to \(\text{proj}_{S^\perp}(b)\)}}.<br><br><i>Proof Included</i><br></div>
Extra
Since \(b = e + \text{proj}_S(b) = e + Pb\) with \(e \in S^\perp\) Thus \[ (I - P)b = b - Pb = e = \text{proj}_{S^\perp}(b) \]This is true, since it holds that indeed \(I - P\) is also idempotent: \((I - P)^2 = I - 2P + P^2 = I -P - P + P= I - P\)
Let \(A \in \mathbb{R}^{3 \times 3}\) be symmetric with eigenvalues \(−2, 1, 3\). What are the singular values of \(A\)?
The singular values are the square roots of the eigenvalues of \(A^\top A\)(or \(AA^\top\)).
As \(A^\top = A \), we have the eigenvalues \(\lambda^2\) for \(A^\top A = A^2\). Thus we have \(\sigma_i = \sqrt{\lambda_i^2}\) which is \(2, 1, 3\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Let \(A \in \mathbb{R}^{3 \times 3}\) be symmetric with eigenvalues \(−2, 1, 3\).<br>What are the singular values of \(A\)?
Back
The singular values are the <b>square roots</b> of the eigenvalues of \(A^\top A\)(or \(AA^\top\)).<br><br>As \(A^\top = A \), we have the eigenvalues \(\lambda^2\) for \(A^\top A = A^2\). Thus we have \(\sigma_i = \sqrt{\lambda_i^2}\) which is \(2, 1, 3\).
Given a permutation matrix \(P \in \mathbb{R}^{n \times n}\) corresponding to a permutation \(\sigma\), then \(\det(P) = {{c1::\text{sgn}(\sigma)}}\)
(this is as \(P\) is also an orthogonal matrix, see 3.). We sometimes write \(\text{sgn}(P)\).
For the permutation matrix, each row contains only one entry: a \(1\). Thus the only permutation \(\sigma\) in the product that doesn't have a \(0\) factor is the permutation corresponding to the matrix \(P\) itself. The product is \(1 \cdot 1 \dots \cdot 1\) thus we get \(\text{sgn}(\sigma) = \text{sgn}(P)\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given a permutation matrix \(P \in \mathbb{R}^{n \times n}\) corresponding to a permutation \(\sigma\), then \(\det(P) = {{c1::\text{sgn}(\sigma)}}\)
Extra
(this is as \(P\) is also an orthogonal matrix, see 3.). We sometimes write \(\text{sgn}(P)\).<br><br>For the permutation matrix, each row contains only one entry: a \(1\). Thus the only permutation \(\sigma\) in the product that doesn't have a \(0\) factor is the permutation corresponding to the matrix \(P\) itself. The product is \(1 \cdot 1 \dots \cdot 1\) thus we get \(\text{sgn}(\sigma) = \text{sgn}(P)\).
Assume \(A \in \mathbb{R}^{m \times n}\) has linearly independent rows.
Since the rows are linearly independent, the only solution to \(z^\top A = 0\) is \(z = 0\). Hence \(z^\top b = 0 \neq 1\).
Thus \(P\) always contains a solution.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Applications of the certificate of no solutions:<br><br>Assume \(A \in \mathbb{R}^{m \times n}\) has <b>linearly independent rows</b>.<br><br>Since {{c1::the rows are linearly independent}}, the only solution to \(z^\top A = 0\) is {{c2::\(z = 0\)}}. Hence {{c2::\(z^\top b = 0 \neq 1\)}}.<br><br>Thus {{c3::\(P\) always contains a solution}}.
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\).
Give an example of the <b>compact form</b> of the SVD for \(A \in \mathbb{R}^{4 \times 5}\) with \(\text{rank}(A) = 3\): (name the dimensions)
Back
\[A = U_3 \Sigma_3 V_3^T = \begin{bmatrix} | & | & | \\ \mathbf{u}_1 & \mathbf{u}_2 & \mathbf{u}_3 \\ | & | & | \end{bmatrix} \begin{bmatrix} \sigma_1 & 0 & 0 \\ 0 & \sigma_2 & 0 \\ 0 & 0 & \sigma_3 \end{bmatrix} \begin{bmatrix} - & \mathbf{v}_1^T & - \\ - & \mathbf{v}_2^T & - \\ - & \mathbf{v}_3^T & - \end{bmatrix}\]<br>where \(U_3\) is \(4 \times 3\), \(\Sigma_3\) is \(3 \times 3\), and \(V_3^T\) is \(3 \times 5\).
Pseudoinverse from the SVD: \(A = U \Sigma V^\top\)
\(A^\dagger = V \Sigma^\dagger U^\top\)where \(\Sigma^\dagger\) is obtained from \(\Sigma\) by taking the reciprocal (\(\frac{1}{\sigma_i}\)) of each non-zero singular value, leaving the zeros in place, and transposing the matrix.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Pseudoinverse from the SVD: \(A = U \Sigma V^\top\)
Back
\(A^\dagger = V \Sigma^\dagger U^\top\)where \(\Sigma^\dagger\) is obtained from \(\Sigma\) by taking the reciprocal (\(\frac{1}{\sigma_i}\)) of each non-zero singular value, leaving the zeros in place, and transposing the matrix.
Intuition on where the normal equations \(A^\top A\hat{x} = A^\top b\) come from:
In the previous case, we had \(\mathbf{e} = (\mathbf{b} - proj_S(\mathbf{b})) \ \bot \ \mathbf{a}\). Here, the same orthogonality condition holds for all columns of \(A\) (that we are projecting on).
This is the same as stating \(A^\top (\mathbf{b} - proj_S(\mathbf{b})) = 0\) which by substituting \(proj_S(b) = \mathbf{p} = A \mathbf{\hat{x}}\) gives \(A^\top \mathbf{b} - A^\top A\mathbf{\hat{x}} = 0\) which we can restate as \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\), which is the normal equation.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Intuition on where the normal equations \(A^\top A\hat{x} = A^\top b\) come from:
Back
<div>In the previous case, we had \(\mathbf{e} = (\mathbf{b} - proj_S(\mathbf{b})) \ \bot \ \mathbf{a}\). Here, the same orthogonality condition holds for all columns of \(A\) (that we are projecting on).</div><div><br></div><div>This is the same as stating \(A^\top (\mathbf{b} - proj_S(\mathbf{b})) = 0\) which by substituting \(proj_S(b) = \mathbf{p} = A \mathbf{\hat{x}}\) gives \(A^\top \mathbf{b} - A^\top A\mathbf{\hat{x}} = 0\) which we can restate as \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\), which is the normal equation.</div>
For all \(x\) and an orthogonal matrix \(Q\) we have \(||Qx|| = ||x||\) Proof included
\(||Qx||^2 = (Qx)^\top(Qx) = x^\top x = ||x||^2\) and note that \(||Qx|| \geq 0\) and \(||x|| \geq 0\) thus it suffices to show that the squares are equal.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For all \(x\) and an orthogonal matrix \(Q\) we have \(||Qx|| = {{c1::||x||}}\) <i>Proof included</i>
Extra
\(||Qx||^2 = (Qx)^\top(Qx) = x^\top x = ||x||^2\) and note that \(||Qx|| \geq 0\) and \(||x|| \geq 0\) thus it suffices to show that the squares are equal.
The determinant preserves “multilinearity”. This means that changing only a single row will preserve the rest of the determinant (it’s linear for each row).
The determinant preserves “multilinearity”. This means that changing only a single row will preserve the rest of the determinant (it’s linear for each row).
\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} \]
\[ \begin{vmatrix} a + a’ & b + b’ \\ c & d \end{vmatrix} = \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a’ & b’ \\ c & d \end{vmatrix} \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>The determinant preserves “multilinearity”. This means that {{c1::changing only a single row will preserve the rest of the determinant (it’s <em>linear for each row)}}.</em></div>
Extra
<div>\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} \]</div><div>\[ \begin{vmatrix} a + a’ & b + b’ \\ c & d \end{vmatrix} = \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a’ & b’ \\ c & d \end{vmatrix} \]</div>
What does Gram-Schmidt actually do? Why do we substract \(\sum^{k - 1}_{i = 1} (a_k^\top q_i) q_i\)?
For each new vector, Gram-Schmidt projects it onto our current orthogonal basis.
We then substract the components that overlap for each of those basis vectors, to get a \(q_i'\) that is linearly independent. We then normalise it and add it to the basis.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
What does Gram-Schmidt actually do? Why do we substract \(\sum^{k - 1}_{i = 1} (a_k^\top q_i) q_i\)?
Back
For each new vector, Gram-Schmidt projects it onto our current orthogonal basis.<br><br>We then substract the components that overlap for each of those basis vectors, to get a \(q_i'\) that is linearly independent. We then normalise it and add it to the basis.<br><br><img src="paste-b6b55f36e78516fa3cd2e3dcf1fc622ee3a4fd8f.jpg">
For \(A\) a matrix and \(M\) an invertible matrix:
\(\textbf{N}(A) = \){{c1::\(\textbf{N}(MA)\) (nullspace is the same)}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>For \(A\) a matrix and \(M\) an invertible matrix:</div>\(\textbf{N}(A) = \){{c1::\(\textbf{N}(MA)\) (nullspace is the same)}}<blockquote><ol>
</ol></blockquote>
Let \(V, W\) be two vector spaces. A function \(T: V \rightarrow W\) is called a linear transformation between vector spaces if the following linearity axiom holds for all \(x_1, x_2 \in V\) and all \(\lambda_1, \lambda_2 \in \mathbb{R}\): \[ T(\lambda_1 x_1 + \lambda_2 x_2) = \lambda_1 T(x_1) + \lambda_2 T(x_2) \]
Let \(V, W\) be two vector spaces. A function \(T: V \rightarrow W\) is called a linear transformation between vector spaces if the following linearity axiom holds for all \(x_1, x_2 \in V\) and all \(\lambda_1, \lambda_2 \in \mathbb{R}\): \[ T(\lambda_1 x_1 + \lambda_2 x_2) = \lambda_1 T(x_1) + \lambda_2 T(x_2) \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(V, W\) be two vector spaces. A function \(T: V \rightarrow W\) is called a <i>linear transformation between vector spaces</i> if the following {{c1::linearity}} axiom holds for all \(x_1, x_2 \in V\) and all \(\lambda_1, \lambda_2 \in \mathbb{R}\): \[ {{c1:: T(\lambda_1 x_1 + \lambda_2 x_2) = \lambda_1 T(x_1) + \lambda_2 T(x_2) }}\]
Let \(A\) be an \(m \times n\) matrix and \(M\) an invertible \(m \times m\) matrix.
Then the two systems \(Ax = b\) and \(MAx = Mb\) have the same solutions \(x\).
This is why Gauss-Jordan Elimination works.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an \(m \times n\) matrix and \(M\) an invertible \(m \times m\) matrix.<br><br>Then the two systems \(Ax = b\) and \(MAx = Mb\) have the {{c1::same solutions \(x\)}}.
For \(A\) a matrix and \(M\) an invertible matrix:
\(A\) has linearly independent columns if and only if \(MA\) has linearly independent colums.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>For \(A\) a matrix and \(M\) an invertible matrix:</div><div><br></div>\(A\) has {{c1::linearly independent columns}} if and only if {{c1::\(MA\) has linearly independent colums}}.
Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
\(V\) and \(W\) are orthogonal if and only if {{c1::\(v_i\) and \(w_j\) are orthogonal for all \(i \in \{1, \dots, k\}\) and \(j \in \{1, \dots, l\}\)}}.
Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
\(V\) and \(W\) are orthogonal if and only if {{c1::\(v_i\) and \(w_j\) are orthogonal for all \(i \in \{1, \dots, k\}\) and \(j \in \{1, \dots, l\}\)}}.
Subspaces are orthogonal if their basis-vectors are orthogonal.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).<br><br>\(V\) and \(W\) are orthogonal <i>if and only if</i> {{c1::\(v_i\) and \(w_j\) are orthogonal for all \(i \in \{1, \dots, k\}\) and \(j \in \{1, \dots, l\}\)}}.
Extra
Subspaces are orthogonal if their basis-vectors are orthogonal.
For \(A\) written in CR-Decomposition \(A = CR'\), \(R'\) is unique.
\(R'\) is unique because the \(C\) is linearly independent and there's only one way to write a vector (the columns of \(A\)) as the linear combination of independent vectors.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A\) written in CR-Decomposition \(A = CR'\), \(R'\) is {{c1:: unique::property? and why proof?}}.
Extra
\(R'\) is unique because the \(C\) is linearly independent and there's only one way to write a vector (the columns of \(A\)) as the linear combination of independent vectors.
A diagonal matrix \(D\) has eigenvalues which are the diagonals and a full set of eigenvectors \(e_1, \dots, e_n\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A diagonal matrix \(D\) has eigenvalues {{c1::which are the diagonals::where are they?}} and {{c1::a full set of eigenvectors \(e_1, \dots, e_n\)::EVs?}}.
We can write \(A\) as the sum of rank \(1\) matrices: \[A = {{c2::\sum_{k = 1}^n \lambda_i v_i v_i^\top}}\]where \(v_1, \dots, v_n\) are an orthonormal basis of eigenvectors (the \(V\) in diagonalisation) and \(\lambda_1, \dots, \lambda_n\) the associated eigenvectors.
We can write \(A\) as the sum of rank \(1\) matrices: \[A = {{c2::\sum_{k = 1}^n \lambda_i v_i v_i^\top}}\]where \(v_1, \dots, v_n\) are an orthonormal basis of eigenvectors (the \(V\) in diagonalisation) and \(\lambda_1, \dots, \lambda_n\) the associated eigenvectors.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
We can write \(A\) as the sum of {{c1::rank \(1\) matrices}}: \[A = {{c2::\sum_{k = 1}^n \lambda_i v_i v_i^\top}}\]where {{c2:: \(v_1, \dots, v_n\) are an orthonormal basis of eigenvectors (the \(V\) in diagonalisation) and \(\lambda_1, \dots, \lambda_n\) the associated eigenvectors}}.<br>
If \(m = n\) (\(A\) is square), the system \(Ax = b\) is called square. Typically solvable.
If \(m < n\) (A is a wide matrix), the system \(Ax = b\) is called underdetermined. These are typically solvable.
If \(m > n\) (A is a tall matrix) the system \(Ax = b\) is called overdetermined. Typically not solvable.
(Undetermined because there are more variables than equations.)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<ol><li>If \(m = n\) (\(A\) is square), the system \(Ax = b\) is called square. Typically solvable. </li><li>If \(m < n\) (A is a wide matrix), the system \(Ax = b\) is called {{c1::underdetermined}}. These are {{c1::typically solvable::solvability}}. </li><li>If \(m > n\) (A is a tall matrix) the system \(Ax = b\) is called {{c2::overdetermined}}. Typically {{c2::not solvable::solvability}}.</li></ol>
Extra
(Undetermined because there are more variables than equations.)
Given \(n\) vectors \(v_1, \dots, v_n \in \mathbb{R}^n\) we call their Gram matrix the {{c2::\(n \times n\) matrix of inner products \(G_{ij} = v_i^\top v_j\)}}.
Given \(n\) vectors \(v_1, \dots, v_n \in \mathbb{R}^n\) we call their Gram matrix the {{c2::\(n \times n\) matrix of inner products \(G_{ij} = v_i^\top v_j\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given \(n\) vectors \(v_1, \dots, v_n \in \mathbb{R}^n\) we call their {{c1::Gram matrix}} the {{c2::\(n \times n\) matrix of inner products \(G_{ij} = v_i^\top v_j\)}}.
If \(A\) is a matrix and \(P\) is a permutation that swaps two elements (i.e. \(\text{sgn}(P) = -1\)): \[\det(PA) = - \det(A) \]
\(PA\) corresponds to swapping two rows of \(A\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
If \(A\) is a matrix and \(P\) is a permutation that <i>swaps two elements</i> (i.e. \(\text{sgn}(P) = -1\)): \[\det(PA) = {{c1:: - \det(A) }}\]<br>
Extra
\(PA\) corresponds to swapping two rows of \(A\)
How do we find a basis for the nullspace of \(A\)?
Compute the RREF form \(R\) of \(A\) (\(MA\) has the same nullspace as \(A\): \(\textbf{N}(A) = \textbf{N}(MA)\))
Remove any zero rows (because \(0^\top x = 0\) regardless of \(x\))
Solve for \(Rx = 0\):
We seperate the matrix into the identity and the "rest". Note that for this we take columns 1 and 2 as they form the 2x2 identity.
Which becomes
We reduce this to a system of equations:
We choose two special solutions (independent) and then plug in the values into our equations to find the rest.
This gives us a basis of the nullspace as we get two linearly independent vectors in there and it has dimension 2. We call these particular solutions.
Final nullspace:
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we find a basis for the nullspace of \(A\)?
Back
<ol><li>Compute the RREF form \(R\) of \(A\) (\(MA\) has the same nullspace as \(A\): \(\textbf{N}(A) = \textbf{N}(MA)\))<br><img src="paste-c7b63bea7d24d14a38bb7424b8db516858fabcf0.jpg"></li><li>Remove any zero rows (because \(0^\top x = 0\) regardless of \(x\))</li><li>Solve for \(Rx = 0\):<br><img src="paste-202adab412a02f3505cdc07a23c10560126d62b6.jpg"><br></li><li>We seperate the matrix into the identity and the "rest". Note that for this we take columns 1 and 2 as they form the 2x2 identity.<br><img src="paste-d1c60625d9e82f7d7e03e5e589fa3aadb665dcc3.jpg"></li><li>Which becomes <br><img src="paste-d411074ad0d64bb267df9e809e480d6930a8d42f.jpg"></li><li>We reduce this to a system of equations:<br><img src="paste-d836e1ad674f83289a6c984addc347470f0dc213.jpg"><br><div>We choose two special solutions (independent) and then plug in the values into our equations to find the rest.
This gives us a basis of the nullspace as we get two linearly independent vectors in there and it has dimension 2. We call these <strong>particular solutions</strong>.</div></li></ol><div>Final nullspace:</div><div><img src="paste-d862ea45eee333d57256e4b8635e0a0b714ae57a.jpg"></div>
\(A\) has an EW \(0\) \(\Longleftrightarrow\)\(A\) is not invertible Proof Included
We know the EVs are in the \(N(A - \lambda I)\) because they solve the formula \(Av = \lambda v \implies Av - \lambda v \)\(= 0 \implies (A - \lambda I)v = 0\). Thus \(v\) is in the nullspace of \((A - \lambda I)\).
If \(A\) is not invertible, then it will have an EV of \(0\), which means that there is an EV solving \((A - 0 \cdot I)v = 0 \implies Av = 0\). Thus \(v \neq 0\) is in the nullspace of \(A\), i.e. the nullspace is not empty.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
{{c1::\(A\) has an EW \(0\)::EW}} \(\Longleftrightarrow\){{c2::\(A\) is not invertible}}<i> Proof Included</i>
Extra
<div>We know the EVs are in the \(N(A - \lambda I)\) because they solve the formula \(Av = \lambda v \implies Av - \lambda v \)\(= 0 \implies (A - \lambda I)v = 0\). Thus \(v\) is in the nullspace of \((A - \lambda I)\).</div><div><br></div><div>If \(A\) is not invertible, then it will have an EV of \(0\), which means that there is an EV solving \((A - 0 \cdot I)v = 0 \implies Av = 0\). Thus \(v \neq 0\) is in the nullspace of \(A\), i.e. the nullspace is not empty.</div>
The projection of a vector \(b \in \mathbb{R}^m\) onto a subspace \(S\) (of \(\mathbb{R}^m\)) is the point in \(S\) that is closest to \(b\). In other words \[ \text{proj}_S(b) = {{c1:: \text{argmin}_{p \in S} ||b - p|| }}\]
The projection of a vector \(b \in \mathbb{R}^m\) onto a subspace \(S\) (of \(\mathbb{R}^m\)) is the point in \(S\) that is closest to \(b\). In other words \[ \text{proj}_S(b) = {{c1:: \text{argmin}_{p \in S} ||b - p|| }}\]
Where \(b = p + e \implies b - p = e\), with \(e\) the error.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The projection of a vector \(b \in \mathbb{R}^m\) onto a subspace \(S\) (of \(\mathbb{R}^m\)) is the point in \(S\) {{c1::that is closest to \(b\)}}. In other words \[ \text{proj}_S(b) = {{c1:: \text{argmin}_{p \in S} ||b - p|| }}\]
Extra
Where \(b = p + e \implies b - p = e\), with \(e\) the error.
Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the non-zero eigenvalues of \(A^\top A\) are the same ones as of \(AA^\top\).
Both matrices are symmetric and PSD.
Proof Included
Proof \(G = AA^\top\) and \(G = A^\top A\) are PSD.
\(x^\top G x = x^\top (A^\top A ) x = (Ax)^\top (Ax) = ||Ax||^2 \geq 0\)
\(x^\top G x = x^\top AA^\top x = (A^\top x)^\top (A^\top x) = ||A^\top x||^2 \geq 0\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the non-zero eigenvalues of \(A^\top A\) are the same ones as of \(AA^\top\).</div><div><br></div><div>Both matrices are {{c3::<em>symmetric</em> and <i>PSD</i>}}.</div><div><i>Proof Included</i><br></div>
Extra
<div><b>Proof</b> \(G = AA^\top\) and \(G = A^\top A\) are PSD.</div><div><ul><li> \(x^\top G x = x^\top (A^\top A ) x = (Ax)^\top (Ax) = ||Ax||^2 \geq 0\) </li><li>\(x^\top G x = x^\top AA^\top x = (A^\top x)^\top (A^\top x) = ||A^\top x||^2 \geq 0\)</li></ul></div><div><br></div><div></div>
The projection of \(b \in \mathbb{R}^m\) on \(S = \{\lambda a \ | \ \lambda \in \mathbb{R} \} = C(a)\) is given by: \[ \text{proj}_S(b) = {{c1:: \frac{aa^\top}{a^\top a}b }}\]
The projection of \(b \in \mathbb{R}^m\) on \(S = \{\lambda a \ | \ \lambda \in \mathbb{R} \} = C(a)\) is given by: \[ \text{proj}_S(b) = {{c1:: \frac{aa^\top}{a^\top a}b }}\]
This minimiser is unique.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(a \in \mathbb{R}^m \ \backslash \ \{0\}\). </div><div><br></div><div>The projection of \(b \in \mathbb{R}^m\) on \(S = \{\lambda a \ | \ \lambda \in \mathbb{R} \} = C(a)\) is given by: \[ \text{proj}_S(b) = {{c1:: \frac{aa^\top}{a^\top a}b }}\]</div><div>This minimiser is unique.</div>
Let \(A \in \mathbb{R}^{m \times m}\). \(A\) is invertible if:
There is a \(m \times m\) matrix \(B\) such that \(BA = I\).
Exists only if \(A\) has linearly independent columns.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
<div>Let \(A \in \mathbb{R}^{m \times m}\). \(A\) is invertible if:</div>
Back
There is a \(m \times m\) matrix \(B\) such that \(BA = I\).<br><br><i>Exists only if </i>\(A\)<i> has linearly independent columns.</i>
The co-factors of \(A\) are \( C_{ij} = {{c1:: (-1)^{i + j} \det(\mathcal{A}_{ij}) }}\) where \(\mathcal{A}_{ij}\) is the \((n - 1)\times (n-1)\) matrix without row \(i\) and column \(j\).
The co-factors of \(A\) are \( C_{ij} = {{c1:: (-1)^{i + j} \det(\mathcal{A}_{ij}) }}\) where \(\mathcal{A}_{ij}\) is the \((n - 1)\times (n-1)\) matrix without row \(i\) and column \(j\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The c<b>o-factors</b> of \(A\) are \( C_{ij} = {{c1:: (-1)^{i + j} \det(\mathcal{A}_{ij}) }}\) where \(\mathcal{A}_{ij}\) is the \((n - 1)\times (n-1)\) matrix without row \(i\) and column \(j\).
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1::the parity of the number of elements that are out of order (inversions: \( i < j \text{ and } \sigma(i) > \sigma( j)\)) after applying the permutation::inversions}}.
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1::the parity of the number of elements that are out of order (inversions: \( i < j \text{ and } \sigma(i) > \sigma( j)\)) after applying the permutation::inversions}}.
\((1, 3, 2)\) has one inversion.
\(\text{sgn}(\sigma)=(−1)^k\) where \(k\) is the number of transpositions (swaps) needed to obtain \(σ\) from the identity.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1::the parity of the number of elements that are out of order (inversions: \( i < j \text{ and } \sigma(i) > \sigma( j)\)) after applying the permutation::inversions}}.
Extra
\((1, 3, 2)\) has one inversion.<br><br>\(\text{sgn}(\sigma)=(−1)^k\) where \(k\) is the number of transpositions (swaps) needed to obtain \(σ\) from the identity.
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive definite if and only if {{c2::\(x^\top Ax > 0\) for all \(x \in \mathbb{R}^n \setminus \{0\}\)}}.
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive definite if and only if {{c2::\(x^\top Ax > 0\) for all \(x \in \mathbb{R}^n \setminus \{0\}\)}}.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is {{c1::positive definite}} if and only if {{c2::\(x^\top Ax > 0\) for all \(x \in \mathbb{R}^n \setminus \{0\}\)}}.
The sign of a permutation is {{c1::multiplicative::property}}: <br><br>\(\text{sgn}(\sigma \circ \lambda) = {{c1:: \text{sgn}(\sigma) \cdot \text{sgn}(\lambda)}}\).
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}||\)}}
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1 \neq \lambda_2 \in \mathbb{R}\) two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\).
Then \(v_1\) and \(v_2\) are orthogonal. Proof Included
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1 \neq \lambda_2 \in \mathbb{R}\) two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\).
Then \(v_1\) and \(v_2\) are orthogonal. Proof Included
<div>Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1 {{c2::\neq}} \lambda_2 \in \mathbb{R}\) two {{c2::distinct}} eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\).</div><div>Then \(v_1\) and \(v_2\) {{c1::are orthogonal}}. <i>Proof Included</i></div>
Let \(V\) be a finitely generated vector space, \(F \subseteq V\) a finite set of linearly independent vectors (note that \(F\) does not need to span \(V\)) and \(G \subseteq V\) a finite set of vectors with \(\textbf{Span}(G) = V\) (but they don't all need to be independent). Then the following two statements hold:
\(|F| \leq |G|\)
{{c2::There exists a subset \(E \subseteq G\) of size \(|G| - |F|\) such that \(\textbf{Span}(F \cup E) = V\).}}
Let \(V\) be a finitely generated vector space, \(F \subseteq V\) a finite set of linearly independent vectors (note that \(F\) does not need to span \(V\)) and \(G \subseteq V\) a finite set of vectors with \(\textbf{Span}(G) = V\) (but they don't all need to be independent). Then the following two statements hold:
\(|F| \leq |G|\)
{{c2::There exists a subset \(E \subseteq G\) of size \(|G| - |F|\) such that \(\textbf{Span}(F \cup E) = V\).}}
We can use the lemma to argue that there can't be more than \(n\) independent vectors in a space of dimension \(n\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) be a finitely generated vector space, \(F \subseteq V\) a finite set of linearly independent vectors (note that \(F\) does not need to span \(V\)) and \(G \subseteq V\) a finite set of vectors with \(\textbf{Span}(G) = V\) (but they don't all need to be independent). Then the following two statements hold:</div><div><ol><li>{{c1::\(|F| \leq |G|\)}}</li><li>{{c2::There exists a subset \(E \subseteq G\) of size \(|G| - |F|\) such that \(\textbf{Span}(F \cup E) = V\).}}</li></ol></div><blockquote><ol>
</ol></blockquote>
Extra
We can use the lemma to argue that there can't be more than \(n\) independent vectors in a space of dimension \(n\).
How to recover a matrix \(A\) from it's eigenvectors and eigenvalues (complete set)?
\(V\) the matrix with the eigenvectors of \(A\), orthogonal. Then we know \(AV = VD\) (\(Av_i = \lambda_i v_i\) in matrix form), with \(D = \Lambda\) the matrix with the eigenvalues on the diagonal.
Thus \(AVV^\top = VDV^\top \implies A = VDV^\top\) .
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How to recover a matrix \(A\) from it's eigenvectors and eigenvalues (complete set)?
Back
\(V\) the matrix with the eigenvectors of \(A\), orthogonal. Then we know \(AV = VD\) (\(Av_i = \lambda_i v_i\) in matrix form), with \(D = \Lambda\) the matrix with the eigenvalues on the diagonal.<br><br>Thus \(AVV^\top = VDV^\top \implies A = VDV^\top\) .
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), we define the pseudo-inverse \(A^\dagger \in \mathbb{R}^{n \times m}\) as:\[ A^\dagger = {{c1::A^\top (A A^\top)^{-1} }}\]
For an \(A\) with full column-rank, we basically define, \(A^\dagger\) as the transpose of the pseudoinverse of the transpose:
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), we define the <b>pseudo-inverse</b> \(A^\dagger \in \mathbb{R}^{n \times m}\) as:\[ A^\dagger = {{c1::A^\top (A A^\top)^{-1} }}\]
Extra
For an \(A\) with full column-rank, we basically define, \(A^\dagger\) as the transpose of the pseudoinverse of the transpose:<br><img src="paste-ea3dc98b302c74b79fb2bafc8b144f36da289e16.jpg"><br><br>
For a projection to exist using our formula \(P = A (A^\top A)^{-1} A^\top\) we need \(A\) to have independent columns, i.e. they form a basis for \(C(A)\).
For a projection to exist using our formula \(P = A (A^\top A)^{-1} A^\top\) we need \(A\) to have independent columns, i.e. they form a basis for \(C(A)\).
Otherwise the projection is not unique.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For a projection to exist using our formula \(P = A (A^\top A)^{-1} A^\top\) we need {{c1:: \(A\) to have independent columns, i.e. they form a basis for \(C(A)\)}}.
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.
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\) and CR decomposition \(A = CR\), we define the pseudoinverse \(A^\dagger\) as: \[ A^\dagger = R^\dagger C^\dagger \]
We can rewrite this as:
\(\begin{aligned}
A^\dagger &= R^\top (RR^\top)^{-1} (C^\top C)^{-1} C^\top \\
&= R^\top (C^\top C R R^\top)^{-1} C^\top \\
&= R^\top (C^\top A R^\top)^{-1} C^\top
\end{aligned}\)
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\) and CR decomposition \(A = CR\), we define the pseudoinverse \(A^\dagger\) as: \[ A^\dagger = {{c1::R^\dagger C^\dagger }}\]
Extra
We can rewrite this as:<br><br>\(\begin{aligned}
A^\dagger &= R^\top (RR^\top)^{-1} (C^\top C)^{-1} C^\top \\
&= R^\top (C^\top C R R^\top)^{-1} C^\top \\
&= R^\top (C^\top A R^\top)^{-1} C^\top
\end{aligned}\)
The {{c2::rank of a matrix \(\textbf{rank}(A), A \in \mathbb{R}^{m \times n}\) is a number between 0 and n}} which counts the number of independent columns.
The {{c2::rank of a matrix \(\textbf{rank}(A), A \in \mathbb{R}^{m \times n}\) is a number between 0 and n}} which counts the number of independent columns.
A column is independent if it is not the linear combination of the previous ones (or the next ones, if you do it the other way round).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c2::rank of a matrix \(\textbf{rank}(A), A \in \mathbb{R}^{m \times n}\) is a number between 0 and n}} which {{c1::counts the number of independent columns}}.
Extra
<div>A column is independent if it is not the linear combination of the <b>previous ones</b> (or the <b>next ones</b>, if you do it the other way round).</div>
The triangle inequality \(||v|| + ||w|| \geq ||v+w||\) holds exactly if \(w = \lambda v\) for some \(\lambda\geq0\) (i.e., they point in the same direction).
The triangle inequality \(||v|| + ||w|| \geq ||v+w||\) holds exactly if \(w = \lambda v\) for some \(\lambda\geq0\) (i.e., they point in the same direction).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The triangle inequality \(||v|| + ||w|| \geq ||v+w||\) holds exactly if {{c1::\(w = \lambda v\) for some \(\lambda\geq0\) (i.e., they point in the same direction)}}.
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>
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is the parity of the number of row swaps necessary to get back to the identity .
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1:: the parity of the number of row swaps necessary to get back to the identity ::swaps}}.
No, there are typically many bases for a vector space.
Every set \(B = \{v_1, v_2, \dots, v_m\} \subseteq \mathbb{R}^m\) of linearly independent vectors is a basis of \(\mathbb{R}^m\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
Is a basis for a vector space unique?
Back
No, there are typically many bases for a vector space.<br><br>Every set \(B = \{v_1, v_2, \dots, v_m\} \subseteq \mathbb{R}^m\) of linearly independent vectors is a basis of \(\mathbb{R}^m\).
Pseudoinverse of \(A = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 2 & 0 \end{bmatrix}\)?<br><br>Hint: It's already in SVD-form.
Back
<div>Already in “SVD form” with \(U = I_2\), \(V = I_3\), and \(\Sigma = \begin{pmatrix} 3 & 0 & 0 \\ 0 & 2 & 0 \end{pmatrix}\). </div><div>The pseudoinverse is: \[A^\dagger = \begin{pmatrix} \frac{1}{3} & 0 \\ 0 & \frac{1}{2} \\ 0 & 0 \end{pmatrix}\] Notice:</div><div><ul><li>Shape flipped: \(A\) is \(2\times3\), so \(A^\dagger\) is \(3\times2\)</li><li>Nonzero values inverted: \(3 \to \frac{1}{3}\), \(2 \to \frac{1}{2}\) </li><li>Zeros stay zero</li></ul></div>
\(\Sigma \in \mathbb{R}^{m \times n}\) is {{c1::a diagonal matrix (in the sense that \(\Sigma_{ij} = 0\) when \(i \neq j\) and the diagonal values are non-negative and ordered in descending order)}}.
\(U^\top U = I\) and \(V^\top V = I\) (\(U, V\) are orthogonal).
The columns \(u_1, \dots, u_m\) of \(U\) are called the left-singular vectors of \(A\) and are orthonormal.
The columns \(v_1, \dots, v_n\) of \(V\) are called the right-singular vectors of \(A\) and are orthonormal.
\(\Sigma \in \mathbb{R}^{m \times n}\) is {{c1::a diagonal matrix (in the sense that \(\Sigma_{ij} = 0\) when \(i \neq j\) and the diagonal values are non-negative and ordered in descending order)}}.
\(U^\top U = I\) and \(V^\top V = I\) (\(U, V\) are orthogonal).
The columns \(u_1, \dots, u_m\) of \(U\) are called the left-singular vectors of \(A\) and are orthonormal.
The columns \(v_1, \dots, v_n\) of \(V\) are called the right-singular vectors of \(A\) and are orthonormal.
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
In the SVD:<br><ol><li>\(\Sigma \in \mathbb{R}^{m \times n}\) is {{c1::a diagonal matrix (in the sense that \(\Sigma_{ij} = 0\) when \(i \neq j\) and the diagonal values are non-negative and ordered in descending order)}}.</li><li>{{c2::\(U^\top U = I\) and \(V^\top V = I\) (\(U, V\) are orthogonal)::Property of V and U}}.</li><li>The columns \(u_1, \dots, u_m\) of \(U\) are called {{c3::the left-singular vectors of \(A\) and are orthonormal}}.</li><li>The columns \(v_1, \dots, v_n\) of \(V\) are called {{c3::the right-singular vectors of \(A\) and are orthonormal}}.</li></ol>
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}\)}}
Given a matrix \(A \in \mathbb{R}^{n \times n}\) and an eigenvalue \(\lambda\) of \(A\) we call the dimension \(\dim(N(A - \lambda I))\) the geometric multiplicity of \(\lambda\).
Given a matrix \(A \in \mathbb{R}^{n \times n}\) and an eigenvalue \(\lambda\) of \(A\) we call the dimension \(\dim(N(A - \lambda I))\) the geometric multiplicity of \(\lambda\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Given a matrix \(A \in \mathbb{R}^{n \times n}\) and an eigenvalue \(\lambda\) of \(A\) we call {{c2::the dimension \(\dim(N(A - \lambda I))\)}} the {{c1::geometric multiplicity}} of \(\lambda\).
Let \(P\) be the projection matrix onto the subspace \(U \subset \mathbb{R}^n\). Then \(P\) has two eigenvalues, \(0\) and \(1\).
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
Let \(P\) be the <i>projection matrix</i> onto the subspace \(U \subset \mathbb{R}^n\). Then \(P\) has {{c1::two eigenvalues, \(0\) and \(1\)::EW, EVs, and a complete set of real eigenvectors}}.
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\) }}.
How do we find the matrix \(A\) associated with a linear transformation \(T_A\)?
For \(e_1, e_2, \dots, e_n\) we calculate \(T_A(e_k)\) to find the \(k\)-th column of \(A\): \[ A = \begin{bmatrix} | & | & \text{} & | \\ T(e_1) & T(e_2) & \dots & T(e_n) \\ | & | & \text{ } & | \end{bmatrix} \]
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Front
How do we find the matrix \(A\) associated with a linear transformation \(T_A\)?
Back
For \(e_1, e_2, \dots, e_n\) we calculate \(T_A(e_k)\) to find the \(k\)-th column of \(A\): \[ A = \begin{bmatrix} | & | & \text{} & | \\ T(e_1) & T(e_2) & \dots & T(e_n) \\ | & | & \text{ } & | \end{bmatrix} \]<br>
The independent columns of \(A\), {{c1::span the column space \(\textbf{C}(A)\) of \(A\)}}.
Proven by induction, adding elements that are a linear combination of other ones doesn't change span, thus we can iteratively remove the dependent columns.
Lemma 2.11
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
The {{c2::independent}} columns of \(A\), {{c1::span the column space \(\textbf{C}(A)\) of \(A\)}}.
Extra
Proven by induction, adding elements that are a linear combination of other ones doesn't change span, thus we can iteratively remove the dependent columns.<br><br>Lemma 2.11
Let \(V\) be a vector space. A subset \(B \subseteq V\) is called a basis of \(V\) if
\(B\) is linearly independent
{{c1::\(\textbf{Span}(B) = V\).}}
Current
Note has been deleted
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) be a vector space. A subset \(B \subseteq V\) is called a basis of \(V\) if </div><div><ul><li>{{c1::\(B\) is linearly independent}}</li><li>{{c1::\(\textbf{Span}(B) = V\).}}</li></ul></div>
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.
Runtime of sorting an array containing only \(1, 0\)?
Back
ETH::1._Semester::A&D::04._Sorting_Algorithms
Runtime of sorting an array containing only \(1, 0\)?
Using bucketsort, we can achieve \(O(n)\).
We go through the array once, counting occurences of \(0\) as x. We then add \(x\) zeros in the beginning and fill the rest with 1s.
Field-by-field Comparison
Field
Before
After
Front
Runtime of sorting an array containing only \(1, 0\)?
Back
Using bucketsort, we can achieve \(O(n)\). <br><br>We go through the array once, counting occurences of \(0\) as x. We then add \(x\) zeros in the beginning and fill the rest with 1s.
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)\): As visit(u) would call visit(v) before the recursive call ends. <img src="paste-a6fc070f96de8bd2b8148e3891cf956fd611a0a2.jpg"> }}</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><b>push(k, S)</b>: {{c1:: push a new object <b>k</b> to the top of the stack <b>S</b>}}</li><li><b>pop(S)</b>: {{c2:: remove and return the top element of the stack <b>S</b>}}</li><li><b>top(S)</b>: {{c3:: 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
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br><br>\(\text{pre}(u) < \text{pre}(v) < \text{post}(v) < \text{post}(u)\), but <b>not tree edge</b>: {{c1:: Forward edge}}
Let \((S, V \setminus S)\) be any cut of a graph \(G\).
Let \(e = (u,v)\) be the minimal edge crossing this cut.
We want to show that \(e \in T\).
Assume \(e \not \in T\) for contradiction.
Since \(T\) is a spanning tree, \(T \cup {u}\) contains a cycle, crossing the cut at least twice (once via \(e\) and once via another edge \(e’\).)
We now construct \(T’= (T \cup {e}) \setminus {e’}\) which breaks the cycle but keeps the MST property.
Since \(w(e) < w(e’)\), \(w(T’) < w(T)\) and thus \(T\) is not an MST.
Field-by-field Comparison
Field
Before
After
Front
Cut and Paste Proof of <b>Cut-Property</b>:
Back
<div>Let \((S, V \setminus S)\) be any cut of a graph \(G\).</div><div><br></div><div>Let \(e = (u,v)\) be the minimal edge crossing this cut. </div><div>We want to show that \(e \in T\). </div><div><br></div><div><ol><li>Assume \(e \not \in T\) for contradiction.</li><li>Since \(T\) is a spanning tree, \(T \cup {u}\) contains a cycle, crossing the cut at least twice (once via \(e\) and once via another edge \(e’\).)</li><li>We now construct \(T’= (T \cup {e}) \setminus {e’}\) which breaks the cycle but keeps the MST property.</li><li>Since \(w(e) < w(e’)\), \(w(T’) < w(T)\) and thus \(T\) is not an MST.</li></ol></div>
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}}.
dequeue(S): remove and return the first element of the queue
Field-by-field Comparison
Field
Before
After
Text
The ADT <b>queue</b> has the following operations:<br><ul><li><b>enqueue(k, S)</b>: {{c2:: append at the end of the queue}}</li><li><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>)}}.
Start in the middle of the array. <br><br>If the middle element is the target element, return the current index.<br><br>Else if the middle elment is larger (smaller) than the target element, continue recursively on the left (right) half of the array.
\(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 Bellman-Ford for "free".</div>
A Minimum Spanning Tree is a subgraph of a connected, undirected, weighted graph 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 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 that fullfills:<br><ul><li>{{c2:: spanning, it connects all vertices}}</li><li>{{c3:: acylic, it's a tree}}</li><li>{{c4:: 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><b>insert(k, L)</b>: {{c1:: insert the key <b>K</b> at the end of the list <b>L</b>}}</li><li><b>get(i, L)</b>: {{c2:: return the memory address of the i-th key in list <b>L</b>}}</li><li><b>delete(k, L)</b>: {{c3:: remove the key <b>k</b> from the list <b>L</b>}}</li><li><b>insertAfter(k, k', L)</b>: {{c4:: inserts the key <b>k'</b> after the key <b>k</b> in the list <b>L</b>}}</li></ul>
The depth \(h\) of a seach tree of any comparison-based algorithm satisfies which bound?
\(h \geq \Omega(\log n)\) this is information theoretically the least amount of comparisons necessary.
Note that \(h \not \leq O(n)\) necessarily as we could have a really stupid algorithm that compares thrice for example.
Field-by-field Comparison
Field
Before
After
Front
The depth \(h\) of a seach tree of any comparison-based algorithm satisfies which bound?
Back
\(h \geq \Omega(\log n)\) this is information theoretically the least amount of comparisons necessary.<br><br>Note that \(h \not \leq O(n)\) necessarily as we could have a really stupid algorithm that compares thrice for example.
Explain how union 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 union 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)
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
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)\)
In a sparse graph an adjacency list is better, in a dense graph an 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
Which datastructure is best for DFS?<br><br>In a sparse graph {{c1:: an adjacency list is better}}, in a dense graph {{c1:: an 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 (or that of another child, as works) 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>: Insertion 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 (or that of another child, as works) 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 \(G\) 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 \(G\) 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><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.<br><br><div>Dann enthält jeder minimale Spannbaum von \(G\) 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 whether 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 whether 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
Provide 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>insert</b>: {{c1::insert with priority <b>p}}</b><br></li><li><b>extractMax:</b> {{c2::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 in constant time! We have to swap 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\)}}.
No, because it's the heaviest edge in the cycle. If there was an MST containing it, we could remove it and replace it by another edge in the cycle. Then we preserve the tree property yet it's weight is strictly lower.
Field-by-field Comparison
Field
Before
After
Front
Can (g, h) ever be in an MST? Prove it:<br><img src="paste-0451663ce9f1137e81a00020ee38fb0a96908565.jpg">
Back
No, because it's the heaviest edge in the cycle.<br>If there was an MST containing it, we could remove it and replace it by another edge in the cycle.<br>Then we preserve the tree property yet it's weight is strictly lower.
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 anliegend) 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 anliegend) to \(u, v\).
Field-by-field Comparison
Field
Before
After
Text
In an edge \(e = \{u, v\}\), we call \(u\) {{c1::adjacent (a<i>djazent</i> oder b<i>enachbart</i>)}} to \(v\) (and the other way around) and \(e\) {{c2::incident (i<i>nzident</i> oder a<i>nliegend</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>For all \(n < r - l + 1\) merge sort correctly sorts any sub-array of length n.</div><div><br></div><div>Assuming the invariant holds, the two recursive calls return sorted halves. </div><div><br></div><div>It remains to show that merge correctly combines two sorted halves into a sorted whole.</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)\). (Though it can be implemented as such)<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>: Deletion 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: \(\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: \(\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 entries (Base case, recursive formula, pay attention to bounds!)}}</li><li>{{c3::Order of calculation (what depends on what entries, what variable incremented first)}}</li><li>{{c4::Extracting the solution}}</li><li>{{c5::Runtime}}</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
How can we check for cycles via DFS?
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...).
The term \(B - b_i\) can become negative. Instead of accessing an invalid index, return "false" (the neutral element for OR), since you can't achieve a negative sum.
Field-by-field Comparison
Field
Before
After
Text
When writing a recursion which accesses an index that could go out of bounds, make sure to {{c1::return a neutral value instead of crashing}}.
Extra
Example: Subset Sum<br><br>Recursion: \(DP[i][B] = DP[i-1][B] \lor DP[i-1][B - b_i]\)<br><br>The term \(B - b_i\) can become negative. Instead of accessing an invalid index, return "false" (the neutral element for OR), since you can't achieve a negative sum.
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)\)
2-3 Tree: We deleted a node and now it's sibling is an only child. What happens if it's neighbor has 2 keys?
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: We deleted a node and now it's sibling is an only child. What happens if it's neighbor 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 and 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\)
Field-by-field Comparison
Field
Before
After
Text
Pre-/Post-Ordering Classification for an edge \((u, v)\):<br><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>}}.
A while loop that doesn't increase constantly but goes from i = 1 and increases by i = 2*i for example, can be modelled as a sum from 0 to \(\log_2 n\)?
A while loop that doesn't increase constantly but goes from i = 1 and increases by i = 2*i for example, can be modelled as a sum from 0 to \(\log_2 n\)?
Note that we start from 0, as \(2 = 1^0\).
Field-by-field Comparison
Field
Before
After
Text
A while loop that doesn't increase constantly but goes from <b>i = 1</b> and increases by <b>i = 2*i</b> for example, can be modelled as a sum from {{c1::0}} to {{c2:: \(\log_2 n\)}}?
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.
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><br></div><div>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><br>We then swap the pivot into the middle of that.<br><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 and 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).</div><div><br>Then we "versickern" this small element, until the heap condition is restored. 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 one get a lower bound for the function \(n!\) ?
One could simply take only 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 one get a lower bound for the function \(n!\) ?
Back
One could simply take only 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 Bellman-Ford 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 Bellman-Ford 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 datastructure 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 datastructure 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\)}}.
Once the DP table is filled, backtracking reconstructs the actual solution (not just the optimal value) by tracing which choices led to each cell.
Field-by-field Comparison
Field
Before
After
Front
What is "backtracking" in DP problems?
Back
Once the DP table is filled, backtracking reconstructs the actual solution (not just the optimal value) by tracing which choices led to each cell.<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>
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">
How can I find the asymptotic behavior of a sum like \(\sum_{i = 1}^{^{\lceil \sqrt{n} \rceil}} \sqrt{i}\)?
Sum and integral have the same asymptotic behavior (not covered in lecture)!
\[\begin{align}
\sum_{i=1}^{\lceil \sqrt{n} \rceil} \sqrt{i}
&\sim \int_1^{\lceil \sqrt{n} \rceil} \sqrt{x}\,dx \\
&= \left[\frac{2}{3}x^{3/2}\right]_1^{\lceil \sqrt{n} \rceil} \\
&= \frac{2}{3}\bigl(\lceil \sqrt{n} \rceil^{3/2} - 1\bigr) \\
&\sim \frac{2}{3}\bigl(n^{1/2}\bigr)^{3/2} \\
&= \Theta(n^{3/4}).
\end{align}\]
(We use \(\sim\) to denote asympotic equivalence. Correct but verbose would be to wrap everything in \(\Theta\))
Field-by-field Comparison
Field
Before
After
Front
How can I find the asymptotic behavior of a sum like \(\sum_{i = 1}^{^{\lceil \sqrt{n} \rceil}} \sqrt{i}\)?
Back
Sum and integral have the same asymptotic behavior (not covered in lecture)!<br><br>\[\begin{align}
\sum_{i=1}^{\lceil \sqrt{n} \rceil} \sqrt{i}
&\sim \int_1^{\lceil \sqrt{n} \rceil} \sqrt{x}\,dx \\
&= \left[\frac{2}{3}x^{3/2}\right]_1^{\lceil \sqrt{n} \rceil} \\
&= \frac{2}{3}\bigl(\lceil \sqrt{n} \rceil^{3/2} - 1\bigr) \\
&\sim \frac{2}{3}\bigl(n^{1/2}\bigr)^{3/2} \\
&= \Theta(n^{3/4}).
\end{align}\]<br>
(We use \(\sim\) to denote asympotic equivalence. Correct but verbose would be to wrap everything in \(\Theta\))
2-3 Tree: We deleted a node and now it's sibling is an only child. What happens if it's neighbor has 3 keys?
Our current node adopts one of the children. The separators have to be updated by “rotating them”. The parent sep moves with the adopted and the left sep becomes the new parent).
Field-by-field Comparison
Field
Before
After
Front
<b>2-3 Tree</b>: We deleted a node and now it's sibling is an only child. What happens if it's neighbor has 3 keys?
Back
Our current node adopts one of the children. The separators have to be updated by “rotating them”. The parent sep moves with the adopted and the left sep becomes the new parent).<br><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 for a 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):
We can build one backwards, by always finding a vertex which has no succeeding vertices, removing it from the graph and adding 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
We can build one backwards, by always finding a vertex which has no succeeding vertices, removing it from the graph and adding it to the front of our topologically sorted list.<br><br>This is not possible if there is a directed cycle in the graph.
This trick works even if every term has a constant coefficient.
Field-by-field Comparison
Field
Before
After
Front
How can you find the upper bound of a geometric series like \(T = 7^1, 7^2, \ldots, 7^n\)?
Back
Use the multiply-subract trick.<br><ol><li>Mutliply the series by its base: \(7T\)</li><li>Subtract: \(7T - T = 7^{n+1} - 7^1\) (middle terms cancel)</li><li>Factor: \(T(7-1) = 7^{n+1} - 7^1\)</li><li>Divide: \(T = \frac{7^{n+1} - 7^1}{6}\)</li></ol><div>This trick works even if every term has a constant coefficient.</div>
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. <br><br>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 equals the 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 equals the <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>
DFS Pseudocode needs to include a for loop over all unmarked nodes, when we're not sure whether the graph is connected.
Otherwise we aren't visiting ZHKs that aren't connected to our chosen first node.
DFS(g):
all vertices unmarked
for u unmarked:
visit(u)
visit(u):
mark u
for v adjacent to u:
Field-by-field Comparison
Field
Before
After
Text
DFS Pseudocode needs to include {{c1:: a for loop over all unmarked nodes}}, when we're not sure whether the graph is connected.
Extra
Otherwise we aren't visiting ZHKs that aren't connected to our chosen first node.<pre><code>DFS(g):
all vertices unmarked
for u unmarked:
visit(u)
visit(u):
mark u
for v adjacent to u:
</code></pre><pre><code><br></code></pre>
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">
We use \(\Theta(n^2)\) comparisons and \(O(n^2)\) switches.
Invariant
Nach \(j\) Durchläufen der äusseren Schleife sind die \(j\) grössten Elemente am richtigen Ort.
Worst Case Scenario
Array sorted in descending order
Attributes
In-Place<br>Stable<br><div><br></div>
<div>An algorithm is in-place if it uses only a constant amount of extra memory (i.e., O(1) additional space), beyond the input itself. It modifies the input data structure directly rather than creating a copy. </div><div><br></div><div>An algorithm is <em>stable</em> if it preserves the relative order of elements with equal keys. If two elements have the same value, they appear in the same order in the output as they did in the input.<br></div>
<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>
Replacing \(v\) and \(w\) by a single vertex \(vw\)
Replacing any edge \(\{v,x\}\) or \(\{w, x\}\) by \(\{vw, x\}\).
Set the weights to their previous ones, and the minimum if there was more than one.
Field-by-field Comparison
Field
Before
After
Front
What is <b>contracting</b> an edge?
Back
We contract \(\{v, w\}\) by:<br><ol><li>Replacing \(v\) and \(w\) by a single vertex \(vw\)</li><li>Replacing any edge \(\{v,x\}\) or \(\{w, x\}\) by \(\{vw, x\}\).</li><li>Set the weights to their previous ones, and the minimum if there was more than one.</li></ol>
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}}.
After adding \(x\) edges to the Union-Find datastructure, the repr array contains \(n-x\) components (different values).
Each added edge removes one unconnected component.
Field-by-field Comparison
Field
Before
After
Text
After adding \(x\) edges to the Union-Find datastructure, the <b>repr</b> array contains {{c1::\(n-x\) components (different values)}}.
Extra
Each added edge <i>removes one unconnected component</i>.
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 those rounded profits: \(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\).
We then only have to compute every K'th entry of 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 those rounded profits:<br>\(\overline{p_i} := K \cdot \lfloor \frac{p_i}{K} \rfloor\). <br><br>We then only have to compute every K'th entry of 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><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 a pointer to the next element in the list instead.
We also have an extra pointer to the end.
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 next element in the list instead}}.<br><br>We also have {{c3::an extra pointer to the end}}.
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 necessarily balanced, hence it is 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 necessarily <b>balanced</b>, hence it is possible that \(h >> \log_2 n\).<br><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 once 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>
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 {{c1:: \(d[v] = \min \{d[v], w(v*, v)\}\) instead of \(d[v^*] + w(v^*, v)\) }}.
Dijkstra's find the shortest distance to each vertex, thus it tracks the total distance.
Prim's needs to build the MST. Since we add vertex \(v\) to the MST in the loop, we now want to know the new least distance to the MST for each node.
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] = \min \{d[v], 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 distance.<br><br>Prim's needs to build the MST. Since we add vertex \(v\) to the MST in the loop, we now want to know the new least distance to the MST for each node.
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><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)\)}}.
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.<br><br>Note that (negative) cycles are accepted, as we are looking for the "shortest" (not cheapest) path.
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, since 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, since 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((|V| + |E|) \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>
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>
No, as \(\{b, c\}\) does not have a greatest lower bound. Both \(a\) and \(e\) would fit, but there isn't a greatest one.
Field-by-field Comparison
Field
Before
After
Front
Is this a lattice?<br><br> <img src="paste-055f63c858350a5edd9d53fae73e8b5c5e237b32.jpg">
Back
No, as \(\{b, c\}\) does not have a greatest lower bound. Both \(a\) and \(e\) would fit, but there isn't a <b>greatest</b> one.
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) = 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) = 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>
To prove an isomorphism \(\phi: G \rightarrow H\), we need to prove:
Well-definedness
The image of \(\phi\) lies entirely within \(H\)
The homomorphism-property \(\phi(g_1 \cdot g_2) = \phi(g_1) \cdot \phi(g_2)\) holds
Injectivity
Surjectivity
Field-by-field Comparison
Field
Before
After
Text
To prove an isomorphism \(\phi: G \rightarrow H\), we need to prove:<br><ol><li>{{c1::Well-definedness}}</li><li>{{c2::The image of \(\phi\) lies entirely within \(H\)}}<br></li><li>{{c3::The homomorphism-property \(\phi(g_1 \cdot g_2) = \phi(g_1) \cdot \phi(g_2)\) holds}}<br></li><li>{{c4::Injectivity}}</li><li>{{c5::Surjectivity}}</li></ol>
What does it mean for a function \(f: A \to B\) to be injective?
For \(a \neq a'\) we have \(f(a) \neq f(a')\).
No two distinct values are mapped to the same function value (no "collisions"). This is also called "one-to-one".
Field-by-field Comparison
Field
Before
After
Front
What does it mean for a function \(f: A \to B\) to be injective?
Back
For \(a \neq a'\) we have \(f(a) \neq f(a')\). <br><br>No two distinct values are mapped to the same function value (no "collisions"). This is also called "one-to-one".
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.
A formula in 1st order logic with no logical connectives (like \(\lnot, \land, \lor, \rightarrow \)) and no quantifiers (\(\forall, \exists\))
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>}}.
Extra
A formula in 1st order logic with <b>no logical connectives</b> (like \(\lnot, \land, \lor, \rightarrow \)) and <b>no quantifiers</b> (\(\forall, \exists\))
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>
What is the logical principle behind case distinction?
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 principle behind 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 \mid a \land d \mid b \land \forall c \ ((c \mid a \land c \mid b) \rightarrow c \mid 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 \mid a \land d \mid b \land \forall c \ ((c \mid a \land c \mid b) \rightarrow c \mid 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\)}}.
How is Euclidian division of polynomials in a field defined?
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>How is Euclidian division of polynomials in a field defined?</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>
In a Euclidean domain every element can be factored uniquely into irreducible elements (up to associates)
\(a, b\) associates (\(a \sim b\)) if \(a = ub\) for some unit \(u\).
Proof sketch:
Consider a nonzero, nonunit \(a \in R\).
If a is irreducible, we are done.
Otherwise, \(a = bc\) with both \(b,c\) nonunits.
By the Euclidean property, we may assume
\(\delta(b), \delta(c) < \delta(a)\).
If either factor is reducible, factor it further.
This process must terminate, since \(\delta\) takes values in \(\mathbb{N}\) and strictly decreases.
Field-by-field Comparison
Field
Before
After
Text
In a Euclidean domain every element can be {{c1:: factored uniquely into irreducible elements (up to associates)}}
Extra
\(a, b\) associates (\(a \sim b\)) if \(a = ub\) for some unit \(u\).<br><br><b>Proof sketch:<br></b><div><ol><li>
<div>Consider a nonzero, nonunit \(a \in R\).</div>
</li><li>
<div>If a is irreducible, we are done.</div>
</li><li>
<div>Otherwise, \(a = bc\) with both \(b,c\) nonunits.</div>
</li><li>
<div>By the Euclidean property, we may assume </div>\(\delta(b), \delta(c) < \delta(a)\).</li><li>
<div>If either factor is reducible, factor it further.</div>
</li><li>
<div>This process <b>must terminate</b>, since \(\delta\) takes values in \(\mathbb{N}\) and strictly decreases.</div></li></ol></div>
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></p><ol><li>{{c2::The set \(\{e\}\) (containing only the neutral element)}}</li><li>{{c3::\(G\) itself}}</li></ol>
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.
Uncountability Proof by Complement (with example \([0,1] \setminus \mathbb{Q}\)):
Find \(B\) uncountable such that \(A \subseteq B\).
Show that \(B \backslash A\) countable which proves that \(A\) uncountable.
You have to prove this implication in the exam:
Assume \(A\) is countable towards contradiction.
We have shown that \(B \ \backslash \ A\) is countable.
Thus \(A \cup (B \ \backslash \ A)\) also countable (Theorem 3.22: Union of countable is countable).
But \(A \cup (B \ \backslash \ A) \supseteq B\), which is uncountable - contradiction!
Verwende \(\mathbb{R}\) oder \([0,1]\) statt \(\{0, 1\}^\infty\) falls einfacher.
Beispiel mit \([0,1] \setminus \mathbb{Q}\):
We know \([0,1]\) is uncountable.
By definition \([0, 1] \setminus \mathbb{Q} \subseteq [0,1]\) and \([0,1] \setminus ([0,1] \setminus \mathbb{Q})\) which is equal to \(\mathbb{Q} \cap [0,1]\). Thus \(\mathbb{Q} \cap [0,1] \subseteq \mathbb{Q}\) and by Lemma 3.15 \(\mathbb{Q} \cap [0,1] \preceq \mathbb{Q}\) (subset is dominated).
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.
Proof: \(L\) left inverse, \(R\) right inverse.
\(L = L * e = L * (a * R) \) \(= (L * a) * R = e * R = R\)
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><p><b>Proof: </b>\(L\) left inverse, \(R\) right inverse.</p><p>\(L = L * e = L * (a * R) \) \(= (L * a) * R = e * R = R\)</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.
What happens if there is a left and right neutral element in a group?
Lemma 5.1: If \(\langle S; * \rangle\) has both a left and a right neutral element, then they are equal.
\(e * e' = e\) (\(e'\) right inverse)
\(e * e' = e'\) (\(e\) left inverse)
Field-by-field Comparison
Field
Before
After
Front
What happens if there is a left and right neutral element in a group?
Back
<p><strong>Lemma 5.1</strong>: If \(\langle S; * \rangle\) has both a left and a right neutral element, then they are <strong>equal</strong>.</p><p>\(e * e' = e\) (\(e'\) right inverse)</p><p>\(e * e' = e'\) (\(e\) left inverse)</p>
State Corollary 5.9 about the relationship between element order and group order for a finite group \(G\). (Proof included)
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\). <i>(Proof included)</i></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>
Consider the poset \((A; \preceq)\) and \( S \subseteq A\).
\(a \in A\) is a lower (upper) bound of \(S\) if \(a \preceq b\) (\(a \succeq b) \) 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
Consider the poset \((A; \preceq)\) and \( S \subseteq A\).<br><br><div>\(a \in A\) is a {{c1::<b>lower (upper) bound</b> of \(S\)}} if {{c2::\(a \preceq b\) (\(a \succeq b) \) 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)\)
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><ol><li>{{c1::\((\forall x \, F) \land H\)}} \( \equiv\) {{c2::\( \forall x \, (F \land H)\)}}</li><li>{{c3::\((\forall x \, F) \lor H \)}} \(\equiv\) {{c4::\(\forall x \, (F \lor H)\)}}</li><li>{{c5::\((\exists x \, F) \land H \)}} \(\equiv\) {{c6:: \(\exists x \, (F \land H)\)}}</li><li>{{c7::\((\exists x \, F) \lor H\)}} \(\equiv\) {{c8:: \(\exists x \, (F \lor H)\)}}</li></ol>
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 Fermat's little theorem.
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 <b>number and the order of the group</b> (modulo remainder) to be <i>coprime</i>, i.e. \(\gcd(9, 11) = 1\).<br><br><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 Fermat's little theorem.</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".
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><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 \(\gcd(a, m)=1\), it is an element of \(\mathbb{Z}_m^*\) and thus an element of a group. \(\langle a \rangle\) therefore must be a subgroup with an order that divides \(\mathbb{Z}_m^* = \varphi(m)\)\(\iff \varphi(m) = \operatorname{ord}(a) \cdot k\) (Lagrange's) .
<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 \(\gcd(a, m)=1\), it is an element of \(\mathbb{Z}_m^*\) and thus an element of a group. \(\langle a \rangle\) therefore must be a subgroup with an order that divides \(\mathbb{Z}_m^* = \varphi(m)\)\(\iff \varphi(m) = \operatorname{ord}(a) \cdot k\) (Lagrange's) .</p><p>\(\implies (a^{\operatorname{ord}(a)})^k = a^{\varphi(m)} \equiv_m 1\)</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::\[{{c1::\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::\[{{c1::\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::\[{{c1::\mathcal{K}(F)}} = \{\{L_{11}, \dots, L_{1m_1}\}, \dots, \{L_{n1}, \dots, L_{nm_n}\}\}\]}}
If the prime factorization of \(m\) is \(m = \prod_{i=1}^r p_i^{e_i}\) then \(\varphi(m)\) is?
\[\varphi(m) = \prod_{i=1}^r (p_i - 1)p_i^{e_i - 1}\] Explanation: For primes: a number is not coprime to \(p^e\) \(\iff\) it contains a factor of \(p\). These are \(p, 2p, 3p, \ldots, p^{e-1}p\) (exactly \(p^{e-1}\) numbers) \(\implies\)\(\varphi(p^e) = p^e - p^{e - 1} = (p-1)p^{e-1}\) For all numbers: \(\varphi(mn)=\varphi(m)\varphi(n)\) if \(m\) and \(n\) are coprime, so we end up w/ a product.
Field-by-field Comparison
Field
Before
After
Front
<p>If the prime factorization of \(m\) is \(m = \prod_{i=1}^r p_i^{e_i}\) then \(\varphi(m)\) is?</p>
Back
\[\varphi(m) = \prod_{i=1}^r (p_i - 1)p_i^{e_i - 1}\]<br><b>Explanation:<br></b><i>For primes:</i> a number is not coprime to \(p^e\) \(\iff\) it contains a factor of \(p\). These are \(p, 2p, 3p, \ldots, p^{e-1}p\) (exactly \(p^{e-1}\) numbers) \(\implies\)\(\varphi(p^e) = p^e - p^{e - 1} = (p-1)p^{e-1}\)<br><i>For all numbers:</i> \(\varphi(mn)=\varphi(m)\varphi(n)\) if \(m\) and \(n\) are coprime, so we end up w/ a product.<br>
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\)? How can this be proven?
\(\mathbb{Z}_n\) is generated by all \(a \in \mathbb{Z}_n\) for which \(\gcd(a, n) = 1\) (all elements coprime to \(n\)).
Proof:
\(a\) generator \(\implies\)\(\gcd(a, n) = 1\) \(\mathbb{Z}_n = \langle a \rangle\) \(\implies\)\(1 \in \langle a \rangle\) \(\implies\)\(a^u = au \equiv_n 1\) for some \(u\) \(\implies\)\(\gcd(a, n) = 1\) (\(\gcd\) must divide both \(au-qn\) and 1).
\(\gcd(a, n) = 1 \implies\)\(a\) generator \(\gcd(a, n) = 1\) \(\implies\)\(ua + un = 1\) for some \(u, n\) (Bézout) \(\implies\)\(ua = a^u \equiv_n 1\) \(\implies\)for every element \(b\), \(\exists c\) s.t. \(b = c \cdot u \cdot a = (a^u)^c = a^{u \cdot c}\)
Field-by-field Comparison
Field
Before
After
Front
<p>Which elements generate \(\mathbb{Z}_n\)? How can this be proven?</p>
Back
<p>\(\mathbb{Z}_n\) is generated by <strong>all \(a \in \mathbb{Z}_n\) for which \(\gcd(a, n) = 1\)</strong> (all elements coprime to \(n\)).</p>
<p><strong>Proof:</strong></p><p>\(a\) generator \(\implies\)\(\gcd(a, n) = 1\)<br>\(\mathbb{Z}_n = \langle a \rangle\)<br>\(\implies\)\(1 \in \langle a \rangle\)<br>\(\implies\)\(a^u = au \equiv_n 1\) for some \(u\)<br>\(\implies\)\(\gcd(a, n) = 1\) (\(\gcd\) must divide both \(au-qn\) and 1).</p>\(\gcd(a, n) = 1 \implies\)\(a\) generator<br>\(\gcd(a, n) = 1\)<br>\(\implies\)\(ua + un = 1\) for some \(u, n\) (Bézout)<br>\(\implies\)\(ua = a^u \equiv_n 1\)<br>\(\implies\)for every element \(b\), \(\exists c\) s.t. \(b = c \cdot u \cdot a = (a^u)^c = a^{u \cdot c}\)
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}}: </p><p>{{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)\]}}
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)\]}}
\((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology
{{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><ol><li>{{c1::\(\{F_1, \dots, F_k\} \models G\)}}</li><li>{{c2::\((F_1 \land F_2 \land \dots F_k) \rightarrow G\) is a tautology}}</li><li>{{c3::\(\{F_1, F_2, \dots, F_k, \lnot G\}\) is unsatisfiable}}.</li></ol>
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><ol><li>{{c2::An atomic formula is a formula}}</li><li>If \(F\) and \(G\) are formulas, then also {{c3::\(\lnot F\), \(F \lor G\), \(F \land G\)}}.</li></ol>
How can we test whether 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 whether 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 assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \({{c1(F) \subseteq \{1, \dots, k\}\) of the indices}}.
The semantics of a logic defines a function \(free\) which assigns to each formula \(F = (f_1, f_2, \dots, f_k) \in \Lambda^*\) a subset \({{c1(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 \({{c1::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\).
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
Consider the poset \((A;\preceq)\). <br><br>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
Field-by-field Comparison
Field
Before
After
Text
<p>To prove \(\langle G; * \rangle\) is a group, you need to prove three axioms:</p><ol><li>{{c2::G1 (associativity)}}</li><li>{{c3::G2 (neutral element) G2' -> you only need to prove existence of a right neutral element (not a full two-sided neutral).}}</li><li>{{c4::G3 (inverse) G3' -> you only need to prove the existence of a right inverse}}</li></ol>
What exponentiation operation is valid in modular arithmetic?
This is allowed:
\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)
But this on the other hand is illegal:
\(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
This is allowed:<br><ul><li>\(a \equiv_n b\) and then \(a^x \equiv_n b^x\)<br></li></ul><div>But this on the other hand is illegal:</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::R<b>ectify</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\)?
Complete relation \(A \times A\) → single equivalence class \(A\)
{{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><ol><li>{{c1:: <strong>Complete relation</strong> \(A \times A\) → single equivalence class \(A\)}}</li><li>{{c2:: <strong>Identity relation</strong> → equivalence classes are all singletons \(\{a\}\)}}</li></ol>
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]\):: Substitution}}</li><li>{{c3::\(\exists x G\)}}\(\equiv\){{c4::\(\exists y G[x/y]\):: Substitution}}</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>
An integral domain is a commutative ring without zerodivisors (\( \forall a \ \forall b \quad ab = 0 \rightarrow a = 0 \lor b = 0\) ).
A domain of elements behaving like integers.
Examples: \(\mathbb{Z}, \mathbb{R}\)
Counterexample: \(\mathbb{Z}_m, m\) not prime
Field-by-field Comparison
Field
Before
After
Text
An {{c1::integral domain}} is a {{c2::commutative ring without zerodivisors (\( \forall a \ \forall b \quad ab = 0 \rightarrow a = 0 \lor b = 0\) ).}}
Extra
<div><i>A domain of elements behaving like integers.</i></div><br>Examples: \(\mathbb{Z}, \mathbb{R}\)<div>Counterexample: \(\mathbb{Z}_m, m\) not prime</div>
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?
Set notation (subset of \(A \times B\))
Boolean matrix (1 if \((a,b) \in \rho\), 0 otherwise)
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><ol><li>{{c1:: <strong>Set notation</strong> (subset of \(A \times B\))}}</li><li>{{c2:: <strong>Boolean matrix</strong> (1 if \((a,b) \in \rho\), 0 otherwise)}}</li><li>{{c3:: <strong>Directed graph</strong> (nodes are elements, edges are relations)}}</li></ol>
State Lemma 5.18 about the units of a ring and the property their set satisfies? (Proof included)
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 their set satisfies? <i>(Proof included)</i></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 .
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 {{c1::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}\)
Non-trivial: {0} is not a field. In particular, 1 = 0 (neutral element of mult. = neutral element of add.) causes trouble.
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
<b>Example:</b> \(\mathbb{R}\), but not \(\mathbb{Z}\)<br><br><b>Non-trivial:</b> {0} is not a field. In particular, 1 = 0 (neutral element of mult. = neutral element of add.) causes trouble.
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>
<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><p><b>Explanation:</b> <br>You can easily create an isomophism. For any\([a], [b] \in \mathbb{Z}_n\),</p><p>\(\varphi([a] + [b]) = \varphi([a+b])\)\(= g^{a+b} = g^a g^b = \varphi([a]) \varphi([b]).\)</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.
What are the restrictions on the universe \(U\) of an interpretation?
cannot be empty
not necessarily a set (can be the universe of all sets, which is a proper class, for example)
Field-by-field Comparison
Field
Before
After
Front
What are the restrictions on the universe \(U\) of an interpretation?
Back
<ul><li><b>cannot be empty</b></li><li>not necessarily a <i>set </i>(can be the universe of all sets, which is a proper class, for example)</li></ul>
Give the formal definition of "\(a\) divides \(b\)" (denoted \(a \mid b\)).
\[a \mid 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 \mid b\)).
Back
\[a \mid 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\).
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 a {{c1::subset}} of {{c1::\(A\times B\).}} <br><br>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}\) (since you need at least two primes for a composite integer, and \(n = \sqrt{n} \cdot \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}\) (since you need at least two primes for a composite integer, and \(n = \sqrt{n} \cdot \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>}}. <br><br>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\), a variable \(x\) and a term \(t\), {{c1::\(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)
The Diffie-Hellman Key-Agreement selects two public values:
a large prime \(p\)
a basis \(g\), which is then exponentiated
Field-by-field Comparison
Field
Before
After
Text
The Diffie-Hellman Key-Agreement selects two public values:<br><ol><li>{{c1:: a large prime \(p\)}}</li><li>{{c2:: a 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)
What are the three properties of an equivalence relation?
Reflexivity
Symmetry
Transitivity
Field-by-field Comparison
Field
Before
After
Text
What are the three properties of an equivalence relation?<br><ol><li>{{c1::Reflexivity}}<br></li><li>{{c2::Symmetry}}<br></li><li>{{c3::Transitivity}}<br></li></ol>
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><ul><li>{{c1::\(\mathcal{A}(F) = \mathcal{A}(A_i)\) for any atomic formula \(A_i\)}}</li></ul>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, \psi, \xi)\) where:
\(U\) is a non-empty universe
\(\phi\) (phi) assigns function symbols to functions \(U^k \rightarrow U\)
{{c3::\(\psi\) (psi) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}}
\(\xi\) (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, \psi, \xi)\) where:<br><ol><li>{{c1::\(U\) is a <b>non-empty</b> universe}}</li><li>{{c2::\(\phi\) (phi) assigns function symbols to functions \(U^k \rightarrow U\)}}</li><li>{{c3::\(\psi\) (psi) assigns predicate symbols to functions \(U^k \rightarrow \{0,1\}\)}}</li><li>{{c4::\(\xi\) (xi) assigns variable symbols to values in \(U\)}}</li></ol>
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\)?
The number of divisors of \(n\) (as the order of each subgroup divides the group order (which is n here) by Lagrange).
If \(n\) is written \(n = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\).
Note: This only holds because \(\mathbb{Z}_n\) is cyclic and therefore the subgroups are unique.
Field-by-field Comparison
Field
Before
After
Front
What is the number of subgroups of \(\mathbb{Z}_n\)?
Back
The number of divisors of \(n\) (as the order of each subgroup divides the group order (which is n here) by Lagrange). <br><br>If \(n\) is written \(n = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k}\) then it is \(\prod_{i=1}^k (e_i+1)\).<br><br><i>Note:</i> This only holds because \(\mathbb{Z}_n\) is cyclic and therefore the subgroups are unique.
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\).
neutral to neutral: \(\psi(e_G) = e_h\)
Field-by-field Comparison
Field
Before
After
Text
<p><strong>Lemma 5.5(ii)</strong>: A group homomorphism \(\psi: G \rightarrow H\) maps </p><ul><li>{{c1::inverses to inverses: \(\psi(\widehat{a}) = \widetilde{\psi(a)}\)}} for all \(a\).</li><li>{{c1::neutral to neutral: \(\psi(e_G) = e_h\)}}</li></ul>
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 function \(f: A \rightarrow B\) has a right inverse if and only if \(f\) is surjective (not in script).
We can create a function \(g\) that outputs a unique value in \(A\) for every input \(b\). We can then revert it with \(f\). Therefore, \(\forall (f \circ g) b = b \iff f \circ g = \text{id}_B\)
Field-by-field Comparison
Field
Before
After
Text
<p>A function \(f: A \rightarrow B\) has a {{c1::right inverse}} if and only if \(f\) is {{c2::surjective}} (not in script).</p>
Extra
We can create a function \(g\) that outputs a unique value in \(A\) for every input \(b\). We can then revert it with \(f\). Therefore, \(\forall (f \circ g) b = b \iff f \circ g = \text{id}_B\)
\(\psi(g_1 \cdot g_2) = \psi(g_1) + \psi(g_2)\) for all \(g_1, g_2\) in \(G\).
Field-by-field Comparison
Field
Before
After
Text
<p>To verify the {{c1::homomorphism property}}, check that: </p><p>{{c2::\(\psi(g_1 \cdot g_2) = \psi(g_1) + \psi(g_2)\)}} for all \(g_1, g_2\) in \(G\).</p>
A monoidis an algebra \( \langle S; *, e \rangle\) where \(*\) is associative and \(e\) is the neutral element.
Difference to group: Absence of inverse
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>
We take the field \(GF(p)[x]_{m(x)}\) where \(m(x)\) is an irreducible polynomial of degree \(q\).
Then \(GF(p)[x]_{m(x)}\) has \({|F|}^q\) polynomials in it, as all of degree less than \(q\) are coprime to \(m(x)\), by definition of irreducible. And this field is isomorphic to \(GF(p^q)\).
Example: The field \(GF(2)[x]\) \({x^2 + x + 1}\) is isomorphic to \(GF(2^2 = 4)\).
We can see this is the case as \(GF(2)[x]_{x^2 + x + 1}\) has \(4\) elements, \(\{0, 1, x, x + 1\}\), which we can basically map to \(GF(4)\) as \(\{0, 1, 2, 3\}\).
Indeed \(1 + x = x + 1\) in \(GF(2)[x]_{x^2 + 1 + 1}\) and \(1 + 2 = 3\) which is \(x + 1\) in the isomorphism.
Field-by-field Comparison
Field
Before
After
Front
How do we construct a field \(GF(p^q)\)?
Back
We take the field \(GF(p)[x]_{m(x)}\) where \(m(x)\) is an irreducible polynomial of degree \(q\).<br><br>Then \(GF(p)[x]_{m(x)}\) has \({|F|}^q\) polynomials in it, as all of degree less than \(q\) are coprime to \(m(x)\), by definition of irreducible. <br>And this field is isomorphic to \(GF(p^q)\).<br><br><div>
<strong>Example</strong>: The field \(GF(2)[x]\) \({x^2 + x + 1}\) is isomorphic to \(GF(2^2 = 4)\). </div><div>We can see this is the case as \(GF(2)[x]_{x^2 + x + 1}\) has \(4\) elements, \(\{0, 1, x, x + 1\}\), which we can basically map to \(GF(4)\) as \(\{0, 1, 2, 3\}\).</div><div><br></div><div>Indeed \(1 + x = x + 1\) in \(GF(2)[x]_{x^2 + 1 + 1}\) and \(1 + 2 = 3\) which is \(x + 1\) in the isomorphism.</div>
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\)}}.
Russell's Paradox proposes the (problematic) set \(R=\) {{c1::\(R = \{ A \mid A \notin A \}\)}}.
Assume R contains itself
Then R should not contain itself (because R only contains sets that do not contain themselves).
➜ Contradiction.
Assume R does not contain itself
Then it does meet the rule for membership in R, so it should contain itself.
➜ Contradiction.
A barber that shaves all and only those men who do not shave themselves. Does he shave himself?
Field-by-field Comparison
Field
Before
After
Text
Russell's Paradox proposes the (problematic) set \(R=\) {{c1::\(R = \{ A \mid A \notin A \}\)}}.
Extra
<div><ol><li>
<div><b>Assume R contains itself</b><b></b></div>
<div>Then R should <i>not</i> contain itself (because R only contains sets that do not contain themselves).</div>
<div>➜ Contradiction.</div>
</li><li>
<div><b>Assume R does not contain itself</b><b></b></div>
<div>Then it <i>does</i> meet the rule for membership in R, so it should contain itself.</div>
<div>➜ Contradiction.</div></li></ol></div><i>A barber that shaves all and only those men who do not shave themselves. Does he shave himself?</i><br>
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><br>{{c1::\(\psi(a*b) = \psi(a)\star\psi(b)\)}}.<br><br>If \(\psi\) is {{c2::a bijection from \(G\) to \(H\)}}, then it is called an <i>isomorphism</i>.
Derivation/inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)::Notation}} if {{c2:: \(G\) can be derived from the set \(\{F_1, \dots, F_k\}\) by rule \(R\)}}.
Derivation/inference rule: {{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)::Notation}} 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><i>inference</i> rule: <br>{{c1::\(\{F_1, \dots, F_k\} \vdash_R G\)::Notation}} 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, \(\psi\) assigns {{c2::predicate symbols \(P\) to functions, \(\psi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
In predicate logic interpretation, \(\psi\) assigns {{c2::predicate symbols \(P\) to functions, \(\psi(P)\) is a function \(U^k \rightarrow \{0,1\}\)}}.
Field-by-field Comparison
Field
Before
After
Text
In predicate logic interpretation, {{c1::\(\psi\)}} assigns {{c2::<b>predicate</b> symbols \(P\) to functions, \(\psi(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})\]}}
Which group operations work for \(\mathbb{Z}_m\) and \(\mathbb{Z}_m^*\)?
\(\mathbb{Z}_m\)
\(\mathbb{Z}_m^*\)
\(\oplus\)
Yes (forms a group)
No
\(\odot\)
No
Yes (forms a group)
Key point: \(\mathbb{Z}_m\) with addition \(\oplus\) is a group. \(\mathbb{Z}_m^*\) (coprime elements) with multiplication \(\odot\) is a group.
\(\mathbb{Z}_m^*\) is not a group under addition b/c it doesn't contain the neutral element 0.
Field-by-field Comparison
Field
Before
After
Front
<p>Which group operations work for \(\mathbb{Z}_m\) and \(\mathbb{Z}_m^*\)?</p>
Back
<table>
<thead>
<tr>
<th></th>
<th>\(\mathbb{Z}_m\)</th>
<th>\(\mathbb{Z}_m^*\)</th>
</tr>
</thead>
<tbody>
<tr>
<td>\(\oplus\)</td>
<td><strong>Yes</strong> (forms a group)</td>
<td>No</td>
</tr>
<tr>
<td>\(\odot\)</td>
<td>No</td>
<td><strong>Yes</strong> (forms a group)</td>
</tr>
</tbody>
</table>
<p><strong>Key point</strong>: \(\mathbb{Z}_m\) with addition \(\oplus\) is a group. \(\mathbb{Z}_m^*\) (coprime elements) with multiplication \(\odot\) is a group.</p><p>\(\mathbb{Z}_m^*\) is not a group under addition b/c it doesn't contain the neutral element 0.</p>
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. <br><br>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:
Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\)
{{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><ol><li>{{c1::Select a subset \(N\) of \(M\) such that \(N \vdash_R G\) for some formula \(G\)}}</li><li>{{c2::Add \(G\) to the set \(M\) (i.e., replace \(M\) by \(M \cup \{G\}\))}}</li></ol>
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}}.
A set of symbols \(\mathcal{Z} \subseteq \Lambda\)
\(\Lambda\) is the "alphabet" or collection of all available symbols
\(\mathcal{Z}\) is the subset of symbols we're actually interpreting
A domain for each symbol
For each symbol in \(\mathcal{Z}\), there's a set of possible values it could take
Often the domain is defined in terms of the universe \(U\) where a symbol can be a function, predicate or element of \(U\).
An assignment function
For each symbol in \(\mathcal{Z}\), the function picks one specific value from its domain
This gives meaning to each symbol
An interpretation can be described either as
one big assignment function over typed symbols, or
a structured tuple that spells out those assignments separately.
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
<ol><li><b>A set of symbols</b> \(\mathcal{Z} \subseteq \Lambda\)<ul>
<li>\(\Lambda\) is the "alphabet" or collection of all available symbols
</li>
<li>\(\mathcal{Z}\) is the subset of symbols we're actually interpreting
</li>
</ul>
</li>
<li><b>A domain for each symbol</b>
<ul>
<li>For each symbol in \(\mathcal{Z}\), there's a set of possible values it could take
</li>
<li>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\).<br><ol></ol></li>
</ul>
</li>
<li><b>An assignment function</b>
</li><ul>
<li>For each symbol in \(\mathcal{Z}\), the function picks one specific value from its domain
</li>
<li>This gives meaning to each symbol</li></ul></ol><b>An interpretation can be described either as</b><br><ul><li>one big assignment function over typed symbols,<b> or</b><br></li><li>a structured tuple that spells out those assignments separately.</li></ul><ol>
<h2></h2></ol>
This is important as \((\rho \circ \tau) \circ (\rho \circ \tau) = \rho \circ (\tau \circ \rho) \circ \tau\) is really useful in some exercises.
Field-by-field Comparison
Field
Before
After
Text
Relation and function composition is {{c1::associative}}.
Extra
This is important as \((\rho \circ \tau) \circ (\rho \circ \tau) = \rho \circ (\tau \circ \rho) \circ \tau\) is really useful in some exercises.
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.
---
\(F\) should evaluate to true if we don't have the first zero row, not the second zero row, and so on. De Morgan flips the conjunction of the literals to a disjunction and adds the negation.
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.<br><br>---<br><br>\(F\) should evaluate to true if we don't have the first zero row, not the second zero row, and so on. De Morgan flips the conjunction of the literals to a disjunction and adds the negation.
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\).
Propositional logic is (in relation to predicate logic):
embedded into predicate logic as a special case. We extend it by the concept of predicates.
Predicates of the form \(P()\) act as propositional symbols.
Field-by-field Comparison
Field
Before
After
Front
Propositional logic is (in relation to predicate logic):
Back
<i>embedded</i> into predicate logic as a <i>special case</i>. <br>We extend it by the concept of <b>predicates</b>.<br><br>Predicates of the form \(P()\) act as propositional symbols.
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 (the arity).
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 (the arity).
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 arity)}}.
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 parentheses (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 parentheses (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>}}.
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 it clearly is not injective.
Field-by-field Comparison
Field
Before
After
Front
<p>Does every homomorphism have to be injective?</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 it clearly is not injective.</p>
Every element has order 1 or \(|G|\) (Lagrange). Therefore, it is either the neutral element or a generator of the entire group.
Field-by-field Comparison
Field
Before
After
Front
<p>For which order is every group cyclic?</p>
Back
<p>If the <strong>order of the group</strong> is <strong>prime</strong>, it is cyclic!</p><p>Every element has order 1 or \(|G|\) (Lagrange). Therefore, it is either the neutral element or a generator of the entire group.</p>
The set of units of \(R\) is denoted by \(R^*\) and it 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 it 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 {{c1::\(R^*\)}} and it is a {{c3::group. This holds as we can easily see that every element of \(R^*\) has an inverse by definition. Thus the axiom \(G3\) holds :: Monoid/Group and why?}}.</p>
Provide 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>Provide 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>
How are the ideals \((a, b)\) and \((a)\) defined?
\[(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
How are the ideals \((a, b)\) and \((a)\) defined?
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>
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\).
Why unique: If there are two solutions, then, for all \(i\): \(x \equiv_{m_i} a_i\) and \(x' \equiv_{m_i} a_i\) \(\implies m_i \mid (x - x')\) for all \(i\) \(\implies M = \prod_{i=1}^{r} m_i \mid (x - x')\) since the \(m_i\) are pairwise coprime \(\implies\) any two solutions differ by a multiple of \(M\) (so there is at most one solution with \(0 \le 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 <b>pairwise relatively prime</b> 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 <b>unique solution</b> \(x\) satisfying \(0 \leq x < M\).<br><br><b>Why unique:</b> <br>If there are two solutions, then, for all \(i\):<br>\(x \equiv_{m_i} a_i\) and \(x' \equiv_{m_i} a_i\) <br>\(\implies m_i \mid (x - x')\) for all \(i\)<br>\(\implies M = \prod_{i=1}^{r} m_i \mid (x - x')\) since the \(m_i\) are pairwise coprime<br>\(\implies\) any two solutions differ by a multiple of \(M\) (so there is at most one solution with \(0 \le x < M\)).<br>
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 \(m\)).
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 \(m\)).</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 \mid 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 \mid 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. (Proof included)
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. <i>(Proof included)</i></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>
So \(f\) is not surjective → no bijection exists → \(A\) uncountable
Key idea: \(b\) differs from the \(n\)-th element in the \(n\)-th position, so it "escapes" any enumeration.
Field-by-field Comparison
Field
Before
After
Front
Uncountability Proof by Diagonalisation
Back
<ol>
<li><strong>Assume countable:</strong> Suppose \(f: \mathbb{N} \to A\) is a bijection. Therefore we can enumerate elements of \(A\): \(a_1, a_2, a_3, \ldots\)</li>
<li><strong>Represent elements:</strong> Let \(a_{i,j} \) represent the \(j\)-th number in the \(i\)-th element.<ul>
</ul>
</li>
<li><strong>Construct diagonal element \(b\):</strong> Define \(b\) by setting each element<ul>
<li>We need to have: \(b_i \neq a_{i,i}\) for all \(i\) </li>
<li>\(b_i = 1 - a_{i,i}\) (flip the bit) or \(b_i = \begin{cases} 4 & \text{if } a_{i,i} \neq 4 \\ 5 & \text{if } a_{i,i} = 4 \end{cases}\) (simply change element)</li>
</ul>
</li>
<li><strong>Show \(b\) not in list:</strong> For any \(i\), we have \(b_i \neq a_{i,i}\)
<ul>
<li>Therefore \(b \neq a_i\) for all \(i\)</li>
</ul>
</li>
<li><strong>Contradiction:</strong> But \(b \in A\), yet \(b \notin \{a_1, a_2, \ldots\}\)
<ul>
<li>So \(f\) is not surjective → no bijection exists → \(A\) uncountable</li>
</ul>
</li>
</ol>
<p><strong>Key idea:</strong> \(b\) differs from the \(n\)-th element in the \(n\)-th position, so it "escapes" any enumeration.</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)
In a finite group of order \(|G|\), for \(x^e = y\), \(d\) is the inverse such that \(y^d = x\) iff: (Proof included)
\(ed \equiv_{|G|} 1\), i.e. \(d\) is the multiplicative inverse of \(e\) modulo \(|G|\).
Proof
\(ed = k \cdot |G| + 1\) (multiplicative inverse)
\((x^e)^d = x^{ed} = x^{k\cdot |G| + 1}\)
\((x^{|G|})^k \cdot x = 1^k \cdot x = x\)
Thus this returns \(x\).
Field-by-field Comparison
Field
Before
After
Front
In a finite group of order \(|G|\), for \(x^e = y\), \(d\) is the inverse such that \(y^d = x\) iff: <i>(Proof included)</i>
Back
\(ed \equiv_{|G|} 1\), i.e. \(d\) is the multiplicative inverse of \(e\) modulo \(|G|\).<br><br><b>Proof</b><br><ol><li>\(ed = k \cdot |G| + 1\) (multiplicative inverse)</li><li>\((x^e)^d = x^{ed} = x^{k\cdot |G| + 1}\)</li><li>\((x^{|G|})^k \cdot x = 1^k \cdot x = x\)</li></ol><div>Thus this returns \(x\).</div>
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 \(\mathbb{Z}^*_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).
Why it doesn't contradict that every group of prime order is cyclic, with every element except the neutral element being a generator: \(\{2\} \cup [\text{all odd primes}]\)\(= [\text{all primes}]\)
Field-by-field Comparison
Field
Before
After
Front
For what \(m\) is \(\mathbb{Z}^*_m\) cyclic? (Theorem 5.15)
Back
The group \(\mathbb{Z}^*_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\)) <br><br><b>Example:</b> Is \(\mathbb{Z}^*_{19}\) cyclic? What is a generator? Yes, \(\mathbb{Z}^*_{19}\) is cyclic (since \(19\) is an odd prime). <br><ul><li>2 is a generator.</li><li>Powers of 2: 2, 4, 8, 16, 13, 7, 14, 9, 18, 17, 15, 11, 3, 6, 12, 5, 10, 1</li><li>Other generators: 3, 10, 13, 14, 15</li></ul><div><span style="color: rgb(255, 255, 255);"><b>Why it doesn't contradict </b>that every group of prime order is cyclic, with every element except the neutral element being a generator: </span>\(\{2\} \cup [\text{all odd primes}]\)\(= [\text{all primes}]\)</div><div><br></div>
If a ring \(R\) is non-trivial (has more than one element), then \(1 \neq 0\). (Proof in Extra)
Proof: Assume \(1 = 0\) for contradiction. For any \(a \in R\)
\(a = a \cdot 1\)
\(a = a \cdot 0\) (by assumption)
\(a = 0\)
Thus there is only the zero element, which is a contradiction to the non-triviality.
Lemma 5.17(4)
Field-by-field Comparison
Field
Before
After
Text
<p>If a ring \(R\) is {{c1::non-trivial (has more than one element)}}, then {{c2::\(1 \neq 0\)}}. <i>(Proof in Extra)</i></p>
Extra
Proof: Assume \(1 = 0\) for contradiction. For any \(a \in R\)<br><ol><li>\(a = a \cdot 1\)</li><li>\(a = a \cdot 0\) (by assumption)</li><li>\(a = 0\)</li><li>Thus there is only the zero element, which is a contradiction to the non-triviality.</li></ol><div><strong>Lemma 5.17(4)</strong><br></div>
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 \mid a\) and \(d \mid m\), then \(d \mid ax\) and \(d \mid km\) for any \(x\). Thus \(d \mid (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 \mid a\) and \(d \mid m\), then \(d \mid ax\) and \(d \mid km\) for any \(x\).<br>Thus \(d \mid (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>
This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\) (same as for the mult. inverse since \(a^{m-1}\) is the inverse).
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
\((a^{\operatorname{ord}(a)})^q \cdot a^r \equiv_n a^r\)<br><br>This is because if \(\gcd(a, n) = 1\) then there exists an \(m\) for which \(a^m = e\) (same as for the mult. inverse since \(a^{m-1}\) <i>is</i> the inverse).
What property do the orders of elements in finite groups have?
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.)
Proof: Since the order is finite, elements must repeat. That means, there exist \(m > n \geq 0\) s.t. \(g^m = g^n\) \(\implies g^{m-n} = e\)
Field-by-field Comparison
Field
Before
After
Front
<p>What property do the orders of elements in finite groups have?</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><p><b>Proof:</b> Since the order is finite, elements must repeat. That means, there exist \(m > n \geq 0\) s.t. \(g^m = g^n\)<br>\(\implies g^{m-n} = e\)<br></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\).}}
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\).}}
Extra
We know \(a^{\operatorname{order}(a)} \equiv_m 1\). Since \(\operatorname{order}(a)\) divides \(| \mathbb{Z}_m^* | = \varphi(m)\) (Lagrange's), \(a^{\varphi(m)} \equiv_m a^{k \cdot \operatorname{order}(a)} \equiv_m (a^{\operatorname{order}(a)})^k \equiv_m 1^k \equiv_m 1\)<br><br>This theorem is used for RSA.
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')\)}}
The Hasse diagram of a poset \((A; \preceq)\) is defined as 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 defined as 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 defined as {{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?. <i>(Proof included)</i></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. <br><br>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). (Proof Included)
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 \mid p\) and \(p \mid 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; Lagrange).
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). <i>(Proof Included)</i></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 \mid p\) and \(p \mid 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; Lagrange).</p>
Does \( p \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a \) hold? (Proof included)
Yes, but this has to be reproven before using.
The proof technique is important. Replacing a neutral element by something it's equal to often is 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 \mid a \land q \mid a \land \gcd(p, q) = 1 \implies pq \mid a \) hold? <i>(Proof included)</i>
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 to often is a smart move.<br><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>
Can we apply the CRT to this system? \[\begin{align*} x \equiv_{10} 3 \\ x \equiv_{2} 1 \\ x \equiv_3 2 \end{align*}\]
Yes we can, even though \(\gcd(10, 2) = 2\), as we can decompose \(x \equiv_{10} 3\) into \(x \equiv_5 3\) and \(x \equiv_2 3 \equiv_2 1\) which matches the other equation.
Thus the solution is still unique.
Field-by-field Comparison
Field
Before
After
Front
Can we apply the CRT to this system? \[\begin{align*} x \equiv_{10} 3 \\ x \equiv_{2} 1 \\ x \equiv_3 2 \end{align*}\]
Back
Yes we can, even though \(\gcd(10, 2) = 2\), as we can decompose \(x \equiv_{10} 3\) into \(x \equiv_5 3\) and \(x \equiv_2 3 \equiv_2 1\) which matches the other equation. <br><br>Thus the solution is still unique.
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>What is the definition of the prenex form?</b>
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 \(b\)
- Every common divisor of \(a\) and \(b\) divides \(d\)
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 \(b\)<br>
- Every common divisor of \(a\) and \(b\) divides \(d\) </p><p>Formally:\[d \ | \ a \ \land \ d \ | \ b \ \land \ \forall c ((c \ | \ a \ \land \ c \ | \ b) \rightarrow c \ | \ d)\]<br></p>
When is a relation \(\rho\) on set \(A\) irreflexive?
When \(a \ \not\rho \ a\) is true for all \(a \in A\), i.e., \(\rho \cap \text{id} = \emptyset\).
Note that irreflexive is NOT the negation of reflexive!
Field-by-field Comparison
Field
Before
After
Front
When is a relation \(\rho\) on set \(A\) irreflexive?
Back
When \(a \ \not\rho \ a\) is true for all \(a \in A\), i.e., \(\rho \cap \text{id} = \emptyset\).<br><br>Note that irreflexive is NOT the negation of reflexive!
What is the meaning of the multiplicative inverse of some number \(a\) modulo \(m\)?
It is 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 meaning of the multiplicative inverse of some number \(a\) modulo \(m\)?
Back
It is 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\).
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}}. <br><br>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>
<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\)}}
How is Lagrange interpolation for polynomials in a field defined?
Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\) where \(\alpha_i\) distinct for all \(i.\)
\(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{(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}{(\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 \(\alpha_i - \alpha_j \neq 0\) for \(i \neq j\) (as they are all distinct).
Field-by-field Comparison
Field
Before
After
Front
<p>How is Lagrange interpolation for polynomials in a field defined?</p>
Back
<p>Let \(\beta_i = a(\alpha_i)\) for \(i = 1, \dots, d+1\) where \(\alpha_i\) distinct for all \(i.\)</p><p><br>\(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{(x - \alpha_1) \cdots (x - \alpha_{i-1})(x - \alpha_{i+1}) \cdots (x - \alpha_{d+1})}{(\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 \(\alpha_i - \alpha_j \neq 0\) for \(i \neq j\) (as they are all distinct).</p>
Funktion verifizieren: Zeige dass \(f\) well-defined und total ist, und \(f(b) \in A\) für alle \(b\).
Injektivität beweisen: Zeige \(f(b) = f(b’) \ \implies b = b’\) oder direkt \(b \not = b’ \ \implies \ f(b) \not = f(b’)\).
Schluss: We now know \(\{0, 1\}^\infty \preceq A\) as there's an injection. Annahme \(A \preceq \mathbb{N} \implies \{0, 1\}^\infty \preceq \mathbb{N}\) via transitivity -> Contradiction. Thus \(A\) is uncountable: \(\lnot (A \preceq\mathbb{N})\).
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 either {{c1::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 Hamming distance between any two codewords.
The minimum distance of an error-correcting code \(\mathcal{C}\), denoted \(d_{\min}(\mathcal{C})\), is the minimum 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 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]\).
Result: we can construct a finite field with \(p^d\) elements by using an irreducible polynomial of degree \(d\) to cap the number of coefficients at \(d\)
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><b>Result:</b> we can construct a <strong>finite field</strong> with \(p^d\) elements by using an irreducible polynomial of degree \(d\) to cap the number of coefficients at \(d\)</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 \(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\): \[\psi(a * b) = \psi(a) \star \psi(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\): \[\psi(a * b) = \psi(a) \star \psi(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\): \[\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 {{c3:: the unique \(e\)-th root \(x = y^d\), with \(de \equiv_{|G|} 1\)}}.
Proof:
We have \(ed = k \cdot |G| + 1\) for some \(k\). Thus, for any \(x \in G\) we have\[(x^e)^d = x^{ed} = x^{k \cdot |G| + 1} = \underbrace{(x^{|G|})^k}_{=1} \cdot x = x\]which means that the function \(y \mapsto y^d\) is the inverse function of the function \(x \mapsto x^e\) (which is hence a bijection). The under-braced term is equal to 1 because the order of \(x\) must divide the order of \(G\) (Lagrange).
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><br>For \(x^e = y\), the inverse of \(y\) is {{c3:: the <b>unique</b> \(e\)-th root \(x = y^d\), with \(de \equiv_{|G|} 1\)}}.
Extra
<b>Proof:<br></b><div>We have \(ed = k \cdot |G| + 1\) for some \(k\). Thus, for any \(x \in G\) we have\[(x^e)^d = x^{ed} = x^{k \cdot |G| + 1} = \underbrace{(x^{|G|})^k}_{=1} \cdot x = x\]which means that the function \(y \mapsto y^d\) is the inverse function of the function \(x \mapsto x^e\) (which is hence a bijection). The under-braced term is equal to 1 because the order of \(x\) must divide the order of \(G\) (Lagrange).</div>
An irreducible polynomial has no roots in the field. It has to have degree \(\geq 2\). (Proof included)
Note that this is not a sufficient condition (no roots does not imply irreducible)!
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 has {{c3::no roots}} in the field. It has to have {{c2::degree \(\geq 2\)}}. <i>(Proof included)</i></p>
Extra
<strong>Note that this is not a sufficient condition (no roots does not imply irreducible)!<br><br>Proof</strong>: If it had a root \(\alpha\), then \((x - \alpha)\) would divide it by Lemma 5.29, contradicting irreducibility.
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>
If \(\{a,b\}\) has 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
Consider the poset \((A;\preceq)\). <br><br>If \(\{a,b\}\) has 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))\). <br><br>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).
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>
A euclidean domain is an integral domain \(D\) together with a degree function \(d: D \setminus {0} \rightarrow \mathbb{N}\) such that:
For every \(a\) and \(b \neq 0\) in \(D\) there exist \(q\) and \(r\) such that \(a = bq + r\) and \(d(r) < d(b)\) or \(r = 0\)
For all nonzero \(a\) and \(b\) in \(D\), \(d(a) \leq d(ab)\).
Field-by-field Comparison
Field
Before
After
Front
What's the definition of an Euclidean domain?
Back
<div>A euclidean domain is an integral domain \(D\) together with a degree function \(d: D \setminus {0} \rightarrow \mathbb{N}\) such that:</div><ul><li>For every \(a\) and \(b \neq 0\) in \(D\) there exist \(q\) and \(r\) such that \(a = bq + r\) and \(d(r) < d(b)\) or \(r = 0\)</li><li>For all nonzero \(a\) and \(b\) in \(D\), \(d(a) \leq d(ab)\).</li></ul>
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>
<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>
A prominent example for an uncomputable function is the Halting problem.
Given as input a program (encoded as a bit-string or natural number) together with an input (to the program), determine whether the program will eventually stop (function value 1) or loop forever (function value 0) on that input.
This function is uncomputable. If a halting-decider existed, one could build a program that uses it to do the opposite of what the decider predicts about itself, creating a contradiction: it halts if the halting program returns 0, and does not halt if it returns 1.
This is usually stated as: The Halting problem is undecidable.
Field-by-field Comparison
Field
Before
After
Text
A prominent example for an uncomputable function is {{c1::the <i>Halting problem</i>}}<i>.</i>
Extra
Given as input a program (encoded as a bit-string or natural number) together with an input (to the program), determine whether the program will eventually stop (function value 1) or loop forever (function value 0) on that input. <br><br>This function is uncomputable. If a halting-decider existed, one could build a program that uses it to do the <i>opposite</i> of what the decider predicts about itself, creating a contradiction: it halts if the halting program returns 0, and does not halt if it returns 1.<br><br>This is usually stated as: The Halting problem is undecidable.
We can transform every formula into:<br><ul><li>{{c1::P<b>renex</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 elements coprime to the group order.
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 elements coprime to the group order.
You can divide, because 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, because in a field the multiplicative monoid is also a <em>group</em> (without \(0\), thus \(0\) cannot be divided by - no inverse).</p>
What are the three properties of a partial order relation?
Reflexivity
Antisymmetry
Transitivity
Field-by-field Comparison
Field
Before
After
Text
What are the three properties of a partial order relation?<br><ol><li>{{c1:: <b>Reflexivity</b>}}</li><li>{{c2:: <b>Antisymmetry</b>}}</li><li>{{c3:: <b>Transitivity</b>}}</li></ol>
A relation \(\rho\) on a set A is called irreflexive if \(a \ \not \rho \ a\) for all a ∈ A, i.e., if \(\rho \ \cap \ \text{id} = \emptyset\).
Not that this is not the negation of reflexive!
Field-by-field Comparison
Field
Before
After
Front
Definition of irreflexive
Back
A relation \(\rho\) on a set A is called <b>irreflexive</b> if \(a \ \not \rho \ a\) for all a ∈ A, i.e., if \(\rho \ \cap \ \text{id} = \emptyset\).<br><br>Not that this is not the negation of reflexive!
Euler's totient function \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}
Euler's totient 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
{{c1::Euler's totient function::Name?}} \(\varphi: \mathbb{Z}^+ \rightarrow \mathbb{Z}^+\) is defined as {{c2::the cardinality of \(\mathbb{Z}_m^*\): \[\varphi(m) = |\mathbb{Z}_m^*|\]}}
Give the formal definition of the least common multiple \(\text{lcm}(a, b)\).
\[a \mid l \land b \mid l \land \forall m \ ((a \mid m \land b \mid m) \rightarrow l \mid 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 \mid l \land b \mid l \land \forall m \ ((a \mid m \land b \mid m) \rightarrow l \mid 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 of \(\deg d - 1\) has \(d\) coefficients (from \(0, \dots, d - 1\)), 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 of \(\deg d - 1\) has \(d\) coefficients (from \(0, \dots, d - 1\)), 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 never appear in the same predicate
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 never appear in the same predicate}}</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)\).
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\)}}. <br><br>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><ol><li>{{c2::reflexive}}</li><li>{{c3::antisymmetric}}</li><li>{{c4::transitive}}</li></ol></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 more useful than \(\mathbb{Z}_m\), because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), which we would need for RSA}}.
\(\mathbb{Z}_m^*\) is more useful than \(\mathbb{Z}_m\), because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), which we would need for RSA}}.
Not all elements in \(\mathbb{Z}_m\) have an inverse, something which \(\mathbb{Z}_m^*\) on the other hand guarantees via Bézout.
Field-by-field Comparison
Field
Before
After
Text
\(\mathbb{Z}_m^*\) is more useful than \(\mathbb{Z}_m\), because {{c1::\(\mathbb{Z}_m\)is not a group with respect to multiplication modulo \(m\), which we would need for RSA}}.
Extra
Not all elements in \(\mathbb{Z}_m\) have an inverse, something which \(\mathbb{Z}_m^*\) on the other hand guarantees via Bézout.
All \(a \in \mathbb{Z}_n\) such that \(\gcd(a, n) = 1\).<br><div><ul><li>
<div>If \(\gcd(a,n) = d > 1\), then all multiples of a are divisible by d, so you only hit every d-th residue mod n.</div>
</li><li>
<div>If \(\gcd(a,n) = 1\), then multiples of a eventually hit <b>every</b> residue class mod n.</div></li></ul></div>
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). As we can write every formula in CNF (or DNF) this prooves it.
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 <b>CNF</b> (or DNF) then NANDs (by simply replacing). As we can write every formula in CNF (or DNF) this prooves it.
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>.
NO! Antisymmetry is NOT the negation of symmetry. They are independent properties.
A relation is both symmetric and antisymmetric if and only if it's a subset of the identity relation (i.e., \(R \subseteq \{(a, a) : a \in A\}\)). This includes the empty relation \(R = \emptyset\) as a degenerate case.
Field-by-field Comparison
Field
Before
After
Front
Is antisymmetric the negation of symmetric?
Back
<strong>NO!</strong> Antisymmetry is NOT the negation of symmetry. They are independent properties.<br><br>A relation is both symmetric and antisymmetric if and only if it's a subset of the identity relation (i.e., \(R \subseteq \{(a, a) : a \in A\}\)). This includes the empty relation \(R = \emptyset\) as a degenerate case.
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
The Diffie-Hellman Key-Agreement 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\) invertible 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>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><p><strong>Counterexample</strong>: The identity matrix \(I_3\) is the unique neutral element for the group of \(3 \times 3\) <i>invertible</i> 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 (b/c \(k\) coefficients = degree \(k-1\) due to the constant part of the polynomial). Two codewords cannot agree at \(k\) positions (else they'd be equal), i.e. they agree at most at \(k-1\) positions, 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 (b/c \(k\) coefficients = degree \(k-1\) due to the constant part of the polynomial). Two codewords cannot agree at \(k\) positions (else they'd be equal), i.e. they agree at most at \(k-1\) positions, 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.
Why: to construct an extension field, use \(\mathbb{Z}_p\) for coefficients. To be a field, \(p\) must be prime. In a polynomial with degree \(k-1\), each coefficient can take any of the \(p\) values from the coefficient field.
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><p><br></p><p><b>Why:</b> to construct an extension field, use \(\mathbb{Z}_p\) for coefficients. To be a field, \(p\) must be prime. In a polynomial with degree \(k-1\), each coefficient can take any of the \(p\) values from the coefficient field.</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)
Explain the mechanical analog of the Diffie-Hellman protocol.
A padlock without a key.
Alice and Bob can exchange their locks (closed) and keep a copy in the open state. Then they can both generate the same configuration, namely the two locks interlocked. For the adversary, this is impossible without breaking open one of the locks.
Field-by-field Comparison
Field
Before
After
Front
Explain the mechanical analog of the Diffie-Hellman protocol.
Back
A padlock without a key.<br><br>Alice and Bob can exchange their locks (closed) and keep a copy in the open state. Then they can both generate the same configuration, namely the two locks interlocked. For the adversary, this is impossible without breaking open one of the locks.<br><br><img src="paste-39931b24c512906843c903f461b7c1cc9f5a6685.jpg">
No, \(\langle S; * \rangle\) can have at most one neutral element.
There can be a distinct left and right neutral though. Example: \(3 \times 4\) matrices
Field-by-field Comparison
Field
Before
After
Front
<p>Can there be more than one neutral element?</p>
Back
No, \(\langle S; * \rangle\) can have <strong>at most one neutral element</strong>.<br><br>There can be a distinct left and right neutral though. <br>Example: \(3 \times 4\) matrices
For Diffie-Hellman key agreement, 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 \(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 Diffie-Hellman key agreement, 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 \(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 Diffie-Hellman key agreement, both Alice and Bob {{c1:: choose \(x_A, x_B\) (their private keys) at random}}.<br><br>They then compute {{c2:: \(y_A := R_p(g^{x_A})\) and \(y_B\) analogously, which are their public keys}} which is {{c2:: sent over the network to their partner}}.<br><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>0\) 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>0\) 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>0\) 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 does the Hasse diagram of a poset \((A; \preceq)\) look like?
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 does the Hasse diagram of a poset \((A; \preceq)\) look like?
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\).<br><br><img src="paste-f73994d226c864f7b27dfb8150666efd3d3b8bf6.jpg">
What two properties must a relation \(f: A \to B\) have to be a function?
Total-definedness: \(\forall a \in A \ \exists b \in B : a \ f \ b\)
Well-definedness: \(\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><ol><li>{{c1:: <strong>Total-definedness</strong>: \(\forall a \in A \ \exists b \in B : a \ f \ b\) }}</li><li>{{c2:: <strong>Well-definedness</strong>: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)}}</li></ol>
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, includes neutral element, inverses exist).
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, includes neutral element, 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, includes neutral element, <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 coprime, 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 coprime, GF(q) is <b>not</b> Z_q.</i></p>
no variable occurs both as a bound and as a free variable
all quantifiers use distinct variable names
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><b> quantifiers</b> use distinct variable names}}</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\).
Every proper finite extension field of \(\mathbb{R}\) is 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>Every proper finite extension field of \(\mathbb{R}\) is 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 \mid 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\)\(\implies c_1 = c_2\).
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 \mid 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\)\(\implies c_1 = c_2\).</p>
How does the GCD change when we subtract a multiple? (Lemma 4.2)
Not at all.
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
Not at all.<br><br>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>
Verify that \(\equiv_m\) is reflexive, symmetric, and transitive.
Reflexive: \(a \equiv_m a\) since \(m \mid (a - a) = 0\) ✓
Symmetric: \(a \equiv_m b \Rightarrow m \mid (a-b) \Rightarrow m \mid (b-a) \Rightarrow b \equiv_m a\) ✓
Transitive: If \(m \mid (a-b)\) and \(m \mid (b-c)\), then \(m \mid (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 \mid (a - a) = 0\) ✓}}</li><li><strong>Symmetric</strong>: {{c2:: \(a \equiv_m b \Rightarrow m \mid (a-b) \Rightarrow m \mid (b-a) \Rightarrow b \equiv_m a\) ✓}}</li><li><strong>Transitive</strong>: {{c3:: If \(m \mid (a-b)\) and \(m \mid (b-c)\), then \(m \mid (a-b+b-c) = (a-c)\) ✓}}</li></ul>
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
After they have no roots anymore, try all monic polynomials up to degree d/2 to find irreducible factors.
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>After they have no roots anymore, try all monic polynomials up to degree d/2 to find irreducible factors.</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>
\(a \in A\) is the least (greatest) element of \(A\) if \(a \preceq b\) (\(a \succeq b) \) for all \(b \in A\)
Note that a least or a greatest element need not exist. However, there can be at most one least element, as suggested by the word “the” in the definition.
This follows directly from the antisymmetry of \(\preceq\). If there were two least elements, they would be mutually comparable, and hence must be equal.
Field-by-field Comparison
Field
Before
After
Text
Consider the poset \((A; \preceq)\).<br><br><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>
Extra
Note that a least or a greatest element need not exist. However, there can be at most one least element, as suggested by the word “the” in the definition. <br><br>This follows directly from the antisymmetry of \(\preceq\). If there were two least elements, they would be mutually comparable, and hence must be equal.
Thus, it's both an equivalence and a partial order relation!
Field-by-field Comparison
Field
Before
After
Front
What properties does the relation \(=\) satisfy?
Back
<ul><li>Reflexivity</li><li>Symmetry</li><li>Antisymmetry</li><li>Transitivity</li></ul><div>Thus, it's both an <b>equivalence and a partial order relation!</b></div>
An <b>abelian group</b> has the following properties:<br><ol><li>{{c1::Closure}}</li><li>{{c2::Associativity}}</li><li>{{c3::Identity}}</li><li>{{c4::Inverse}}</li><li>{{c5::Commutativity}}</li></ol>
Consider the poset \((A; \preceq)\) and \( 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\).
Consider the poset \((A; \preceq)\) and \( 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
Consider the poset \((A; \preceq)\) and \( S \subseteq A\).<br><br><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 F and G are equivalent, i.e., their truth values are equal for all truth assignments to the propositional symbols appearing in \(F\) or \(G\).
\(F \equiv G\) means F and G are equivalent, 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::F and G are equivalent}}, 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\) (and \(x*a = b\)) has a unique solution \(x\) for any \(a\) and \(b\).
Field-by-field Comparison
Field
Before
After
Text
In a group, the equation \(a * x = b\) (and \(x*a = b\)) has {{c1:: a unique solution \(x\)}} for any \(a\) and \(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></p><ol><li>\(\phi\) is a {{c1::homomorphism}}</li><li>\(\phi\) is a {{c2::bijection}}.</li></ol>
When is a field an integral domain? (Proof included)
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? <i>(Proof included)</i></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\) only contains {{c3::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\) only contains {{c3::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\) only contains {{c3::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>
An interface defines a set of methods that any class that implements it has to have. We use class Test implements Tester {}; to define such a relationship.
Back
ETH::1._Semester::EProg::13._Interfaces
An interface defines a set of methods that any class that implements it has to have. We use class Test implements Tester {}; to define such a relationship.
Field-by-field Comparison
Field
Before
After
Text
<div>An <code>interface</code> defines {{c1::a set of methods that any class that implements it has to have}}. We use <code>class Test implements Tester {};</code> to define such a relationship.</div>
The Arrays class has helper methods that make simple operations quicker:
Arrays.equals(a, b) to compare arrays
Arrays.copyOf(arr, l) that returns a new copied array of length l
Sorting using Arrays.sort(arr)
toString() and deepToString()
Back
ETH::1._Semester::EProg::4._Sequences
The Arrays class has helper methods that make simple operations quicker:
Arrays.equals(a, b) to compare arrays
Arrays.copyOf(arr, l) that returns a new copied array of length l
Sorting using Arrays.sort(arr)
toString() and deepToString()
Arrays.deepToString() converts a nested/multidimensional array to a readable string representation, recursively handling inner arrays.
Field-by-field Comparison
Field
Before
After
Text
The Arrays class has helper methods that make simple operations quicker:<br><ul><li>{{c1::<b>Arrays.equals(a, b)</b> to compare arrays::Compare}}<br></li><li>{{c2::<b>Arrays.copyOf(arr, l)</b> that returns a new copied array of length l::Transfer values}}</li><li>{{c3::Sorting using <b>Arrays.sort(arr)::Order</b>}}</li><li>{{c4::<b>toString()</b> and <b>deepToString()</b>::Print}}</li></ul>
Extra
Arrays.deepToString() converts a nested/multidimensional array to a readable string representation, recursively handling inner arrays.
i <= n (the equality holds as we execute + 1 after the final execution)
In general: x < n becomes x <= n and x <= n becomes x <= n + 1
Field-by-field Comparison
Field
Before
After
Front
while (i < n) {<br> result = result * k;<br> i = i + 1;<br>}<br><br>For the loop invariant, what bounds hold for i?
Back
<div><code>i <= n</code> (the equality holds as we execute <code>+ 1</code> after the final execution)<br><br><div>In general: x < n becomes x <= n and x <= n becomes x <= n + 1</div></div>
default: package scoped, only available in same package.
public: by everyone
private: only accessible from within the object itself (not shared with other instances, unlike static)
static: no initialisation needed, can be accessed through Math.PI
final: prevents overwriting, like const
protected: only by this class and subclasses
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
Attribute access modifiers:
default: package scoped, only available in same package.
public: by everyone
private: only accessible from within the object itself (not shared with other instances, unlike static)
static: no initialisation needed, can be accessed through Math.PI
final: prevents overwriting, like const
protected: only by this class and subclasses
Field-by-field Comparison
Field
Before
After
Text
Attribute access modifiers:<br><ul><li>default: {{c1:: package scoped, only available in same package.}}</li><li>public: {{c2:: by everyone}}</li><li>private: {{c3:: only accessible from within the object itself (not shared with other instances, unlike static)}}</li><li>static: {{c4:: no initialisation needed, can be accessed through <b>Math.PI</b>}}<br></li><li>final: {{c5:: prevents overwriting, like const}}</li><li>protected: {{c6:: only by this class and subclasses}}</li></ul>
Private attributes are accessible by all objects of this class.
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
Private attributes are accessible by all objects of this class.
public class Rational {
private int x;
// Copy constructor
public Rational(Rational other) {
this.x = other.x; // We CAN access another objects private attributes
}
}
Field-by-field Comparison
Field
Before
After
Text
Private attributes are accessible by {{c1:: all objects of this class}}.
Extra
<pre><code>public class Rational {
private int x;
// Copy constructor
public Rational(Rational other) {
this.x = other.x; // We CAN access another objects private attributes
}
}
</code></pre>
Note that a class canimplement multiple interfaces.
If a method is defined in multiple of those interfaces, it of course has to be implemented only once.
Back
ETH::1._Semester::EProg::13._Interfaces
Note that a class canimplement multiple interfaces.
If a method is defined in multiple of those interfaces, it of course has to be implemented only once.
Field-by-field Comparison
Field
Before
After
Text
<div>Note that a class can<b> </b>{{c1::<b>implement multiple interfaces</b>}}.</div><div>If a method is defined in {{c1::multiple of those interfaces}}, it {{c1::of course has to be implemented only once}}.</div>
When a function is called in dynamic dispatch, the attributes of the type in which the actual function is executed will be used.
class T {
int data = 50;
public void s2() { System.out.println("T " + data); }
}
class S extends T {
int data = 100;
public void s2() { System.out.println(this.data); }
}
class R extends S {
int data = 200;
}
T r = new R();
r.s2(); // Prints "100"
Field-by-field Comparison
Field
Before
After
Text
When a function is called in dynamic dispatch, the attributes of {{c1::the type in which the actual function is executed}} will be used.
Extra
<code>
class T {
<br> int data = 50;
<br> public void s2() { <br> System.out.println("T " + data); <br> }
<br>}
<br><br>class S extends T {
<br> int data = 100;
<br> public void s2() { System.out.println(this.data); <br> }
<br>}
<br><br>class R extends S {
<br> int data = 200;
<br>}
<br><br>T r = new R();
<br>r.s2(); // Prints "100"
</code>
In a dynamic dispatch, the "this"-keyword still refers to the dynamic type, thus even if the method is in a superclass, it will always try to use the "most overriden" method.
In a dynamic dispatch, the "this"-keyword still refers to the dynamic type, thus even if the method is in a superclass, it will always try to use the "most overriden" method.
Field-by-field Comparison
Field
Before
After
Text
In a dynamic dispatch, the "this"-keyword still refers to the dynamic type, thus {{c1:: even if the method is in a superclass, it will always try to use the "most overriden" method}}.
Java double can be initialised with <br><ul><li>{{c1:: <b>32.300</b> "." seperated numbers}}</li><li>{{c2:: <b>1e-2</b> exponentials}}</li></ul>
class A {
public int x = 5;
}
class B extends A {
public int y = 6;
public int test() { return 0; }
public B(int i) { super(); }
}
A a1 = new B(1);
a1.y; // leads to a compile error, as A doesn't have x a1.test(); // leads to a compile error, as A doesn't have test()
Field-by-field Comparison
Field
Before
After
Text
<pre><code>class A {
public int x = 5;
}
class B extends A {
public int y = 6;
public int test() { return 0; }</code></pre><pre><code><div> public B(int i) {<br> super();<br> }</div></code></pre><pre><span style="font-family: "Liberation Sans";">}</span><br></pre><code>
A a1 = new B(1);
<br>a1.y; // {{c1:: leads to a compile error, as A doesn't have x}}
<br>a1.test(); // </code>{{c2:: leads to a compile error, as A doesn't have test()}}
Instance of returns true if:<br><ul><li>{{c1::Implements the interface}}</li><li>{{c2::Is of the same dynamic type}}</li><li>{{c3::Is a subtype of the dynamic type}}</li></ul>
class A { public int x = 5; public void fct1() { System.out.println(this.x); } }
class B extends A { public B() { super.x = 10; } public B(int a) { super.x = a; } }
A a1 = new B(1);
A a2 = new B(12); // As these are different instances, their attributes are separate
B b1 = new B(1);
B b2 = new B(12);
a1.fct1(); // 1 -> Even though static type is A a2.fct1(); // 12 -> Different output as a2's instance of A has 12 b1.fct1(); // 1 -> same here, even though it dynamic dispatches b2.fct1(); // 12
class A { public int x = 5; public void fct1() { System.out.println(this.x); } }
class B extends A { public B() { super.x = 10; } public B(int a) { super.x = a; } }
A a1 = new B(1);
A a2 = new B(12); // As these are different instances, their attributes are separate
B b1 = new B(1);
B b2 = new B(12);
a1.fct1(); // 1 -> Even though static type is A a2.fct1(); // 12 -> Different output as a2's instance of A has 12 b1.fct1(); // 1 -> same here, even though it dynamic dispatches b2.fct1(); // 12
Field-by-field Comparison
Field
Before
After
Text
<code>class A { <br> public int x = 5; <br> public void fct1() { <br> System.out.println(this.x); <br> } <br>} <br><br>class B extends A { <br> public B() { <br> super.x = 10; <br> } <br> public B(int a) { <br> super.x = a; <br> } <br>}
<br><br>A a1 = new B(1);
<br>A a2 = new B(12); // As these are different instances, their attributes are separate
<br>B b1 = new B(1);
<br>B b2 = new B(12);
<br>a1.fct1(); // {{c1::1 -> Even though static type is A}}
<br>a2.fct1(); // {{c1:: 12 -> Different output as a2's instance of A has 12}}
<br>b1.fct1(); // {{c1::1 -> same here, even though it dynamic dispatches}}
<br>b2.fct1(); // {{c1::12}}
</code>
public class Lorenz extends Students {
@Override
public void someMethod() {
...
super.someMethod(); // Can call super's implementation of this
}
}
Field-by-field Comparison
Field
Before
After
Front
How do we implement a subtype in Java?
Back
<code>public class Lorenz extends Students {
<br> @Override
public void someMethod() {
...
<br> super.someMethod(); // Can call super's implementation of this
<br> }
<br>}
</code>
How could someone modify a private variable (aliasing)?
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
How could someone modify a private variable (aliasing)?
public class AliasingProblem { private Point center; // Problematic - exposes internal reference public Point getCenter() { return center; // Returns alias to internal object }
}
main() {
Point center = new AliasingProblem().getCenter();
center.setX(2); // Changes private attribute!!
}
If we get a reference to a private object, we can indeed change it's values!
Field-by-field Comparison
Field
Before
After
Front
How could someone modify a private variable (aliasing)?
Back
<code>public class AliasingProblem { <br> private Point center; // Problematic - exposes internal reference <br> public Point getCenter() { <br> return center; // Returns alias to internal object <br> }
<br>}
<br><br>main() {
<br> Point center = new AliasingProblem().getCenter();
<br> center.setX(2); // Changes private attribute!!
<br>}</code>
<br><br>If we get a reference to a private object, we can indeed change it's values!
In a subclass, we can access the parent's methods and attributes using super.
Back
ETH::1._Semester::EProg::10._Inheritance
In a subclass, we can access the parent's methods and attributes using super.
You cannot use super.super.xxx, nor x.super.xxx to access super methods or attributes. This gives a compile error.
Field-by-field Comparison
Field
Before
After
Text
In a subclass, we can access the parent's methods and attributes using {{c1:: super}}.
Extra
<div>You cannot use <code>super.super.xxx</code>, nor <code>x.super.xxx</code> to access super methods or attributes. This gives a <strong>compile</strong> error.</div>
The cases where instanceof causes a compile error:
Primitives - instanceof only works with reference types
Generics - type erasure means List<String> becomes just List at runtime, so the check is impossible t instanceof List<String>
Unrelated types:
Animal -> Dog and Animal -> Cat. Check for animal instanceof Dog/Cat allowed, but dog = new Dog(); dog instanceof Cat throws compile error.
Final class - if a class is final and doesn't implement an interface, no subclass could ever implement it, so the check is provably always false.
However: Animal a = getanimal() could get a Dog which might implement List thus a instanceof List is not a compile error.
Field-by-field Comparison
Field
Before
After
Text
The cases where instanceof causes a compile error:<br><ol><li>{{c1::<b>Primitives - instanceof only works with reference types</b>}}</li><li>{{c2::Generics - type erasure means List<String> becomes just List at runtime, so the check is impossible<br><code> t instanceof List<String></code>}} </li><li>{{c3::Unrelated types:<br><div><code> Animal -> Dog</code> and <code>Animal -> Cat</code>. <br> Check for <code>animal instanceof Dog/Cat</code> allowed, but <code>dog = new Dog(); dog instanceof Cat</code> throws compile error.</div>}}</li><li><div>{{c4::Final class - if a class is final and doesn't implement an interface, no subclass could ever implement it, so the check is provably always false.}}</div></li></ol>
Extra
However:<br><code>Animal a = getanimal()</code> could get a <code>Dog</code> which might <code>implement List</code> thus <code>a instanceof List</code> is not a compile error.
<div><code>Animal cat = null; </code></div><div><code>(Cat) cat;</code> </div><div>Leads to a {{c1:: no error, this is always allowed}}.</div>
Every primitive variable must be both declared and initialized before being used.
This is only true for local variables! Instance variables can be left uninitialised.
Field-by-field Comparison
Field
Before
After
Text
Every primitive variable must be {{c1:: both declared and initialized}} before being used.
Extra
This is only true for <b>local</b> variables! Instance variables can be left uninitialised.<br><br><img src="paste-a119684222f3e74cbbcfa0830461d164b54afb9a.jpg">
Trying to access a method or attribute on a class with a different dynamic than static type leads to a compile error if the static type doesn't define that attribute or method.
Trying to access a method or attribute on a class with a different dynamic than static type leads to a compile error if the static type doesn't define that attribute or method.
Field-by-field Comparison
Field
Before
After
Text
Trying to access a method or attribute on a class with a different dynamic than static type leads to a compile error if {{c1:: the static type doesn't define that attribute or method}}.
(Husky) dog; Casting further down than dynamic type
(Cat) dog; Casting into sibling type
Field-by-field Comparison
Field
Before
After
Text
Runtime Errors for Casting:<br><ol>
<li><code>{{c1::(Husky) dog; </code>Casting further down than dynamic type}}</li>
<li><code>{{c2:: (Cat) dog;</code> Casting into sibling type}}</li></ol>
In a subclass, we can only make methods more visible .
protected -> public is okay
private -> public okay
public to default or default to private are not possible.
Field-by-field Comparison
Field
Before
After
Text
In a subclass, we can only make methods {{c1:: more visible :: access modifiers}}.
Extra
<ul><li>protected -> public is okay</li><li>private -> public okay</li></ul><div>public to default or default to private are not possible.</div>
(a / b) * b + (a % b) = a (with a / b being division with rest)
In general, if the a is negative, the result is negative.
Field-by-field Comparison
Field
Before
After
Front
How is a % b defined in Java?
Back
<div>(a / b) * b + (a % b) = a (with a / b being division with rest)</div><div><br></div><div><div><b>In general, if the a is negative, the result is negative.</b></div></div>
We cannot override attributes inside a subclass, they are shadowed.
class Animal {
String name = "Animal";
String getName() { return "Animal"; }
}
class Dog extends Animal {
String name = "Dog"; // Shadows Animal.name (doesn't override it) @Override
String getName() { return Dog"; } // Overrides Animal.getName() }
Animal a = new Dog();
System.out.println(a.name); // "Animal" — field access uses static type System.out.println(a.getName()); // "Dog" — method call uses dynamic type
Field-by-field Comparison
Field
Before
After
Text
We cannot override {{c1::attributes inside a subclass}}, they are {{c1::shadowed}}.
void test(Integer k) { k = Integer.valueOf(1); This only changes it locally! (Shadowing) // k.value = 1; This changes the value for the caller as well }
Back
ETH::1._Semester::EProg::99._Shadowing
What is the result of:
void test(Integer k) { k = Integer.valueOf(1); This only changes it locally! (Shadowing) // k.value = 1; This changes the value for the caller as well }
Field-by-field Comparison
Field
Before
After
Text
What is the result of:<br><br><b>void test(Integer k) {</b><br> <b>k = Integer.valueOf(1); </b>{{c1:: This only changes it locally! (Shadowing)}}<br>//<br> <b>k.value = 1; </b>{{c1:: This changes the value for the caller as well}}<br><b>}</b>
go from string to enum using Status.valueOf("PAID")
Ordering using order in declaration Status.SUBMITTED < Status.PAID
Field-by-field Comparison
Field
Before
After
Text
Enums have some convenient features:<br><ul><li>{{c1::can compare using <code>==::compare}}</code></li>
<li>{{c2::use <code>.name()</code> to get string representation::string}}</li>
<li>{{c3::go from string to enum using <code>Status.valueOf("PAID")::string conversion}}</code></li>
<li>{{c4:: Ordering using order in declaration <code>Status.SUBMITTED < Status.PAID::order</code>}}</li></ul>
class T {
int data = 50;
public void s2() { System.out.println("T " + data); }
}
class S extends T {
int data = 100;
public void s2() { System.out.println(this.data); }
}
class R extends S {
int data = 200;
}
T r = new R();
r.s2(); // Prints "100"
Field-by-field Comparison
Field
Before
After
Text
<code>class T {
<br> int data = 50;
<br> public void s2() { <br> System.out.println("T " + data); <br> }
<br>}
<br><br>class S extends T {
<br> int data = 100;
<br> public void s2() { <br> System.out.println(this.data); <br> }
<br>}
<br><br>class R extends S {
<br> int data = 200;
<br>}
<br><br>T r = new R();
<br>r.s2(); // Prints {{c1::"100"}}
</code>
String s = (String) new Integer(5); Casting between unrelated classes
Animal a2 = new Cat();
Dog d2 = (Dog) a2; ClassCastException!
Field-by-field Comparison
Field
Before
After
Text
Possible casting problems:<br><ul><li>{{c1::String s = (String) new Integer(5); Casting between unrelated classes }}</li><li>{{c2::Animal a2 = new Cat();
Dog d2 = (Dog) a2; ClassCastException!}}</li></ul>
Shadowing is when an inner scope variable makes an outer scope one inaccessible.
Back
ETH::1._Semester::EProg::7._Classes_and_Objects
Shadowing is when an inner scope variable makes an outer scope one inaccessible.
public class Person { private String name; // instance variable
public void setName(String name) { // parameter shadows instance variable this.name = name; // use 'this' to access the instance variable } }
Field-by-field Comparison
Field
Before
After
Text
Shadowing is when an {{c1:: inner scope variable makes an outer scope one inaccessible}}.
Extra
public class Person {<br> private String name; // instance variable<br><br> public void setName(String name) { // parameter shadows instance variable<br> this.name = name; // use 'this' to access the instance variable<br> }<br>}
If we override an attribute inherited from the parentclass, it will override the parents attribute.
class A { public int x = 5; public void fct1() { System.out.println(this.x); } }
class B extends A { public B() { super.x = 10; } public B(int a) { super.x = a; } }
A a1 = new B(1);
A a2 = new B(12); // As these are different instances, their attributes are separate
B b1 = new B(1);
B b2 = new B(12);
a1.fct1(); // 1 -> Even though static type is A
a2.fct1(); // 12 -> Different output as a2's instance of A has 12
b1.fct1(); // 1 -> same here, even though it dynamic dispatches
b2.fct1(); // 12
Field-by-field Comparison
Field
Before
After
Text
If we override an attribute inherited from the parentclass, it will {{c1::override}} the parents attribute.
Extra
<code>class A { <br> public int x = 5; <br> public void fct1() { <br> System.out.println(this.x); <br> } <br>} <br><br>class B extends A { <br> public B() { <br> super.x = 10; <br> } <br> public B(int a) { <br> super.x = a; <br> } <br>}
<br><br>A a1 = new B(1);
<br>A a2 = new B(12); // As these are different instances, their attributes are separate
<br>B b1 = new B(1);
<br>B b2 = new B(12);
<br><br>a1.fct1(); // 1 -> Even though static type is A
<br>a2.fct1(); // 12 -> Different output as a2's instance of A has 12
<br>b1.fct1(); // 1 -> same here, even though it dynamic dispatches
<br>b2.fct1(); // 12
</code>
All methods are public (doesn’t have to be explicit).
Any attributes must be public and final.
Back
ETH::1._Semester::EProg::13._Interfaces
In an interface:
All methods are public (doesn’t have to be explicit).
Any attributes must be public and final.
Field-by-field Comparison
Field
Before
After
Text
<div>In an i<b>nterface:</b> </div><div><ul><li>All methods are {{c1::public (doesn’t have to be explicit).}}</li><li>Any attributes {{c2::<b>must be public and final</b>.}}</li></ul></div>
\(P \land \lnot a \implies Q\) when S2; is executed.
Dann kann man mit einem || beide Fälle in der Precondition verbinden: a && precondition1 OR !a && precondition2
Field-by-field Comparison
Field
Before
After
Front
<pre><code>// {P}
if (a) {
S1;
} else {
S2;
}
// {Q}</code>
</pre>How can the precondition be found?
Back
Man muss zwei Fälle checken:<br><ul><li>\(P \land a \implies Q\) when S1; is executed.</li><li>\(P \land \lnot a \implies Q\) when S2; is executed. </li></ul>Dann kann man mit einem <b>||</b> beide Fälle in der Precondition verbinden: <code>a && precondition1</code> OR <code>!a && precondition2</code>
If P_1impliesP_2 then we can say that P_1 is a stronger precondition than P_2.
Back
ETH::1._Semester::EProg::5._Logisches_Schliessen
If P_1impliesP_2 then we can say that P_1 is a stronger precondition than P_2.
Field-by-field Comparison
Field
Before
After
Text
<div>If <code>P_1</code> {{c1::implies}} <code>P_2</code> then we can say that <code>P_1</code> is {{c2::a stronger precondition}} than <code>P_2</code>.</div>
Java has short circuiting for the && and || operators.
This means that if the left of
&& is false then the right isn't even executed
|| is true then the right isn't even executed
Keep this in mind if there's a runtime error on the right.
Field-by-field Comparison
Field
Before
After
Text
Java has short circuiting for the && and || operators.<br><br><div>This means that if the left of </div><div><ul><li><b>{{c1:: &&</b> is <b>false}}</b> then the right isn't even executed<br></li><li><b>{{c2:: ||</b> is <b>true}}</b> then the right isn't even executed<br></li></ul><div>Keep this in mind if there's a <b>runtime</b> error on the right.</div></div>
All implementations of an interface using implements must instantiate all methods declared by the interface , otherwise we get a compiler error.
Back
ETH::1._Semester::EProg::13._Interfaces
All implementations of an interface using implements must instantiate all methods declared by the interface , otherwise we get a compiler error.
(except if the class is abstract, then we don't have to implement them)
Field-by-field Comparison
Field
Before
After
Text
<div>All implementations of an interface using <code>implements</code> must instantiate {{c1::<strong>all</strong> methods}} declared by the interface , otherwise we get {{c1::a <strong>compiler error}}</strong>.</div>
Extra
(except if the class is abstract, then we don't have to implement them)
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}}.
What methods cannot be overriden in a subclass:<br><ul><li><code>{{c1::static}}</code></li>
<li><code>{{c2::final}}</code></li>
<li><code>{{c3::private</code> are not inherited either}}</li>
<li><code>{{c4::constructors}}</code></li></ul>
Given \(A \in \mathbb{R}^{n \times n}\) we say \(\lambda \in \mathbb{C}\) is an eigenvalue of \(A\) and \(v \in \mathbb{C}^{n} \setminus \{0\}\) is an eigenvector of \(A\) associated with the eigenvalue \(\lambda\) when the following holds: \[ Av = \lambda v \]
Given \(A \in \mathbb{R}^{n \times n}\) we say \(\lambda \in \mathbb{C}\) is an eigenvalue of \(A\) and \(v \in \mathbb{C}^{n} \setminus \{0\}\) is an eigenvector of \(A\) associated with the eigenvalue \(\lambda\) when the following holds: \[ Av = \lambda v \]
Field-by-field Comparison
Field
Before
After
Text
Given \(A \in \mathbb{R}^{n \times n}\) we say \(\lambda \in \mathbb{C}\) is an {{c2::<b>eigenvalue</b>}} of \(A\) and \(v \in \mathbb{C}^{n} \setminus \{0\}\) is an {{c2::<b>eigenvector</b> of \(A\) associated with the eigenvalue \(\lambda\)}} when the following holds: \[{{c1:: Av = \lambda v }}\]
The matrix \(A^k\) has EW-EV pair \(\lambda^k\) and \(v\) if \(A\) has \(\lambda, v\) as an EW-EV pair.
Intuitively, \(A\) on \(v\) scales it by \(\lambda\). Then scaling that already scaled \(\lambda v\) by \(A\) again gives us \(\lambda^2 v\), etc...
Field-by-field Comparison
Field
Before
After
Text
The matrix \(A^k\) has EW-EV pair {{c1::\(\lambda^k\) and \(v\)}} if \(A\) has \(\lambda, v\) as an EW-EV pair.
Extra
<i>Intuitively</i>, \(A\) on \(v\) scales it by \(\lambda\). Then scaling that already scaled \(\lambda v\) by \(A\) again gives us \(\lambda^2 v\), etc...
Why is \(R\) upper triangular in the QR decomposition?
\(R\) is upper triangular because each \(q_k\) is orthogonal to every \(a_i\) for \(i < k\) (all after it), thus they are \(0\). You can see here, since \(q_2, \dots, q_m\) are by construction orthogonal to \(q_1\) thus \(a_1\), all entries below \(1\) in the first column are \(0\). The same goes for all entries below \(2\) in the second column.
Field-by-field Comparison
Field
Before
After
Front
Why is \(R\) upper triangular in the QR decomposition?
Back
\(R\) is upper triangular because each \(q_k\) is orthogonal to every \(a_i\) for \(i < k\) (all after it), thus they are \(0\).<br><img src="paste-b807a5bb84b633acb85aab843fa9b2ac8f0e5cdf.jpg"><br>You can see here, since \(q_2, \dots, q_m\) are by construction orthogonal to \(q_1\) thus \(a_1\), all entries below \(1\) in the first column are \(0\). The same goes for all entries below \(2\) in the second column.
Let \(A\) be an invertible matrix. If \(\lambda\) and \(v\) are an EW-EV pair, then {{c1:: \(\frac{1}{\lambda}\) and \(v\)}} are an EW-EV pair of the matrix \(A^{-1}\). Proof Included
Let \(A\) be an invertible matrix. If \(\lambda\) and \(v\) are an EW-EV pair, then {{c1:: \(\frac{1}{\lambda}\) and \(v\)}} are an EW-EV pair of the matrix \(A^{-1}\). Proof Included
Proof: We have \(Av = \lambda v\) thus \(A^{-1}Av = \lambda A^{-1}v\) thus \(\frac{1}{\lambda} v = \frac{1}{\lambda} \lambda A^{-1}v\) and we get \(A^{-1}v = \frac{1}{\lambda} v\).
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an invertible matrix. If \(\lambda\) and \(v\) are an EW-EV pair, then {{c1:: \(\frac{1}{\lambda}\) and \(v\)}} are an EW-EV pair of the matrix \(A^{-1}\). <i>Proof Included</i>
Extra
<div><b>Proof:</b> We have \(Av = \lambda v\) thus \(A^{-1}Av = \lambda A^{-1}v\) thus \(\frac{1}{\lambda} v = \frac{1}{\lambda} \lambda A^{-1}v\) and we get \(A^{-1}v = \frac{1}{\lambda} v\).</div>
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)
The independent columns in the RREF form of matrix \(A\) are a basis of the column space and in particular: \(\dim(\textbf{C}(A)) = \textbf{rank}(A) = r\)
Field-by-field Comparison
Field
Before
After
Front
How do we compute a basis for \(C(A)\)?
Back
The independent columns in the RREF form of matrix \(A\) are a basis of the column space and in particular: \(\dim(\textbf{C}(A)) = \textbf{rank}(A) = r\)
\[ P(z) = (-1)^n \det(A - z I) = \det(z I - A) = (z - \lambda_1)(z - \lambda_2) \dots (z - \lambda_n) \]
The polynomial \(P(z)\) is called the characteristic polynomial of the matrix \(A\).
The eigenvalues \(\lambda_1, \dots, \lambda_n\) as they show up in the polynomial are not all distinct in general.
The number of times an eigenvalue shows up is called the algebraic multiplicity of the eigenvalue.
Field-by-field Comparison
Field
Before
After
Text
<div>\[ P(z) = {{c22:: (-1)^n \det(A - z I) = \det(z I - A) = (z - \lambda_1)(z - \lambda_2) \dots (z - \lambda_n) }}\]</div><div>The polynomial \(P(z)\) is called {{c1::the characteristic polynomial of the matrix \(A\)}}.</div>
Extra
<div>The eigenvalues \(\lambda_1, \dots, \lambda_n\) as they show up in the polynomial are <b>not all distinct</b> in general.</div><div><br></div><div>The number of times an eigenvalue shows up is called the <b>algebraic multiplicity</b> of the eigenvalue.</div>
Orthogonal matrices preserve the norm and inner product of vectors.
In other words, if \(Q \in \mathbb{R}^{n \times n}\) is orthogonal, then, for all \(x, y \in \mathbb{R}^n\):
\[ ||Qx|| = ||x|| \text{ and } (Qx)^\top(Qy) = x^\top y \]
Field-by-field Comparison
Field
Before
After
Text
Orthogonal matrices preserve the {{c1::norm}} and {{c1::inner product}} of vectors.
Extra
In other words, if \(Q \in \mathbb{R}^{n \times n}\) is orthogonal, then, for all \(x, y \in \mathbb{R}^n\):<br><br>\[ ||Qx|| = ||x|| \text{ and } (Qx)^\top(Qy) = x^\top y \]<br>
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive semidefinite if and only if {{c2::\(x^\top A x \geq 0\) for all \(x \in \mathbb{R}^n\)}}.
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive semidefinite if and only if {{c2::\(x^\top A x \geq 0\) for all \(x \in \mathbb{R}^n\)}}.
Field-by-field Comparison
Field
Before
After
Text
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is {{c1::positive semidefinite}} if and only if {{c2::\(x^\top A x \geq 0\) for all \(x \in \mathbb{R}^n\)}}.
What is the sign of \(\pi\), defined as \(\pi(1) = 1\), \(\pi(2) = 3\) , \(\pi(3) = 2\) , \(\pi(4) = 4\)?
We have the pairs \((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\) for \(i < j\). For all these pairs \((i, j)\), \(\pi(i) < \pi(j)\) except for \((2, 3)\) which gives \((\pi(2), \pi(3)) = (3, 2)\). Thus \(\text{sgn}(\pi) = -1\)
Field-by-field Comparison
Field
Before
After
Front
What is the sign of \(\pi\), defined as \(\pi(1) = 1\), \(\pi(2) = 3\) , \(\pi(3) = 2\) , \(\pi(4) = 4\)?
Back
We have the pairs \((1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\) for \(i < j\).<br>For all these pairs \((i, j)\), \(\pi(i) < \pi(j)\) except for \((2, 3)\) which gives \((\pi(2), \pi(3)) = (3, 2)\). <br>Thus \(\text{sgn}(\pi) = -1\)
For the <b>co-factor</b> formula for the determinant what's the pattern of signs to multiply by?
Back
\(\begin{bmatrix} + & - & + & - & + & \dots \\ - & + & - & + & - & \dots \\ + & - & + & - & + & \dots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \end{bmatrix}\)
Notation: A matrix \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) has independent columns \(j_1, j_2, \dots, j_r\) and therefore rank \(r\).
Here the \(j_1, j_2, \dots, j_r\) are the indices of the independent columns.
Example: The identity matrix is in \(\text{RREF}(1, 2, \dots, m)\).
Field-by-field Comparison
Field
Before
After
Text
<b>Notation</b>: A matrix \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) has independent columns {{c1::\(j_1, j_2, \dots, j_r\)}} and therefore rank {{c1:: \(r\)}}.
Extra
<div>Here the \(j_1, j_2, \dots, j_r\) are the indices of the independent columns. </div><div><br></div><div>Example: The identity matrix is in \(\text{RREF}(1, 2, \dots, m)\).</div>
The algebraic multiplicity of a root is the number of times it appears in the factorisation \(P(z) = a_n (z-\lambda_1)(z - \lambda_2) \dots (z - \lambda_n)\).
The algebraic multiplicity of a root is the number of times it appears in the factorisation \(P(z) = a_n (z-\lambda_1)(z - \lambda_2) \dots (z - \lambda_n)\).
Example: If the algebraic multiplicity of \(\lambda_2\) is \(3\) then \((z - \lambda_2)^3 \ | \ P(z)\).
Field-by-field Comparison
Field
Before
After
Text
The {{c1::algebraic multiplicity of a <i>root</i>}} is {{c2:: the number of times it appears in the factorisation \(P(z) = a_n (z-\lambda_1)(z - \lambda_2) \dots (z - \lambda_n)\)}}.
Extra
<div><strong>Example:</strong> If the algebraic multiplicity of \(\lambda_2\) is \(3\) then \((z - \lambda_2)^3 \ | \ P(z)\).</div>
\(A \in \mathbb{R}^{n \times n}\) needs to {{c1:: have \(n\) eigenvectors that form a basis of \(\mathbb{R}^n\)}} to be diagonalisable.
\[ A = V \Lambda V^{-1} \]where \(\Lambda\) is a diagonal matrix with \(\Lambda_{ii} = \lambda_i\) (and \(\Lambda_{ij} = 0\) for all \(i \neq j\)).
Field-by-field Comparison
Field
Before
After
Text
\(A \in \mathbb{R}^{n \times n}\) needs to {{c1:: have \(n\) eigenvectors that form a basis of \(\mathbb{R}^n\)}} to be diagonalisable.
Extra
\[ A = V \Lambda V^{-1} \]where \(\Lambda\) is a <b>diagonal</b> matrix with \(\Lambda_{ii} = \lambda_i\) (and \(\Lambda_{ij} = 0\) for all \(i \neq j\)).
Let \(T : \mathbb{R}^n \rightarrow \mathbb{R}^m\) be a linear transformation. There is a?
There is a unique \(m \times n\) matrix A such that \(T = T_A\) meaning that \(T(x) = T_A(x) = Ax\) for all \(x \in \mathbb{R}^n\).
Field-by-field Comparison
Field
Before
After
Front
Let \(T : \mathbb{R}^n \rightarrow \mathbb{R}^m\) be a linear transformation. There is a?
Back
There is a unique \(m \times n\) matrix A such that \(T = T_A\) meaning that \(T(x) = T_A(x) = Ax\) for all \(x \in \mathbb{R}^n\).
Let \(Q\) be an orthogonal matrix. If \(\lambda \in \mathbb{C}\) is an eigenvalue of \(Q\) then \(|\lambda| =\)\(1\).
The possible values for \(\lambda\) are then \(1, -1\) and all conjugate complex values with modulus \(1\) for example \(i, -i\).
This makes sense as \(Q\) orthogonal only turns and doesn't scale.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(Q\) be an orthogonal matrix. If \(\lambda \in \mathbb{C}\) is an eigenvalue of \(Q\) then \(|\lambda| =\){{c1::\(1\)}}.</div>
Extra
The possible values for \(\lambda\) are then \(1, -1\) and all conjugate complex values with modulus \(1\) for example \(i, -i\).<br><br>This makes sense as \(Q\) orthogonal only turns and doesn't scale.
The columns of \(A\) are independent if and only if \(x = 0\) is the only vector for which \(Ax = 0\).
Field-by-field Comparison
Field
Before
After
Text
The columns of \(A\) are independent if and only if {{c1::\(x = 0\) is the only vector for which \(Ax = 0\)::Linear combination view}}.
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has neither full column nor full row rank?
We have to solve both projecting and finding \(||x||^2\) with the smallest norm at once.
We decompose \(A = CR'\) where \(C\) has full column and \(R'\) full row-rank. Then \(A^\dagger = R^\dagger C^\dagger\).
Field-by-field Comparison
Field
Before
After
Front
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has neither full column nor full row rank?
Back
We have to solve both projecting and finding \(||x||^2\) with the smallest norm at once.<br><br>We decompose \(A = CR'\) where \(C\) has full column and \(R'\) full row-rank.<br>Then \(A^\dagger = R^\dagger C^\dagger\).
Let \(V\) be a finitely generated vector space. Let \(G \subseteq V\) be a finite subset of size \(|G| < \dim(V)\). Then {{c1::\(\textbf{Span}(G) \neq V\)}}.
Using this lemma we can now state that computing a vector space means finding a basis.
Let \(V\) be a finitely generated vector space. Let \(G \subseteq V\) be a finite subset of size \(|G| < \dim(V)\). Then {{c1::\(\textbf{Span}(G) \neq V\)}}.
Using this lemma we can now state that computing a vector space means finding a basis.
No smaller set of vectors can fully describe a vector space.
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a finitely generated vector space. Let \(G \subseteq V\) be a finite subset of size \(|G| < \dim(V)\). Then {{c1::\(\textbf{Span}(G) \neq V\)}}.<br><br>Using this lemma we can now state that <i>computing a vector space</i> means {{c1::finding a basis}}.
Extra
No smaller set of vectors can fully describe a vector space.
What is special about the characteristic polynomial?
The characteristic polynomial is always monic.
The polynomial \(\det(A - zI)\) has a leading \((-1)\) if the degree is odd. Therefore working with the characteristic one is easier.
Field-by-field Comparison
Field
Before
After
Front
What is special about the characteristic polynomial?
Back
The characteristic polynomial is always <b>monic</b>.<br><br>The polynomial \(\det(A - zI)\) has a leading \((-1)\) if the degree is odd. Therefore working with the characteristic one is easier.
The eigenvectors of an eigenvalue are those and exactly those vectors \(v \neq 0\) in \(v \in N(A - \lambda I)\).
Field-by-field Comparison
Field
Before
After
Text
The <b>eigenvectors</b> of an eigenvalue are <b>those and exactly those</b> vectors {{c1::\(v \neq 0\)}} in {{c1::\(v \in N(A - \lambda I)\)::subspace}}.
\(QQ^\top = I\) hold? No, the identity has holes on the diagonal.
Field-by-field Comparison
Field
Before
After
Text
If \(Q\) orthogonal is not square does:<br><ul><li>\(Q^\top Q = I\) hold? {{c1:: Yes.}}</li><li>\(QQ^\top = I\) hold? {{c2:: No, the identity has holes on the diagonal.}}</li></ul>
For Least Squares, \(A\) needs to have linearly independent columns which they are if \(t_i = t_j\) for all \(i \not = j\) .
This is guaranteed if all datapoints are unique in time.
Otherwise the projection is not defined, i.e. there's no unique solution to the normal equations.
Field-by-field Comparison
Field
Before
After
Text
For Least Squares, \(A\) needs to have {{c1:: linearly independent columns ::what property and also why? }} which they are if {{c1:: \(t_i = t_j\) for all \(i \not = j\) }}.<br><br>This is guaranteed if all {{c2:: datapoints are unique in time}}.
Extra
Otherwise the projection is not defined, i.e. there's no unique solution to the normal equations.
Let \(A \in \mathbb{R}^{n \times n}\). If \((\lambda, v)\) is an eigenvalue, eigenvector pair, then {{c1::\((\overline{\lambda}, \overline{v})\) }} is an eigenvalue, eigenvector pair.
Let \(A \in \mathbb{R}^{n \times n}\). If \((\lambda, v)\) is an eigenvalue, eigenvector pair, then {{c1::\((\overline{\lambda}, \overline{v})\) }} is an eigenvalue, eigenvector pair.
The conjugate is always also an EW, EV pair.
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\). If \((\lambda, v)\) is an eigenvalue, eigenvector pair, then {{c1::\((\overline{\lambda}, \overline{v})\) }} is an eigenvalue, eigenvector pair.
SVD from rank 1 matrices with \(\sigma_1, \dots, \sigma_r\) be the non-zero singular values of \(A\), \(u_1, \dots, u_r\) the corresponding left singular vectors and \(v_1, \dots, v_r\) the corresponding right singular vectors.
SVD from rank 1 matrices with \(\sigma_1, \dots, \sigma_r\) be the non-zero singular values of \(A\), \(u_1, \dots, u_r\) the corresponding left singular vectors and \(v_1, \dots, v_r\) the corresponding right singular vectors.
We have:\[ A = \sum_{k = 1}^r \sigma_k u_k v_k^\top \] This follows directly from the compact SVD:
\[A = U_r \Sigma_r V_r^T = \begin{bmatrix} | & & | \\ \mathbf{u}_1 & \cdots & \mathbf{u}_r \\ | & & | \end{bmatrix} \begin{bmatrix} \sigma_1 & & \\ & \ddots & \\ & & \sigma_r \end{bmatrix} \begin{bmatrix} - & \mathbf{v}_1^T & - \\ & \vdots & \\ - & \mathbf{v}_r^T & - \end{bmatrix}\] Expanding the matrix multiplication, we get: \[A = \sigma_1 \mathbf{u}_1 \mathbf{v}_1^T + \sigma_2 \mathbf{u}_2 \mathbf{v}_2^T + \dots + \sigma_r \mathbf{u}_r \mathbf{v}_r^T = \sum_{i=1}^r \sigma_i \mathbf{u}_i \mathbf{v}_i^T\] Each term \(\sigma_i \mathbf{u}_i \mathbf{v}_i^T\) is a rank-1 matrix because it is the outer product of two vectors, \(\mathbf{u}_i\) and \(\mathbf{v}_i\), scaled by the singular value \(\sigma_i\).
Field-by-field Comparison
Field
Before
After
Front
SVD from rank 1 matrices with \(\sigma_1, \dots, \sigma_r\) be the non-zero singular values of \(A\), \(u_1, \dots, u_r\) the corresponding left singular vectors and \(v_1, \dots, v_r\) the corresponding right singular vectors.
Back
We have:\[ A = \sum_{k = 1}^r \sigma_k u_k v_k^\top \]<br>This follows directly from the compact SVD:<br><br>\[A = U_r \Sigma_r V_r^T = \begin{bmatrix} | & & | \\ \mathbf{u}_1 & \cdots & \mathbf{u}_r \\ | & & | \end{bmatrix} \begin{bmatrix} \sigma_1 & & \\ & \ddots & \\ & & \sigma_r \end{bmatrix} \begin{bmatrix} - & \mathbf{v}_1^T & - \\ & \vdots & \\ - & \mathbf{v}_r^T & - \end{bmatrix}\]<br>Expanding the matrix multiplication, we get: <br>\[A = \sigma_1 \mathbf{u}_1 \mathbf{v}_1^T + \sigma_2 \mathbf{u}_2 \mathbf{v}_2^T + \dots + \sigma_r \mathbf{u}_r \mathbf{v}_r^T = \sum_{i=1}^r \sigma_i \mathbf{u}_i \mathbf{v}_i^T\]<br>Each term \(\sigma_i \mathbf{u}_i \mathbf{v}_i^T\) is a rank-1 matrix because it is the outer product of two vectors, \(\mathbf{u}_i\) and \(\mathbf{v}_i\), scaled by the singular value \(\sigma_i\).
Express the Fibonacci formula \(f_n = f_{n - 1} + f_{n - 2}\) as a matrix equation?
{{c1::Let \(\mathbf{g}_{n+1} = M\mathbf{g}_n\), where \(M = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \)(matrix version of the recursion)}}
{{c2::The eigenvalues \(\lambda_1 = \frac{1+\sqrt{5} }{2}\) (golden ratio \(\phi\)) and \(\lambda_2 = \frac{1-\sqrt{5} }{2}\) are found, along with their eigenvectors \(v_1 = \begin{pmatrix} \lambda_1 \\ 1 \end{pmatrix}\) and \(v_2 = \begin{pmatrix} \lambda_2 \\ 1 \end{pmatrix}\) . These eigenvectors are independent since \(\lambda_1 \neq \lambda_2\) and thus they form a basis for \(\mathbb{R}^2\).}}
{{c3::The initial state \(\mathbf{g}_0\) is written as a linear combination of eigenvectors with coefficients \(\pm\frac{1}{\sqrt{5} }\): \(g_0 = \frac{1}{\sqrt{5} }v_1 - \frac{1}{\sqrt{5} }v_2\).}}
{{c4::Since \(M^n\mathbf{v}_i = \lambda_i^n\mathbf{v}_i\), we get the closed form: \[F_n = \frac{1}{\sqrt{5} } \left[\left(\frac{1+\sqrt{5} } {2}\right)^n - \left(\frac{1-\sqrt{5} } {2}\right)^n\right] \] }}
Express the Fibonacci formula \(f_n = f_{n - 1} + f_{n - 2}\) as a matrix equation?
{{c1::Let \(\mathbf{g}_{n+1} = M\mathbf{g}_n\), where \(M = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \)(matrix version of the recursion)}}
{{c2::The eigenvalues \(\lambda_1 = \frac{1+\sqrt{5} }{2}\) (golden ratio \(\phi\)) and \(\lambda_2 = \frac{1-\sqrt{5} }{2}\) are found, along with their eigenvectors \(v_1 = \begin{pmatrix} \lambda_1 \\ 1 \end{pmatrix}\) and \(v_2 = \begin{pmatrix} \lambda_2 \\ 1 \end{pmatrix}\) . These eigenvectors are independent since \(\lambda_1 \neq \lambda_2\) and thus they form a basis for \(\mathbb{R}^2\).}}
{{c3::The initial state \(\mathbf{g}_0\) is written as a linear combination of eigenvectors with coefficients \(\pm\frac{1}{\sqrt{5} }\): \(g_0 = \frac{1}{\sqrt{5} }v_1 - \frac{1}{\sqrt{5} }v_2\).}}
{{c4::Since \(M^n\mathbf{v}_i = \lambda_i^n\mathbf{v}_i\), we get the closed form: \[F_n = \frac{1}{\sqrt{5} } \left[\left(\frac{1+\sqrt{5} } {2}\right)^n - \left(\frac{1-\sqrt{5} } {2}\right)^n\right] \] }}
Field-by-field Comparison
Field
Before
After
Text
Express the Fibonacci formula \(f_n = f_{n - 1} + f_{n - 2}\) as a matrix equation?<br><ol><li>{{c1::Let \(\mathbf{g}_{n+1} = M\mathbf{g}_n\), where \(M = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \)(matrix version of the recursion)}}</li><li>{{c2::The eigenvalues \(\lambda_1 = \frac{1+\sqrt{5} }{2}\) (golden ratio \(\phi\)) and \(\lambda_2 = \frac{1-\sqrt{5} }{2}\) are found, along with their eigenvectors \(v_1 = \begin{pmatrix} \lambda_1 \\ 1 \end{pmatrix}\) and \(v_2 = \begin{pmatrix} \lambda_2 \\ 1 \end{pmatrix}\) . These eigenvectors are independent since \(\lambda_1 \neq \lambda_2\) and thus they form a basis for \(\mathbb{R}^2\).}}</li><li>{{c3::The initial state \(\mathbf{g}_0\) is written as a linear combination of eigenvectors with coefficients \(\pm\frac{1}{\sqrt{5} }\): \(g_0 = \frac{1}{\sqrt{5} }v_1 - \frac{1}{\sqrt{5} }v_2\).}}</li><li>{{c4::Since \(M^n\mathbf{v}_i = \lambda_i^n\mathbf{v}_i\), we get the closed form: \[F_n = \frac{1}{\sqrt{5} } \left[\left(\frac{1+\sqrt{5} } {2}\right)^n - \left(\frac{1-\sqrt{5} } {2}\right)^n\right] \] }}</li></ol>
In the SVD the diagonal elements of \(\Sigma\), \(\sigma_i = \Sigma_{ii}\) are called the singular values of \(A\) and are {{c1:: ordered as \(\sigma_1 \geq \dots \sigma_{\min\{m, n\} }\)}}.
In the SVD the diagonal elements of \(\Sigma\), \(\sigma_i = \Sigma_{ii}\) are called the singular values of \(A\) and are {{c1:: ordered as \(\sigma_1 \geq \dots \sigma_{\min\{m, n\} }\)}}.
Field-by-field Comparison
Field
Before
After
Text
In the SVD the diagonal elements of \(\Sigma\), \(\sigma_i = \Sigma_{ii}\) are called {{c1::the singular values}} of \(A\) and are {{c1:: ordered as \(\sigma_1 \geq \dots \sigma_{\min\{m, n\} }\)}}.
The singular values are the square-root of the eigenvalues of \(A^\top A\) (or \(AA^\top\)). Proof Included
Note that \(A^\top A\) and \(AA^\top\) share all non-zero eigenvalues. This can be seen easily as \(A^\top A\) is symmetric thus \(A^\top A = V^\top \Lambda V V(\Sigma^\top \Sigma) V^\top\) which implies that \(\Lambda = \Sigma^\top \Sigma\) and thus \(\lambda_i = \sigma_i^2\).
Field-by-field Comparison
Field
Before
After
Text
The singular values are the {{c1::square-root}} of the {{c2::eigenvalues of \(A^\top A\) (or \(AA^\top\))}}. <i>Proof Included</i>
Extra
Note that \(A^\top A\) and \(AA^\top\) share all non-zero eigenvalues. This can be seen easily as \(A^\top A\) is symmetric thus \(A^\top A = V^\top \Lambda V V(\Sigma^\top \Sigma) V^\top\) which implies that \(\Lambda = \Sigma^\top \Sigma\) and thus \(\lambda_i = \sigma_i^2\).
If \(A \in \mathbb{R}^{m \times n}\) has rank \(r = m\), then \(Ax = b\) has a solution for {{c1::every \(b \in \mathbb{R}^m\) (equivalent to saying that \(\textbf{C}(A) = \mathbb{R}^m\))}}.
We call \(A\) solvable (invertible \(A\) is a special case of this).
If \(A \in \mathbb{R}^{m \times n}\) has rank \(r = m\), then \(Ax = b\) has a solution for {{c1::every \(b \in \mathbb{R}^m\) (equivalent to saying that \(\textbf{C}(A) = \mathbb{R}^m\))}}.
We call \(A\) solvable (invertible \(A\) is a special case of this).
Field-by-field Comparison
Field
Before
After
Text
If \(A \in \mathbb{R}^{m \times n}\) has rank \(r = m\), then \(Ax = b\) has a solution for {{c1::every \(b \in \mathbb{R}^m\) (equivalent to saying that \(\textbf{C}(A) = \mathbb{R}^m\))}}.<br><br>We call \(A\) {{c1::solvable (invertible \(A\) is a special case of this)::name and special case}}.
Proof that the Rayleigh Quotient has it's maximum and minimum at the largest/smallest EWs?
Back
<div>It is easy to see that \(R(v_{\max}) = \lambda_{\max}\) and \(R(v_{\min}) = \lambda_{\min}\). </div><div><br></div><div>See: </div><div>\(R(v_{\text{max}}) = \frac{v_{\text{max}}^\top A v_{\text{max}}}{v_{\text{max}}^\top v_{\text{max}}} = \frac{v_{\text{max}}^\top (\lambda_{\text{max}} v_{\text{max}})}{v_{\text{max}}^\top v_{\text{max}}} = \lambda_{\text{max}}\)</div>
<div>Let \(Q\) be the \(m \times n\) matrix whose columns are an orthonormal basis of \(C(A)\).</div><div><br></div><div>Then the projection matrix that projects to \(C(A)\) is given by {{c1::\(QQ^\top\)}}. <i>Proof Included</i></div>
Extra
\(Q^\top Q\) simplifies to \(I\) in the case where our \(Q\) is orthogonal. <br><br>Thus \(P = Q (Q^\top Q)^{-1} Q^\top\) simplifies to \(P = QQ^\top\).
Given a symmetric matrix \(A \in \mathbb{R}^{n \times n}\) the Rayleigh Quotient defined for \(x \in \mathbb{R}^n \setminus {0}\), as \[ R(x) = {{c1::\frac{x^\top Ax}{x^\top x} }}\]attains it’s
maximum at {{c2::\(R(v_{\text{max} }) = \lambda_{\text{max} }\)}}
minimum at {{c2::\(R(v_{\text{min} }) = \lambda_{\text{min} } \)}}
where {{c2::\(\lambda_{\text{max} }\) and \(\lambda_{\text{min} }\) are respectively the largest and smallest eigenvalues of \(A\) and \(v_{\text{max} }\) and \(v_{\text{min} }\) their associated eigenvectors}}.
Given a symmetric matrix \(A \in \mathbb{R}^{n \times n}\) the Rayleigh Quotient defined for \(x \in \mathbb{R}^n \setminus {0}\), as \[ R(x) = {{c1::\frac{x^\top Ax}{x^\top x} }}\]attains it’s
maximum at {{c2::\(R(v_{\text{max} }) = \lambda_{\text{max} }\)}}
minimum at {{c2::\(R(v_{\text{min} }) = \lambda_{\text{min} } \)}}
where {{c2::\(\lambda_{\text{max} }\) and \(\lambda_{\text{min} }\) are respectively the largest and smallest eigenvalues of \(A\) and \(v_{\text{max} }\) and \(v_{\text{min} }\) their associated eigenvectors}}.
Field-by-field Comparison
Field
Before
After
Text
<div>Given a symmetric matrix \(A \in \mathbb{R}^{n \times n}\) the Rayleigh Quotient defined for \(x \in \mathbb{R}^n \setminus {0}\), as \[ R(x) = {{c1::\frac{x^\top Ax}{x^\top x} }}\]attains it’s</div><div><ul><li>maximum at {{c2::\(R(v_{\text{max} }) = \lambda_{\text{max} }\)}}</li><li>minimum at {{c2::\(R(v_{\text{min} }) = \lambda_{\text{min} } \)}}</li></ul><div>where {{c2::\(\lambda_{\text{max} }\) and \(\lambda_{\text{min} }\) are respectively the largest and smallest eigenvalues of \(A\) and \(v_{\text{max} }\) and \(v_{\text{min} }\) their associated eigenvectors}}.</div></div><blockquote><ul>
</ul></blockquote>
Every matrix \(A \in \mathbb{R}^{m \times n}\) has an SVD decomposition. In other words:
Every linear transformation is diagonal when viewed in the bases of the singular vectors.
Field-by-field Comparison
Field
Before
After
Text
<div>Every matrix \(A \in \mathbb{R}^{m \times n}\) has an SVD decomposition. In other words:</div><div>{{c1::Every linear transformation is diagonal when viewed in the bases of the singular vectors.}}</div>
For every \(i \in [r]\), column \(j_i\) of \(R\) is the standard unit vector \(e_i\)
All entries \(r_{ij}\) “below the staircase” are \(0\).
Field-by-field Comparison
Field
Before
After
Front
A matrix \(R\) is in RREF if:
Back
<ol>
<li>For every \(i \in [r]\), column \(j_i\) of \(R\) is the standard unit vector \(e_i\)</li><li>All entries \(r_{ij}\) “below the staircase” are \(0\).</li></ol><div><img src="paste-68d858bb3f866342909dc81c609228626cb1c514.jpg"></div>
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.
A function which is described as follows:<br><br>\(\delta_{i, j} = \begin{cases} \text{0} &\quad\text{if }i \neq j \\ \text{1} &\quad\text{if }i = j \end{cases}\)
Given a triangular (either upper or lower) matrix \(T \in \mathbb{R}^{n \times n}\), we have \[ \det(T) = {{c1:: \prod_{k = 1}^n T_{kk} }}\]
For a triangular matrix, if we choose an element off the diagonal, we are then forced to choose one in the \(0\)s thus making that factor \(0\). The only valid permutation is thus the \(\text{id}\), which means we just multiply the diagonals.
Field-by-field Comparison
Field
Before
After
Text
Given a <b>triangular</b> (either upper or lower) matrix \(T \in \mathbb{R}^{n \times n}\), we have \[ \det(T) = {{c1:: \prod_{k = 1}^n T_{kk} }}\]
Extra
For a triangular matrix, if we choose an element off the diagonal, we are then forced to choose one in the \(0\)s thus making that factor \(0\). The only valid permutation is thus the \(\text{id}\), which means we just multiply the diagonals.
The determinant expressed in terms of co-factors is: \[\det(A) = {{c1:: \sum_{j = 1}^n A_{ij}C_{ij} }}\]
in which we multiply the cofactor of every element by the element itself, as is clear in the example for a 3x3.
Field-by-field Comparison
Field
Before
After
Text
The determinant expressed in terms of <b>co-factors</b> is: \[\det(A) = {{c1:: \sum_{j = 1}^n A_{ij}C_{ij} }}\]<br>
Extra
in which we multiply the cofactor of every element by the element itself, as is clear in the example for a 3x3.<br><img src="paste-5b306ce2f1c5340a372c470f868d00a247f2c566.jpg">
\(A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}\) is invertible but not diagonalisable since the EW \(1\) has algebraic multiplicity 2 but geometric multiplicity 1.
\(A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}\) is invertible but not diagonalisable since the EW \(1\) has algebraic multiplicity 2 but geometric multiplicity 1.
Field-by-field Comparison
Field
Before
After
Text
\(A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}\) is invertible but not {{c1::diagonalisable}} since {{c1::the EW \(1\) has algebraic multiplicity 2 but geometric multiplicity 1}}.
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>
We know that \(\forall x \in \mathbb{R}^n\), there exist \(x_0 \in N(A)\) and \(x_1 \in R(A)\) such that \(x = x_0 + x_1 \) and \(x_1^\top x_0 = 0\) as \(N(A) = C(A^\top)^\perp\) are orthogonal complements.
We know that \(\forall x \in \mathbb{R}^n\), there exist \(x_0 \in N(A)\) and \(x_1 \in R(A)\) such that \(x = x_0 + x_1 \) and \(x_1^\top x_0 = 0\) as \(N(A) = C(A^\top)^\perp\) are orthogonal complements.
Field-by-field Comparison
Field
Before
After
Text
We know that \(\forall x \in \mathbb{R}^n\), there exist {{c1::\(x_0 \in N(A)\)}} and {{c1::\(x_1 \in R(A)\)}} such that \(x = {{c2:: x_0 + x_1 }}\) and {{c3::\(x_1^\top x_0 = 0\)}} as {{c3::\(N(A) = C(A^\top)^\perp\) are orthogonal complements}}.
The determinant is linear in each row (or each column). In other words for any \(a_0, a_1, a_2, \dots, a_n \in \mathbb{R}^n\) and \(\alpha_0, \alpha_1 \in \mathbb{R}\) we have: (Two linearity properties)
The determinant is linear in each row (or each column). In other words for any \(a_0, a_1, a_2, \dots, a_n \in \mathbb{R}^n\) and \(\alpha_0, \alpha_1 \in \mathbb{R}\) we have: (Two linearity properties)
Field-by-field Comparison
Field
Before
After
Front
The determinant is linear in each row (or each <i>column</i>). In other words for any \(a_0, a_1, a_2, \dots, a_n \in \mathbb{R}^n\) and \(\alpha_0, \alpha_1 \in \mathbb{R}\) we have: (<i>Two linearity properties)</i>
Then \(V \cap W = \) {{c1:: \(\{0\}\) (as all subspaces contain the \(0\) vector)}}.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) and \(W\) be orthogonal subspaces.</div><div><br></div><div>Then \(V \cap W = \) {{c1:: \(\{0\}\) (as all subspaces contain the \(0\) vector)}}.</div>
If \(\lambda, v\) an EW-EV pair of \(A\) then \(A(Bv) = (AB)v = B(Av) = \lambda Bv\) thus \(Bv\) is an eigenvector of \(A\).
Then \(Bv\) is a multiple of some \(v\) of that EW \(\lambda\) (easiest to see for \(A\) complete set of real EVs) \(\implies\) \(Bv = \lambda'v\) thus that \(v\) is also an EV of \(B\).
Field-by-field Comparison
Field
Before
After
Text
If \(AB = BA\), then {{c1::\(A,B\) share an EV::EVs of A, B}}.
Extra
Assume \(AB = BA\).<br><br>If \(\lambda, v\) an EW-EV pair of \(A\) then \(A(Bv) = (AB)v = B(Av) = \lambda Bv\) thus \(Bv\) is an eigenvector of \(A\).<br><br>Then \(Bv\) is a multiple of some \(v\) of that EW \(\lambda\) (easiest to see for \(A\) complete set of real EVs) \(\implies\) \(Bv = \lambda'v\) thus that \(v\) is also an EV of \(B\).
{{c1::\(T_A : \mathbb{R}^m \rightarrow \mathbb{R}^m\) is bijective.::Transformation}}
There is an \(m \times m\) matrix \(B\) such that \(BA = I\).
The columns of \(A\) are linearly independent.
The third one can be derived from the fact that if \(BA = I\), there is only a single \(x \in \mathbb{R}^m\) such that \(A \textbf{x} = 0\).
It is also intuitively clear that if not all columns were linearly independent, we'd actually have a tall linear transformation and would be losing information.
Field-by-field Comparison
Field
Before
After
Text
Three equivalent statements:<br><ol><li>{{c1::\(T_A : \mathbb{R}^m \rightarrow \mathbb{R}^m\) is bijective.::Transformation}}</li><li>{{c2::There is an \(m \times m\) matrix \(B\) such that \(BA = I\).}}</li><li>{{c3::The columns of \(A\) are linearly independent.}}</li></ol>
Extra
The third one can be derived from the fact that if \(BA = I\), there is only a single \(x \in \mathbb{R}^m\) such that \(A \textbf{x} = 0\).<br><br>It is also intuitively clear that if not all columns were linearly independent, we'd actually have a tall linear transformation and would be losing information.
In a vector space \(V\) three important properties hold:
\(0v = 0\) for all \(v\)
there is only one \(0\)
one unique inverse \(-v\) for all \(v\)
Field-by-field Comparison
Field
Before
After
Text
In a vector space \(V\) three important properties hold:<br><ul><li>{{c1::\(0v = 0\) for all \(v\)}}</li><li>{{c2:: there is only one \(0\)}}</li><li>{{c3:: one unique inverse \(-v\) for all \(v\)}}</li></ul>
What happens if \(A\) itself is invertible for the projection matrix?
Since \(A\) is invertible, it spans \(\mathbb{R}^m\) and any projection is simply the point itself.
This is beautifully reflected in the fact that if we simplify \(P = A A^{-1} (A^\top)^{-1} A^\top\) then we simply get \(P = I\).
In general it may look like we can simplify the expression for the projection matrix \(P\), this is however not the case, UNLESS \(A\) is invertible:
\((A^\top A)^{-1} = A^{-1} (A^\top)^{-1}\)
Field-by-field Comparison
Field
Before
After
Front
What happens if \(A\) itself is invertible for the projection matrix?
Back
Since \(A\) is <b>invertible</b>, it spans \(\mathbb{R}^m\) and any projection is simply the point itself.<br><br>This is <i>beautifully reflected</i> in the fact that if we simplify \(P = A A^{-1} (A^\top)^{-1} A^\top\) then we simply get \(P = I\).<br><br>In general it may look like we can simplify the expression for the projection matrix \(P\), this is however not the case, UNLESS \(A\) is invertible:<br><br>\((A^\top A)^{-1} = A^{-1} (A^\top)^{-1}\)
Let \(A\) be an \(m \times n\) matrix and \(b \in \mathbb{R}^m\). The set \[ \textbf{Sol}(A, b) := \{x \in \mathbb{R}^n : Ax = b\} \subseteq \mathbb{R}^n \] is the solution space of \(Ax = b\).
Let \(A\) be an \(m \times n\) matrix and \(b \in \mathbb{R}^m\). The set \[ \textbf{Sol}(A, b) := \{x \in \mathbb{R}^n : Ax = b\} \subseteq \mathbb{R}^n \] is the solution space of \(Ax = b\).
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an \(m \times n\) matrix and \(b \in \mathbb{R}^m\).<br>The set \[ \textbf{Sol}(A, b) := \{x \in \mathbb{R}^n : Ax = b\} \subseteq \mathbb{R}^n \] is {{c1:: the <i>solution space</i> of \(Ax = b\)}}.
Let \(V\) be a vector space. A nonempty set \(U \subseteq V\) is called a subspace of \(V\) if the following two axioms of a subspace are true for all \(v, w \in U\) and all \(\lambda \in \mathbb{R}\):
Let \(V\) be a vector space. A nonempty set \(U \subseteq V\) is called a subspace of \(V\) if the following two axioms of a subspace are true for all \(v, w \in U\) and all \(\lambda \in \mathbb{R}\):
\(v + w \in U\) (closure addition)
\(\lambda v \in U\) (closure multiplication)
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) be a vector space. A nonempty set \(U \subseteq V\) is called a subspace of \(V\) if the following two axioms of a subspace are true for all \(v, w \in U\) and all \(\lambda \in \mathbb{R}\):</div><div><ul><li>{{c2::\(v + w \in U\) (closure addition)}}</li><li>{{c3::\(\lambda v \in U\) (closure multiplication)}}</li></ul></div><blockquote><ul>
</ul></blockquote>
We can write \(\mathbf{p} = \lambda\mathbf{a}, \lambda \in \mathbb{R}\) since we know {{c1::the projection vector is on the line spanned by \(\mathbf{a}\) and hence \(\mathbf{p}\) is a scalar multiple of \(\textbf{a}\)}}.
Where we first used \(\mathbf{v} \perp \mathbf{u} \iff \mathbf{v}^\top\mathbf{u} = 0\), then plugged in for \(\lambda a\) for \(p\), then used the distributivity of the vector multiplication.
We can divide by \(a^\top a\)(\(a\) is a nonzero real number, as is a nonzero vector)
We can then plug in \(\lambda\) into \(p = \lambda \mathbf{a}\) to get the projection vector \[ \mathbf{p} = \frac{a^\top b}{a^\top a}a = \frac{aa^\top}{a^\top a} b \]We can do this since \(a^\top b\) is a scalar so \((a^\top b)a = a(a^\top b) = (a a^\top) b\) (commute and associativity).
We can write \(\mathbf{p} = \lambda\mathbf{a}, \lambda \in \mathbb{R}\) since we know {{c1::the projection vector is on the line spanned by \(\mathbf{a}\) and hence \(\mathbf{p}\) is a scalar multiple of \(\textbf{a}\)}}.
Where we first used \(\mathbf{v} \perp \mathbf{u} \iff \mathbf{v}^\top\mathbf{u} = 0\), then plugged in for \(\lambda a\) for \(p\), then used the distributivity of the vector multiplication.
We can divide by \(a^\top a\)(\(a\) is a nonzero real number, as is a nonzero vector)
We can then plug in \(\lambda\) into \(p = \lambda \mathbf{a}\) to get the projection vector \[ \mathbf{p} = \frac{a^\top b}{a^\top a}a = \frac{aa^\top}{a^\top a} b \]We can do this since \(a^\top b\) is a scalar so \((a^\top b)a = a(a^\top b) = (a a^\top) b\) (commute and associativity).
Field-by-field Comparison
Field
Before
After
Text
Intuition on the projection formula (in 2d):<br><br><ul><li>Assume \(\mathbf{a} \perp \mathbf{e}\) \(\implies\) \(\mathbf{a} \perp (\mathbf{b} - \mathbf{p})\) (define error vector \(\mathbf{e} = \mathbf{b} - \mathbf{p}\)).</li><li>We can write \(\mathbf{p} = \lambda\mathbf{a}, \lambda \in \mathbb{R}\) since we know {{c1::the projection vector is on the line spanned by \(\mathbf{a}\) and hence \(\mathbf{p}\) is a scalar multiple of \(\textbf{a}\)}}.</li><li>\[ \begin{align} \mathbf{a} \perp (\mathbf{b} - \mathbf{p}) &\iff {{c1:: \mathbf{a}^\top(\mathbf{b} - \mathbf{p}) = 0 \\ &\iff \mathbf{a}^\top(\mathbf{b} - \lambda\mathbf{a}) = 0 \\ &\iff \mathbf{a}^\top\mathbf{b} - \mathbf{a}^\top\lambda\mathbf{a} = 0 \\ &\iff \mathbf{a}^\top\mathbf{b} = \mathbf{a}^\top\lambda\mathbf{a} \\ &\iff \mathbf{a}^\top\mathbf{b} = \lambda\mathbf{a}^\top\mathbf{a} \\ &\iff \lambda = \frac{\mathbf{a}^\top\mathbf{b} }{\mathbf{a}^\top\mathbf{a} } }} \end{align} \]</li><li>Where we first used \(\mathbf{v} \perp \mathbf{u} \iff \mathbf{v}^\top\mathbf{u} = 0\), then plugged in for \(\lambda a\) for \(p\), then used the distributivity of the vector multiplication.</li><li>We can divide by \(a^\top a\)(\(a\) is a nonzero real number, as is a nonzero vector)</li></ul>We can then plug in \(\lambda\) into \(p = \lambda \mathbf{a}\) to get the projection vector \[ \mathbf{p} = \frac{a^\top b}{a^\top a}a = \frac{aa^\top}{a^\top a} b \]We can do this since \(a^\top b\) is a scalar so \((a^\top b)a = a(a^\top b) = (a a^\top) b\) (commute and associativity).
By the spectral theorem, for any symmetric \(A\) we can write:
\[ A = V \Lambda V^\top \]where \(\Lambda \in \mathbb{R}^{n \times n}\) is a diagonal matrix with the eigenvalues of \(A\) in it's diagonal, and \(V\) orthogonal matrix containing the eigenvectors \(V^\top V = I\).
By the spectral theorem, for any symmetric \(A\) we can write:
\[ A = V \Lambda V^\top \]where \(\Lambda \in \mathbb{R}^{n \times n}\) is a diagonal matrix with the eigenvalues of \(A\) in it's diagonal, and \(V\) orthogonal matrix containing the eigenvectors \(V^\top V = I\).
This decomposition is called an eigen-decomposition.
Field-by-field Comparison
Field
Before
After
Text
By the spectral theorem, for any symmetric \(A\) we can write: <br><br>\[ A = {{c1::V \Lambda V^\top }}\]where \(\Lambda \in \mathbb{R}^{n \times n}\) is {{c2::a diagonal matrix with the eigenvalues of \(A\) in it's diagonal}}, and \(V\) {{c2::orthogonal matrix containing the eigenvectors \(V^\top V = I\)}}.
Extra
This decomposition is called an eigen-decomposition.
Let \(\{v_1, \dots, v_m\}\) be a basis of \(V\). For each \(v \in V\), there are unique scalars \(\lambda_1, \dots, \lambda_n\) such that \[ v = \sum_{j = 1}^{m} \lambda_j v_j \]This means that in a basis each vector can be written as a unique linear combination.
Let \(\{v_1, \dots, v_m\}\) be a basis of \(V\). For each \(v \in V\), there are unique scalars \(\lambda_1, \dots, \lambda_n\) such that \[ v = \sum_{j = 1}^{m} \lambda_j v_j \]This means that in a basis each vector can be written as a unique linear combination.
This holds as all basis vectors are linearly independent by definition.
Field-by-field Comparison
Field
Before
After
Text
Let \(\{v_1, \dots, v_m\}\) be a basis of \(V\). For each \(v \in V\), there are unique scalars \(\lambda_1, \dots, \lambda_n\) such that \[ v = \sum_{j = 1}^{m} \lambda_j v_j \]This means that {{c1::in a basis each vector can be written as a <b>unique</b> linear combination}}.
Extra
This holds as all basis vectors are linearly independent by definition.
Let \(A\) and \(v_1, \dots, v_k \in \mathbb{R}^n\) be the EVs of \(\lambda_1, \dots, \lambda_k \in \mathbb{R}^n\).
If the \(\lambda_1, \dots, \lambda_k\)s are all distinct then the EVs \(v_1, \dots, v_k\) are all linearly independent.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A\) and \(v_1, \dots, v_k \in \mathbb{R}^n\) be the EVs of \(\lambda_1, \dots, \lambda_k \in \mathbb{R}^n\).</div><div>If the \(\lambda_1, \dots, \lambda_k\)s are all distinct then {{c1::the EVs \(v_1, \dots, v_k\) are all linearly independent}}.</div>
We can adapt least squares to do more than just linear regression, we could also fit a parabola (or anything else) by changing the entries in \(A\) to match the coefficients of our formula.
We can adapt least squares to do more than just linear regression, we could also fit a parabola (or anything else) by changing the entries in \(A\) to match the coefficients of our formula.
We could have \(A = \begin{bmatrix} 1 & t_1 & t_1^2 \\ 1 & t_2 & t_2^2 \\ \vdots & \vdots & \vdots \\ 1 & t_m & t_m^2 \end{bmatrix}\) for a parabola.
Field-by-field Comparison
Field
Before
After
Text
We can adapt least squares to do more than just linear regression, we could also fit a parabola (or anything else) by {{c1:: changing the entries in \(A\) to match the coefficients of our formula}}.
Extra
We could have \(A = \begin{bmatrix} 1 & t_1 & t_1^2 \\ 1 & t_2 & t_2^2 \\ \vdots & \vdots & \vdots \\ 1 & t_m & t_m^2 \end{bmatrix}\) for a parabola.
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). <br><br>Beispiel: Ebene in \(\mathbb{R}^3\)
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), the pseudo-inverse \(A^\dagger \in \mathbb{R}^{n \times m}\) is a right inverse of \(A\): \[ A A^\dagger = I \]Proof Included
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), the pseudo-inverse \(A^\dagger \in \mathbb{R}^{n \times m}\) is a right inverse of \(A\): \[ A A^\dagger = I \]Proof Included
Proof Since \(A^\top\) has full column rank, \(((A^\top)^\top A^\top) = AA^\top\) is invertible: \(AA^\dagger = AA^\top(A A^\top)^{-1} = I\).
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), the <b>pseudo-inverse</b> \(A^\dagger \in \mathbb{R}^{n \times m}\) is {{c1::a right inverse}} of \(A\): \[ {{c1:: A A^\dagger = I }}\]<i>Proof Included</i>
Extra
<div><b>Proof</b> Since \(A^\top\) has full column rank, \(((A^\top)^\top A^\top) = AA^\top\) is invertible: \(AA^\dagger = AA^\top(A A^\top)^{-1} = I\).</div>
If the columns of \(A\) are pairwise orthogonal, we get \(A^\top A\) a diagonal matrix which is very easy to invert, i.e. makes Least Squares easier.
We can convert any \(A\) to have orthogonal columns by making sure that the sum of all the \(t_k = 0\), which can be achieved by shifting the graph on the x-axis.
If the columns of \(A\) are pairwise orthogonal, we get \(A^\top A\) a diagonal matrix which is very easy to invert, i.e. makes Least Squares easier.
We can convert any \(A\) to have orthogonal columns by making sure that the sum of all the \(t_k = 0\), which can be achieved by shifting the graph on the x-axis.
Field-by-field Comparison
Field
Before
After
Text
<div>If the columns of \(A\) are pairwise orthogonal, we get \(A^\top A\) a diagonal matrix which is very easy to invert, i.e. makes Least Squares easier.</div><div><br></div><div>We can convert any \(A\) to have orthogonal columns by {{c1:: making sure that the sum of all the \(t_k = 0\), which can be achieved by shifting the graph on the x-axis}}.</div>
The projection of a vector \(b \in \mathbb{R}^m\) to the subspace \(S = C(A)\) is well-defined.
It can be written as \(proj_S(b) = A\hat{x}\) where \(\hat{x}\) satisfies the normal equations{{c1:: \(A^\top A \hat{x} = A^\top b\) }}.
Field-by-field Comparison
Field
Before
After
Text
The projection of a vector \(b \in \mathbb{R}^m\) to the subspace \(S = C(A)\) is well-defined. <br><br>It can be written as \(proj_S(b) = A\hat{x}\) where \(\hat{x}\) satisfies the <b>normal equations</b>{{c1:: \(A^\top A \hat{x} = A^\top b\) }}.
For a permutation \(\sigma\), if \(\sigma(i) \neq i\) then there exists a \(j\) such that \(\sigma(j) \neq j\).
We're going to have to venture off the diagonal for at least one other element.
If we have a matrix \(A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\), the only permutation that doesn't produce a \(0\) product is the \(\text{id}\) permutation.
Field-by-field Comparison
Field
Before
After
Text
For a permutation \(\sigma\), if \(\sigma(i) \neq i\) then {{c1:: there exists a \(j\) such that \(\sigma(j) \neq j\)}}.
Extra
We're going to have to venture off the diagonal for at least one other element.<br><br>If we have a matrix \(A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\), the only permutation that doesn't produce a \(0\) product is the \(\text{id}\) permutation.
How do we find the inverse of \(A\) using Gauss-Jordan?
We do \(\text{RREF}(A, I)\) which gives us \((R, j_1, \dots, j_r, M)\) where in the case that \(A\) is invertible:
\(R\) is \(I\) and \(r = n\)
\(M = A^{-1}\)
Field-by-field Comparison
Field
Before
After
Front
<div>How do we find the inverse of \(A\) using Gauss-Jordan?</div>
Back
We do \(\text{RREF}(A, I)\) which gives us \((R, j_1, \dots, j_r, M)\) where in the case that \(A\) is invertible:<br><ul><li>\(R\) is \(I\) and \(r = n\)</li><li>\(M = A^{-1}\)</li></ul>
Given \(A \in \mathbb{R}^{m \times n}\) (can have any rank) and a vector \(b \in \mathbb{R}^m\), the uniquesolution to \[ \min_{x \in \mathbb{R}^n} ||x||^2 \] such that \(A^\top Ax = A^\top b\) is given by {{c2::\(\hat{x} = A^\dagger b\)}}.
Given \(A \in \mathbb{R}^{m \times n}\) (can have any rank) and a vector \(b \in \mathbb{R}^m\), the uniquesolution to \[ \min_{x \in \mathbb{R}^n} ||x||^2 \] such that \(A^\top Ax = A^\top b\) is given by {{c2::\(\hat{x} = A^\dagger b\)}}.
Field-by-field Comparison
Field
Before
After
Text
Given \(A \in \mathbb{R}^{m \times n}\) (can have any rank) and a vector \(b \in \mathbb{R}^m\), the {{c1::<b>unique</b>}}<b> </b>solution to \[ \min_{x \in \mathbb{R}^n} ||x||^2 \] such that {{c1::\(A^\top Ax = A^\top b\)}} is given by {{c2::\(\hat{x} = A^\dagger b\)}}.
\(A^\top A\) has full rank when \(A\) has full column rank. Proof Included
If \(A^\top A x = 0\), then \(x^\top A^\top A x = ||Ax||^2 = 0\), so \(Ax = 0\). If A has full column rank \(N(A) = \{0\}\), thus \(x = 0\), proving \(A^\top A\) is invertible - full rank (as \(A^\top A \in \mathbb{R}^{n \times n}\)).
Field-by-field Comparison
Field
Before
After
Text
\(A^\top A\) has full rank when \(A\) has {{c1::full column rank}}. <i>Proof Included</i>
Extra
<div>If \(A^\top A x = 0\), then \(x^\top A^\top A x = ||Ax||^2 = 0\), so \(Ax = 0\). If A has full column rank \(N(A) = \{0\}\), thus \(x = 0\), proving \(A^\top A\) is invertible - full rank (as \(A^\top A \in \mathbb{R}^{n \times n}\)).</div><div><br></div>
Let \(V\) be a subspace of \(\mathbb{R}^n\). We define the orthogonal complement of \(V\) as: \[ V^\perp = {{c2:: \{ w \in \mathbb{R}^n \ | \ w^\top v = 0 \ \text{for all } v \in V \} }}\]
Let \(V\) be a subspace of \(\mathbb{R}^n\). We define the orthogonal complement of \(V\) as: \[ V^\perp = {{c2:: \{ w \in \mathbb{R}^n \ | \ w^\top v = 0 \ \text{for all } v \in V \} }}\]
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a subspace of \(\mathbb{R}^n\). We define the {{c1::orthogonal complement}} of \(V\) as: \[{{c1:: V^\perp }} = {{c2:: \{ w \in \mathbb{R}^n \ | \ w^\top v = 0 \ \text{for all } v \in V \} }}\]
Let \(A\) with \(n\) distinct real eigenvalues (meaning that the zeros of \(\det(A- \lambda I)\) as described in Corollary 8.1.3 are all distinct, algebraic multiplicity \(1\)), then {{c2::there is a basis of \(\mathbb{R}^n\) made up of EVs of \(A\)}}.
Let \(A\) with \(n\) distinct real eigenvalues (meaning that the zeros of \(\det(A- \lambda I)\) as described in Corollary 8.1.3 are all distinct, algebraic multiplicity \(1\)), then {{c2::there is a basis of \(\mathbb{R}^n\) made up of EVs of \(A\)}}.
We also call this the Eigenbasis or a complete set of real EVs, which will come in handy later for Diagonalisation.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A\) with \(n\) {{c1::distinct real eigenvalues (meaning that the zeros of \(\det(A- \lambda I)\) as described in Corollary 8.1.3 are all distinct, algebraic multiplicity \(1\))::property and in terms of algebraic}}, then {{c2::there is a basis of \(\mathbb{R}^n\) made up of EVs of \(A\)}}.</div>
Extra
<div>We also call this the <b>Eigenbasis</b> or a <b>complete set of real EVs</b>, which will come in handy later for Diagonalisation.</div>
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>
Multilinearity of the determinant:\[\begin{vmatrix} a + a' & b + b' \\ c & d \end{vmatrix} = {{c1:: \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a' & b' \\ c & d \end{vmatrix} }}\]
Multilinearity of the determinant:\[\begin{vmatrix} a + a' & b + b' \\ c & d \end{vmatrix} = {{c1:: \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a' & b' \\ c & d \end{vmatrix} }}\]
Field-by-field Comparison
Field
Before
After
Text
Multilinearity of the determinant:\[\begin{vmatrix} a + a' & b + b' \\ c & d \end{vmatrix} = {{c1:: \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a' & b' \\ c & d \end{vmatrix} }}\]
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.
How could we use the certificate of no solution to show that a vector \(b\) is linearly independent from a set of vectors \(a_1, \dots, a_n\)?
We just put them into the matrix equation \(Ax = b\). If there is no solution, \(b\) is independent.
Field-by-field Comparison
Field
Before
After
Front
How could we use the certificate of no solution to show that a vector \(b\) is linearly independent from a set of vectors \(a_1, \dots, a_n\)?
Back
We just put them into the matrix equation \(Ax = b\). If there is no solution, \(b\) is independent.
The nullspace of \(N(A) \) is equal to the nullspace of \(N(A^\dagger)\). Proof Included
Intuitively this holds as \(A^\dagger\) projects onto the \(C(A)\).
Thus anything in \(C(A)^\bot = N(A^\top)\) is projected to \(0\). In other words, \(\forall x \in C(A^\top)^\bot = N(A^\top)\) we have \(A^\dagger x = 0\). We conclude that \(N(A) = C(A^\top)^\bot = N(A^\dagger)\).
Field-by-field Comparison
Field
Before
After
Text
The <b>nullspace of </b>\(N(A) \) is equal to {{c1:: the nullspace of \(N(A^\dagger)\)::Pseudoinverse}}. <i>Proof Included</i>
Extra
Intuitively this holds as \(A^\dagger\) projects onto the \(C(A)\).<br><br>Thus anything in \(C(A)^\bot = N(A^\top)\) is projected to \(0\). <br>In other words, \(\forall x \in C(A^\top)^\bot = N(A^\top)\) we have \(A^\dagger x = 0\).<br>We conclude that \(N(A) = C(A^\top)^\bot = N(A^\dagger)\).
\(AA^\top\) has full rank when \(A\) has full row rank.
\(AA^\top x = 0\) implies \(x^\top AA^\top x = 0 \implies ||A^\top x||^2 = 0\) thus \(x \in N(A^\top)\). And for \(A\) full row rank, \(N(A^\top) = \{0\}\). Thus \(x = 0\) and \(AA^\top \) has full rank - invertible.
Field-by-field Comparison
Field
Before
After
Text
\(AA^\top\) has full rank when \(A\) has {{c1::full row rank}}.
Extra
\(AA^\top x = 0\) implies \(x^\top AA^\top x = 0 \implies ||A^\top x||^2 = 0\) thus \(x \in N(A^\top)\). And for \(A\) full row rank, \(N(A^\top) = \{0\}\). Thus \(x = 0\) and \(AA^\top \) has full rank - invertible.
\(A \in \mathbb{R}^{n \times n}\) arbitrary non-symmetric has rank \(n - \dim(N(A))\) so it's \(n\) minus the geometric multiplicity of \(\lambda = 0\) .
\(A \in \mathbb{R}^{n \times n}\) arbitrary non-symmetric has rank \(n - \dim(N(A))\) so it's \(n\) minus the geometric multiplicity of \(\lambda = 0\) .
Field-by-field Comparison
Field
Before
After
Text
\(A \in \mathbb{R}^{n \times n}\) arbitrary non-symmetric has rank {{c1:: \(n - \dim(N(A))\) so it's \(n\) minus the geometric multiplicity of \(\lambda = 0\) ::in terms of multiplicities}}.
For \(R\) result of RREF on \(A\), \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) where \(R = \begin{bmatrix} R’ \in r \times n \\ 0 \in (m - r) \times n \end{bmatrix}\).
This \(R’\) is the \(R’\) from the CR decomposition (non-zero rows).
And \(C\) is the submatrix taking only \(j_1, j_2, \dots, j_r\) (independent columns).
Field-by-field Comparison
Field
Before
After
Front
How can we find the CR-Decomposition from RREF?
Back
<div>For \(R\) result of RREF on \(A\), \(R\) in \(\text{RREF}(j_1, j_2, \dots, j_r)\) where \(R = \begin{bmatrix} R’ \in r \times n \\ 0 \in (m - r) \times n \end{bmatrix}\).</div><div><ol><li>This \(R’\) is the \(R’\) from the CR decomposition (non-zero rows).</li><li>And \(C\) is the submatrix taking only \(j_1, j_2, \dots, j_r\) (independent columns).</li></ol><div><img src="paste-f744be89c3e7bb54b2aac0d9dbf4595e8ec7ec7e.jpg"></div></div>
Let \(V, W\) be orthogonal subspaces of \(\mathbb{R}^n\). Then the following statements are equivalent:
\(W = V^\perp\)
\(\dim(V) + \dim(W) = n\)
{{c3::Every \(u \in \mathbb{R}^n\) can be written as \(u = v + w\) with unique vectors \(v \in V\), \(w \in W\)}}
In words, this means that we can combine two orthogonal subspaces and create a new subspace, whose dimension is the sum of the two dimensions.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V, W\) be orthogonal subspaces of \(\mathbb{R}^n\). Then the following statements are equivalent:</div><div><ol><li>{{c1::\(W = V^\perp\)}}</li><li>{{c2::\(\dim(V) + \dim(W) = n\)}}</li><li>{{c3::Every \(u \in \mathbb{R}^n\) can be written as \(u = v + w\) with unique vectors \(v \in V\), \(w \in W\)}}</li></ol></div><blockquote><ul>
</ul></blockquote>
Extra
<i>In words, this means that</i> we can combine two orthogonal subspaces and create a new subspace, whose dimension is the sum of the two dimensions.
How can we use Gauss-Jordan to simplify the determinant calculations?
We can use Gauss-Jordan to make any matrix upper triangular (then the determinant is the product of the diagonals).
We are allowed to use:
Row addition / substraction
Exchanging rows (change sign)
Multiply rows (multiply the determinant at the end)
Field-by-field Comparison
Field
Before
After
Front
How can we use Gauss-Jordan to simplify the determinant calculations?
Back
We can use Gauss-Jordan to make any matrix upper triangular (then the determinant is the product of the diagonals).<br><br>We are allowed to use:<br><ul><li>Row addition / substraction</li><li>Exchanging rows (change sign)</li><li>Multiply rows (multiply the determinant at the end)</li></ul>
Given a square matrix \(A \in \mathbb{R}^{n \times n}\), the determinant \(\det(A)\) is defined as: \[ \det(A) = {{c1:: \sum_{\sigma \in \Pi_n} \text{sgn}(\sigma) \prod_{i = 1}^n A_{i, \sigma(j)} }}\] where \(\Pi_n\) is the set of all permutations of \(n\) elements (of which there are \(n!\)).
Given a square matrix \(A \in \mathbb{R}^{n \times n}\), the determinant \(\det(A)\) is defined as: \[ \det(A) = {{c1:: \sum_{\sigma \in \Pi_n} \text{sgn}(\sigma) \prod_{i = 1}^n A_{i, \sigma(j)} }}\] where \(\Pi_n\) is the set of all permutations of \(n\) elements (of which there are \(n!\)).
Field-by-field Comparison
Field
Before
After
Text
Given a square matrix \(A \in \mathbb{R}^{n \times n}\), the determinant \(\det(A)\) is defined as: \[ \det(A) = {{c1:: \sum_{\sigma \in \Pi_n} \text{sgn}(\sigma) \prod_{i = 1}^n A_{i, \sigma(j)} }}\] where {{c1:: \(\Pi_n\) is the set of all permutations of \(n\) elements (of which there are \(n!\))}}.
For \(A\) a matrix and \(M\) an invertible matrix:
\(C(A) = \) {{c1::Not equal to \(\textbf{C}(MA)\), the column space changes!}}
\(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) after RREF is \(\begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}\) which spans a completely different line.
Field-by-field Comparison
Field
Before
After
Text
<div>For \(A\) a matrix and \(M\) an invertible matrix:</div><div><br></div>\(C(A) = \) {{c1::N<b>ot equal to </b>\(\textbf{C}(MA)\), the column space changes!}}
Extra
\(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) after RREF is \(\begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}\) which spans a completely different line.
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = n\), the pseudoinverse \(A^\dagger\) is a left inverse of \(A\), meaning: \[ A^\dagger A = I \]Proof Included
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = n\), the pseudoinverse \(A^\dagger\) is a left inverse of \(A\), meaning: \[ A^\dagger A = I \]Proof Included
Proof: Since \(A\) has full column rank, \(A^\top A\) invertible and then \(A^\dagger A = ((A^\top A)^{-1} A^\top)A\) \(= (A^\top A)^{-1} (A^\top A) = I\).
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = n\), the pseudoinverse \(A^\dagger\) is {{c1::a left inverse}} of \(A\), meaning: \[{{c1:: A^\dagger A = I }}\]<i>Proof Included</i>
Extra
<b>Proof: </b>Since \(A\) has full column rank, \(A^\top A\) invertible and then \(A^\dagger A = ((A^\top A)^{-1} A^\top)A\) \(= (A^\top A)^{-1} (A^\top A) = I\).
If \(Ax = b\) has a solution, then \(\textbf{Sol}(A, b)\) has dimension \(n - r\), where \[ \dim(\textbf{Sol}(A, b)) := {{c1::\dim(\textbf{N}(A)) }}\]
Field-by-field Comparison
Field
Before
After
Text
If \(Ax = b\) has a solution, then \(\textbf{Sol}(A, b)\) has dimension {{c1::\(n - r\)}}, where \[ \dim(\textbf{Sol}(A, b)) := {{c1::\dim(\textbf{N}(A)) }}\]
Let \(V\) be a finitely generated vector space and let \(G \subseteq V\) be a finite subset with \(\textbf{Span}(G) = V\).
Then \(V\) has a basis \(B \subseteq G\).
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a finitely generated vector space and let \(G \subseteq V\) be a finite subset with \(\textbf{Span}(G) = V\). <br><br>Then \(V\) {{c1::has a basis \(B \subseteq G\)}}.
Because \(R(A) = C(A^\top)\) and \(N(A)\) are orthogonal, we can decompose any vector \(x \in \mathbb{R}^n\) into \(x = x_r + x_n\) where \(x_r \in R(A) \) is unique and \(x_n \in N(A)\) can be any value.
Because \(R(A) = C(A^\top)\) and \(N(A)\) are orthogonal, we can decompose any vector \(x \in \mathbb{R}^n\) into \(x = x_r + x_n\) where \(x_r \in R(A) \) is unique and \(x_n \in N(A)\) can be any value.
We can take any \(x_n \in N(A)\) because when doing \(Ax = Ax_r + Ax_n = Ax_r\) as \(Ax_n = 0\).
Field-by-field Comparison
Field
Before
After
Text
Because \(R(A) = C(A^\top)\) and \(N(A)\) are orthogonal, we can decompose any vector \(x \in \mathbb{R}^n\) into {{c1:: \(x = x_r + x_n\) where \(x_r \in R(A) \) is unique and \(x_n \in N(A)\) can be any value}}.
Extra
We can take any \(x_n \in N(A)\) because when doing \(Ax = Ax_r + Ax_n = Ax_r\) as \(Ax_n = 0\).<br><img src="paste-528b4c56a915a99153a081b8b57edb99a74f759c.jpg">
What happens in the case of linearly dependent vectors in \(A\) during Gram-Schmidt?
Since in a linearly dependent set of vectors one of them is a linear combination of the previous ones, you'd get \(0\) in the subtraction step for it. By excluding those \(0\)'s you'd still get an orthonormal basis.
Field-by-field Comparison
Field
Before
After
Front
What happens in the case of linearly dependent vectors in \(A\) during Gram-Schmidt?
Back
Since in a linearly dependent set of vectors one of them is a linear combination of the previous ones, you'd get \(0\) in the subtraction step for it. By excluding those \(0\)'s you'd still get an orthonormal basis.
Certificate of no solutions:\[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = \emptyset\]is equivalent to:
\[{{c1:: \{z \in \mathbb{R}^m \ | \ A^\top z = 0, b^\top z = 1 \} \not = \emptyset }}\]
Note that we don’t need it to be \(1\), it just has to be \(\neq 0\).
In words: our LSE \(Ax = b\) does not have any solutions if and only if there exists a vector \(z\) that is orthogonal to all columns of \(A\) but not orthogonal to \(b\).
The blue vector \(z\) is orthogonal to all in \(C(A)\), the blue subspace. If \(b\) is not orthogonal to \(z\), this means that it cannot possibly be in the subspace, it must be slightly above/below it. Therefore \(b \not \in C(A)\) and thus there's no solution.
Field-by-field Comparison
Field
Before
After
Text
<div><b>Certificate</b> of no solutions:\[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = \emptyset\]is <b>equivalent to:</b></div><br>\[{{c1:: \{z \in \mathbb{R}^m \ | \ A^\top z = 0, b^\top z = 1 \} \not = \emptyset }}\]<div>Note that we don’t need it to be \(1\), it just has to be \(\neq 0\).</div>
Extra
<i>In words</i>: our LSE \(Ax = b\) does not have any solutions if and only if there exists a vector \(z\) that is orthogonal to all columns of \(A\) but not orthogonal to \(b\).<br><br><img src="paste-ec06b0f642f6f657a4c518d3e69158b4b6efec24.jpg"><br>The blue vector \(z\) is orthogonal to all in \(C(A)\), the blue subspace.<br>If \(b\) is not orthogonal to \(z\), this means that it cannot possibly be in the subspace, it must be slightly above/below it. Therefore \(b \not \in C(A)\) and thus there's no solution.
Get \(C\) by taking the independent columns of \(A\) (those corresponding to the pivot columns in RREF)
Get \(R'\) by removing the \(0\) rows of the RREF form of \(A\).
Field-by-field Comparison
Field
Before
After
Front
To compute the CR decomposition, we:
Back
<div>Compute the RREF of \(A\)</div><ol><li>Get \(C\) by taking the independent columns of \(A\) (those corresponding to the pivot columns in RREF)</li><li>Get \(R'\) by removing the \(0\) rows of the RREF form of \(A\).</li></ol><div><img src="paste-6d1e5417f3fb9c6ffbcbc63fa2de4c554a3315b1.jpg"></div>
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda \in \mathbb{C}\) be an eigenvalue of \(A\), then {{c1::\(\lambda \in \mathbb{R}\)::property of the EW}}. Proof Included
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda \in \mathbb{C}\) be an eigenvalue of \(A\), then {{c1::\(\lambda \in \mathbb{R}\)::property of the EW}}. Proof Included
Proof \(v \in \mathbb{C}^n\) be EV of \(\lambda\). Thus we have \(Av = \lambda v\). Since \(A\) is symmetric we have \(A^ = A\). \[\begin{align} \overline{\lambda}||v||^2 &= \overline{\lambda} v^*v \\ &= (\lambda v)^*v \\ &= (Av)^*v = v^*A^*v \\ &= v^* Av \text{ (uses } A^* = A \text{) } \\ &= v^*\lambda v \\ &= \lambda ||v||^2 \end{align}\]Since \(v \neq 0\), then \(||v|| \neq 0\) and so \(\lambda = \overline{\lambda}\) thus \(\lambda \in \mathbb{R}\).
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda \in \mathbb{C}\) be an eigenvalue of \(A\), then {{c1::\(\lambda \in \mathbb{R}\)::property of the EW}}. <i>Proof Included</i>
Extra
<div><strong>Proof</strong> \(v \in \mathbb{C}^n\) be EV of \(\lambda\). Thus we have \(Av = \lambda v\). Since \(A\) is symmetric we have \(A^ = A\). \[\begin{align} \overline{\lambda}||v||^2 &= \overline{\lambda} v^*v \\ &= (\lambda v)^*v \\ &= (Av)^*v = v^*A^*v \\ &= v^* Av \text{ (uses } A^* = A \text{) } \\ &= v^*\lambda v \\ &= \lambda ||v||^2 \end{align}\]Since \(v \neq 0\), then \(||v|| \neq 0\) and so \(\lambda = \overline{\lambda}\) thus \(\lambda \in \mathbb{R}\).</div>
A minimiser of \(\min_{\hat{x} \in \mathbb{R}^n} || A\hat{x} - b||^2\) is also a solution of \(A^\top A \hat{x} = A^\top b\).
When \(A\) has independent columns the unique minimiser of \(\hat{x}\) is given by: \[ \hat{x} = {{c2::(A^\top A)^{-1} A^\top b }}\]
Field-by-field Comparison
Field
Before
After
Text
<div>A minimiser of \(\min_{\hat{x} \in \mathbb{R}^n} || A\hat{x} - b||^2\) is also a solution of \(A^\top A \hat{x} = A^\top b\).</div><div><br></div><div>When \(A\) has {{c1::<b>independent columns</b>}} the {{c1::<b>unique</b>}} minimiser of \(\hat{x}\) is given by: \[ \hat{x} = {{c2::(A^\top A)^{-1} A^\top b }}\]</div>
Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the non-zero eigenvalues of \(A^\top A\) are the same ones as of \(AA^\top\). Proof Included
Shared EWs: For \((A^\top A)v_k = \lambda_k v_k\) we get \(AA^\top A v_k = \lambda_k Av_k\) and thus \(Av_k\) EV and \(\lambda_k\) is an EW of \(AA^\top\).
Orthogonality: For \(j \neq k\) we have \((Av_j)^\top (Av_k) = v_j^\top A^\top Av_k = v_j^\top \lambda_k v_k = \lambda_k v_j^\top v_k = 0\)
Field-by-field Comparison
Field
Before
After
Text
<div>Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the {{c1::non-zero eigenvalues}} of {{c2::\(A^\top A\)}} are the same ones as of {{c2::\(AA^\top\)}}. <i>Proof Included</i></div>
Extra
<b>Shared EWs:</b> For \((A^\top A)v_k = \lambda_k v_k\) we get \(AA^\top A v_k = \lambda_k Av_k\) and thus \(Av_k\) EV and \(\lambda_k\) is an EW of \(AA^\top\).<br><br><b>Orthogonality:</b> For \(j \neq k\) we have \((Av_j)^\top (Av_k) = v_j^\top A^\top Av_k = v_j^\top \lambda_k v_k = \lambda_k v_j^\top v_k = 0\)<div></div><div></div>
Any degree \(n\) polynomial \(P(z) = a_n z^n + a_{n-1} z^{n-1} + \dots + a_1 z + a_0\) (with \(n \geq 1\) and \(a_n \neq 0\)) has at least one zero \(\lambda \in \mathbb{C}\) such that \(P(\lambda) = 0\).
Field-by-field Comparison
Field
Before
After
Front
What is the fundamental theorem of algebra?
Back
<div>Any degree \(n\) polynomial \(P(z) = a_n z^n + a_{n-1} z^{n-1} + \dots + a_1 z + a_0\) (with \(n \geq 1\) and \(a_n \neq 0\)) has at least one zero \(\lambda \in \mathbb{C}\) such that \(P(\lambda) = 0\).</div>
Suppose that \(\{x \in \mathbb{R}^n \ | \ Ax = b \} \not = \emptyset\). Then \[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = x_1 + N(A) \] where \(x_1 \in R(A)\) is unique such that \(Ax_1 = b\).
This means that if there's more than one solution to the system (i.e. the nullspace is not \(= \{0\}\)), then the set of all solutions is a specific solution + the entire nullspace.
Field-by-field Comparison
Field
Before
After
Text
Suppose that \(\{x \in \mathbb{R}^n \ | \ Ax = b \} \not = \emptyset\). Then \[ \{x \in \mathbb{R}^n \ | \ Ax = b \} = {{c1::x_1 + N(A) }}\] where {{c1:: \(x_1 \in R(A)\) is unique such that \(Ax_1 = b\)}}.
Extra
This means that if there's more than one solution to the system (i.e. the nullspace is not \(= \{0\}\)), then the set of all solutions is a specific solution + the entire nullspace.
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent rows?
Because \(rank(A) = r = m\) and thus \(n \geq m\)
\(C(A)\) spans \(\mathbb{R}^m\) (columns span the space)
\(R(A) \subseteq\) \(\mathbb{R}^n\)
There could be multiple \(x \in \mathbb{R}^n\) that map to \(T_A(x) = b\). We pick the one with the smallest norm \(||x||^2\).
We know \(x = x_r + x_n\) for \(x_r \in R(A)\) and \(x_n \in N(A)\) thus we pick \(x = x_r + 0\) to get the smallest norm.
Field-by-field Comparison
Field
Before
After
Front
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent rows?
Back
Because \(rank(A) = r = m\) and thus \(n \geq m\)<ul><li>\(C(A)\) spans \(\mathbb{R}^m\) (columns span the space)</li><li>\(R(A) \subseteq\) \(\mathbb{R}^n\)</li></ul>There could be multiple \(x \in \mathbb{R}^n\) that map to \(T_A(x) = b\). We pick the one with the smallest norm \(||x||^2\).<br><br>We know \(x = x_r + x_n\) for \(x_r \in R(A)\) and \(x_n \in N(A)\) thus we pick \(x = x_r + 0\) to get the smallest norm.<br><br><div> <img src="paste-4707a6f9abbe720721f1a4ab781ab8c8fda3c76a.jpg"></div>
For an eigenvalue \(\lambda\) of \(M\), \(\lambda + c\) is a real eigenvalue of the matrix \(M + cI\).
Intuitively this makes sense as by adding \(cI\) we're increasing the values on the diagonal, meaning we have to increase the value of \(\lambda\) by the same amount so that we get \(0\) again.
Field-by-field Comparison
Field
Before
After
Text
For an eigenvalue \(\lambda\) of \(M\), {{c1::\(\lambda + c\)}} is a real eigenvalue of the matrix {{c2::\(M + cI\)}}.
Extra
Intuitively this makes sense as by adding \(cI\) we're increasing the values on the diagonal, meaning we have to increase the value of \(\lambda\) by the same amount so that we get \(0\) again.
\(QQ^\top\) is the projection on the span of the \(q_i\)'s and thus also on the \(a_i\)'s (\(C(Q) = C(A)\)).
Thus \(QQ^\top A = A\) and therefore \(QR = QQ^\top A = A\).
Field-by-field Comparison
Field
Before
After
Front
Why does \(QR\) give \(A\)?
Back
\(QQ^\top\) is the projection on the span of the \(q_i\)'s and thus also on the \(a_i\)'s (\(C(Q) = C(A)\)).<br><br>Thus \(QQ^\top A = A\) and therefore \(QR = QQ^\top A = A\).
If \(b \neq 0\), \(\textbf{Sol}(A, b)\) is {{c1::not a subspace of \(\mathbb{R}^n\)}}.
Because it doesn't contain the zero vector!
If \(b \neq 0\), the the solution space is "shifted" off the origin:
Field-by-field Comparison
Field
Before
After
Text
If {{c2::\(b \neq 0\)}}, \(\textbf{Sol}(A, b)\) is {{c1::not a subspace of \(\mathbb{R}^n\)}}.
Extra
Because it doesn't contain the zero vector!<br><br>If \(b \neq 0\), the the solution space is "shifted" off the origin:<br><img src="paste-6a57d261438b0237aa2afbd05a1cb6e451fd99f1.jpg">
Let \(S\) be a subspace in \(\mathbb{R}^m\) and \(A\) a matrix whose columns are a basis of \(S\).
The projection matrix \(P\) to a matrix \(A\) is given by: {{c1::\(P = A (A^\top A)^{-1} A^\top\)}}
The projection of \(b \in \mathbb{R}^m\) to \(S\) is given by \(\text{proj}_S(b) = Pb\).
Note the condition for the columns to be a basis - this forces them to be independent, which means \(A^\top A\) invertible by Lemma 5.2.4.
Field-by-field Comparison
Field
Before
After
Text
Let \(S\) be a subspace in \(\mathbb{R}^m\) and \(A\) a matrix whose <b>columns</b> are a <b>basis</b> of \(S\).<br><br>The projection matrix \(P\) to a matrix \(A\) is given by: {{c1::\(P = A (A^\top A)^{-1} A^\top\)}}<br><br>The projection of \(b \in \mathbb{R}^m\) to \(S\) is given by \(\text{proj}_S(b) = Pb\).
Extra
Note the condition for the columns to be a basis - this forces them to be independent, which means \(A^\top A\) invertible by Lemma 5.2.4.
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
Name 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.
Name 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
Name 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>
Every symmetric PSD matrix \(M\) is a Gram matrix of an upper triangular matrix \(C\).
\(M = C^\top C\) is known as the Cholesky decomposition. Proof Included
Thus all PSD matrices are decomposable as \(C^\top C\) with \(C\) upper triangular!
Proof: Since \(M\) is symmetric PSD, we can say \(M = V \Lambda V^\top\) with \(\Lambda\) diagonal matrix with EWs in the diagonal.
Since \(M\) is PSD, the eigenvalues (the diagonals) of \(\Lambda\) are \(\geq 0\) (non-negative) and thus we can build \(\Lambda^{1/2}\) by taking the square root of each diagonal entry.
To make them be upper triangular, we take the QR-decomposition (\(V\Lambda^{1/2}\) has linearly independent columns) \((V \Lambda^{1/2})^\top = QR\) with \(Q\) such that \(Q^\top Q = I\) and \(R\) upper triangular.
We then have \(M = (V \Lambda^{1/2})(V \Lambda^{1/2})^\top\)\( = (QR)^\top (QR) = \)\(R^\top Q^\top Q R = R^\top R\)
Taking \(C = R\) we get \(M = C^\top C\).
Field-by-field Comparison
Field
Before
After
Text
Every symmetric PSD matrix \(M\) is a {{c1::Gram matrix of an upper triangular matrix}} \(C\).<br><br>\(M = {{c2::C^\top C}}\) is known as the {{c2::Cholesky decomposition}}.<br><i>Proof Included</i>
Extra
Thus all PSD matrices are decomposable as \(C^\top C\) with \(C\) upper triangular!<br><br><div><b>Proof:</b> Since \(M\) is symmetric PSD, we can say \(M = V \Lambda V^\top\) with \(\Lambda\) diagonal matrix with EWs in the diagonal. </div><div><ul><li>Since \(M\) is PSD, the eigenvalues (the diagonals) of \(\Lambda\) are \(\geq 0\) (non-negative) and thus we can build \(\Lambda^{1/2}\) by taking the square root of each diagonal entry.</li><li>To make them be upper triangular, we take the QR-decomposition (\(V\Lambda^{1/2}\) has linearly independent columns) \((V \Lambda^{1/2})^\top = QR\) with \(Q\) such that \(Q^\top Q = I\) and \(R\) upper triangular. </li><li>We then have \(M = (V \Lambda^{1/2})(V \Lambda^{1/2})^\top\)\( = (QR)^\top (QR) = \)\(R^\top Q^\top Q R = R^\top R\) </li></ul></div><div>Taking \(C = R\) we get \(M = C^\top C\).</div>
The \(\det\) of \(U\) upper (or lower) triangular is \(\det U = {{c1:: (u_{11})(u_{22}) \dots (u_{nn}) }}\). Intuition included
(The product of the diagonal entries.)
This is because any permutation except the \(\text{id}\) permutation chooses a \(0\) at least once.
Field-by-field Comparison
Field
Before
After
Text
The \(\det\) of \(U\) upper (or lower) triangular is \(\det U = {{c1:: (u_{11})(u_{22}) \dots (u_{nn}) }}\). <i>Intuition included</i>
Extra
(The product of the diagonal entries.)<br><br>This is because any permutation except the \(\text{id}\) permutation chooses a \(0\) at least once.
{{c3::The columns form an orthonormal basis for \(\mathbb{R}^n\).}}
Field-by-field Comparison
Field
Before
After
Text
<div>Assume \(Q\) is orthogonal and <b>square</b>. Then:</div><div><ul><li>{{c1::\(QQ^\top = I\)}}</li><li>{{c2::\(Q^{-1} = Q^\top\)}}</li><li>{{c3::The columns form an orthonormal basis for \(\mathbb{R}^n\).}}</li></ul></div><blockquote><ul>
</ul></blockquote>
Spectral Theorem: Any symmetric matrix \(A \in \mathbb{R}^{n \times n}\) has \(n\) real eigenvalues and {{c1::an orthonormal basis of \(\mathbb{R}^{n \times n}\) consisting of it's eigenvectors::EV}}.
Spectral Theorem: Any symmetric matrix \(A \in \mathbb{R}^{n \times n}\) has \(n\) real eigenvalues and {{c1::an orthonormal basis of \(\mathbb{R}^{n \times n}\) consisting of it's eigenvectors::EV}}.
Field-by-field Comparison
Field
Before
After
Text
<b>Spectral Theorem: </b>Any symmetric matrix \(A \in \mathbb{R}^{n \times n}\) has {{c1::\(n\) real eigenvalues::EW}} and {{c1::an orthonormal basis of \(\mathbb{R}^{n \times n}\) consisting of it's eigenvectors::EV}}.
If \(A^T A\) is invertible, we have a unique solution \(\hat{x}\) that satisfies the equation: \[ p = A\hat{x} = {{c1:: A (A^\top A)^{-1} A^\top b }}\]
If \(A^T A\) is invertible, we have a unique solution \(\hat{x}\) that satisfies the equation: \[ p = A\hat{x} = {{c1:: A (A^\top A)^{-1} A^\top b }}\]
From \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\) we can construct a formula for \(\mathbf{p}\):
\((A^\top A)^{-1}(A^\top A) \mathbf{\hat{x}} = (A^\top A)^{-1}A^\top \mathbf{b}\)
(\(A^\top A\) invertible if the columns of \(A\) are independent), which gives us:
\(A \mathbf{\hat{x}} = A (A^\top A)^{-1} A^\top \mathbf{b} = \mathbf{p}\).
Field-by-field Comparison
Field
Before
After
Text
<div>If \(A^T A\) is invertible, we have a unique solution \(\hat{x}\) that satisfies the equation: \[ p = A\hat{x} = {{c1:: A (A^\top A)^{-1} A^\top b }}\]</div>
Extra
From \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\) we can construct a formula for \(\mathbf{p}\): <br><br> \((A^\top A)^{-1}(A^\top A) \mathbf{\hat{x}} = (A^\top A)^{-1}A^\top \mathbf{b}\) <br><br>(\(A^\top A\) invertible if the columns of \(A\) are independent), which gives us:<br><br> \(A \mathbf{\hat{x}} = A (A^\top A)^{-1} A^\top \mathbf{b} = \mathbf{p}\).
Let \(A\) be an \(m \times n\) matrix with linearly independentcolumns. The QR decomposition is given by: \[ A = QR \]where
\(Q\) is an \(m \times n\) matrix with orthonormal columns (they are the output of Gram-Schmidt)
\(R\) is an upper triangular matrix given by \(R = Q^\top A\).
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A\) be an \(m \times n\) matrix with {{c1::<b>linearly independent</b>}}<b> </b>columns. The QR decomposition is given by: \[ A = QR \]where</div><div><ul><li>\(Q\) is {{c1::an \(m \times n\) matrix with orthonormal columns (they are the output of Gram-Schmidt) }}</li><li>\(R\) is {{c2:: an upper triangular matrix given by \(R = Q^\top A\)}}.</li></ul></div>
Scalar product properties: \(u, v, w \in \mathbb{R}^m\) be vectors and \(\lambda \in \mathbb{R}\) a scalar.
\(v \cdot w = w \cdot v\) (symmetry / commutatitivity
\((\lambda v) \cdot w = \lambda (v \cdot w)\) (scalars move freely)
\(u \cdot (v + w) = u \cdot v + u \cdot w\) and \((u + v) \cdot w = u\cdot w + v \cdot w\) (distributivity)
\(v \cdot v \geq 0\) with equality if and only if \(v = 0\) (positive definiteness
Field-by-field Comparison
Field
Before
After
Text
Scalar product properties: \(u, v, w \in \mathbb{R}^m\) be vectors and \(\lambda \in \mathbb{R}\) a scalar.<br><ol><li>{{c1::\(v \cdot w = w \cdot v\) (symmetry / commutatitivity}}</li><li>{{c2:: \((\lambda v) \cdot w = \lambda (v \cdot w)\) (scalars move freely)}}</li><li>{{c3:: \(u \cdot (v + w) = u \cdot v + u \cdot w\) and \((u + v) \cdot w = u\cdot w + v \cdot w\) (distributivity)}}</li><li>{{c4:: \(v \cdot v \geq 0\) with equality if and only if \(v = 0\) (positive definiteness}}</li></ol>
When doing Least Squares we represent our data as \(A\) and \(b\) which are?
\(A = \begin{bmatrix} 1 & t_1 \\ 1 & t_2 \\ \vdots & \vdots \\ 1 & t_{m-1} \\ 1 & t_m \end{bmatrix}\) is a matrix containing the coefficients for \(\alpha_0\) and \(\alpha_1\) in our fitting equation, so here \(\alpha_1 t + \alpha_0\).
\(b = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{pmatrix}\) is the vector with the result of each equation (the datapoints).
Field-by-field Comparison
Field
Before
After
Front
When doing Least Squares we represent our data as \(A\) and \(b\) which are?
Back
\(A = \begin{bmatrix} 1 & t_1 \\ 1 & t_2 \\ \vdots & \vdots \\ 1 & t_{m-1} \\ 1 & t_m \end{bmatrix}\) is a matrix containing the coefficients for \(\alpha_0\) and \(\alpha_1\) in our fitting equation, so here \(\alpha_1 t + \alpha_0\).<br><br>\(b = \begin{pmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{pmatrix}\) is the vector with the result of each equation (the datapoints).
Let \(A \in \mathbb{R}^{m \times n}\) and \(x, y \in C(A^\top)\).
We have: \[ Ax = Ay \Leftrightarrow x = y \]
This is because \(x, y\) have unique decompositions into the two fundamental subspaces. \[ Ax = Ay \Leftrightarrow x - y \in N(A) \Leftrightarrow \](this holds as \(\implies A(x - y) = 0\)).
\[x^\top(x - y) = 0 = y^\top(x - y) \Leftrightarrow\]because of orthogonality of the subspaces\[ (x - y)^\top(x - y) = 0 \]and from this follows that \(||x - y||^2 = 0 \implies x - y = 0\).
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{m \times n}\) and \(x, y \in C(A^\top)\). <br><br>We have: \[ {{c1::Ax = Ay}} \Leftrightarrow {{c2:: x = y }}\]
Extra
This is because \(x, y\) have unique decompositions into the two fundamental subspaces. \[ Ax = Ay \Leftrightarrow x - y \in N(A) \Leftrightarrow \](this holds as \(\implies A(x - y) = 0\)).<br><br>\[x^\top(x - y) = 0 = y^\top(x - y) \Leftrightarrow\]because of orthogonality of the subspaces\[ (x - y)^\top(x - y) = 0 \]and from this follows that \(||x - y||^2 = 0 \implies x - y = 0\).
Exchanging two rows flips the sign of the determinant.
Subtracting two rows does not change the \(\det\). (we can use Gauss-Jordan (only row substractions) to simplify calculations…)
Field-by-field Comparison
Field
Before
After
Text
<ol>
<li>{{c1::\(\det(A) = \det(A^T)\)}}</li><li>\(\det(I) = {{c2::1}}\)</li><li>\(\det(A) = 0\) if {{c3::linearly dependent columns.}}</li><li>{{c4::Exchanging two rows flips the sign of the determinant.::Effect of row exchange?}}</li><li>{{c5::Subtracting two rows does not change the \(\det\). (we can use Gauss-Jordan (only row substractions) to simplify calculations…)::Subtraction}}</li></ol>
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \det(A) = {{c1:: \prod_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Be careful to include each eigenvalue as often as their algebraic multiplicity in these sums/products. You can use this to double check calculations.
Intuition: The eigenvalues describe how much each eigenvector is scaled. Thus by multiplying the scaling of each dimension, we can figure out the volume of the unit cube which is the determinant.
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \det(A) = {{c1:: \prod_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Extra
<div><strong>Be careful</strong> to include each eigenvalue as often as their <em>algebraic multiplicity</em> in these sums/products. You can use this to double check calculations.</div><div><br></div><div><i>Intuition:</i> The eigenvalues describe how much each eigenvector is scaled. Thus by multiplying the scaling of each dimension, we can figure out the <i>volume of the unit cube</i> which is the determinant.</div>
\(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices. The matrix \(A\) has a complete set of real eigenvectors if and only if \(B\) does . Proof Included
\(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices. The matrix \(A\) has a complete set of real eigenvectors if and only if \(B\) does . Proof Included
Proof \(\lambda, v\) EW, EV pair for matrix \(A\) iff \(Av = \lambda v \Leftrightarrow \lambda S^{-1}v = S^{-1}Av = S^{-1}ASS^{-1}v = B(S^{-1}v)\).
Field-by-field Comparison
Field
Before
After
Text
\(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices. The matrix \(A\) has {{c1::a complete set of real eigenvectors if and only if \(B\) does :: EVs}}. <i>Proof Included</i>
Extra
<div><b>Proof </b>\(\lambda, v\) EW, EV pair for matrix \(A\) iff \(Av = \lambda v \Leftrightarrow \lambda S^{-1}v = S^{-1}Av = S^{-1}ASS^{-1}v = B(S^{-1}v)\)<b>.</b></div>
\(\textbf{Sol}(A, 0) = \textbf{N}(A)\) as we search for the zeros. We thus first find the nullspace, and then shift it by an arbitrary solution of \(Ax = b\). Let \(s\) be some solution of \(Ax = b\). Then \[ \textbf{Sol}(A, b) = \{s + x : x \in \textbf{N}(A)\} \]
Field-by-field Comparison
Field
Before
After
Front
Express \(\text{Sol}(A, b)\) in standard form:
Back
\(\textbf{Sol}(A, 0) = \textbf{N}(A)\) as we search for the zeros. We thus first find the nullspace, and then shift it by an arbitrary solution of \(Ax = b\).<br>Let \(s\) be some solution of \(Ax = b\). Then \[ \textbf{Sol}(A, b) = \{s + x : x \in \textbf{N}(A)\} \]
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)\)}}
Using QR decomposition the normal equations \(A^\top A x = A^\top b\) simplify to:
\(A^\top A = (QR)^\top (QR) = R^\top Q^\top Q R= R^\top R\) and thus we get:\[ R^\top R \hat{x} = R^\top Q^\top b \]Since \(R\) is invertible we simplify to: \[ R\hat{x} = Q^\top b \]which can efficiently be solved by back substitution since \(R\) is a triangular matrix.
Field-by-field Comparison
Field
Before
After
Front
Using QR decomposition the normal equations \(A^\top A x = A^\top b\) simplify to:
Back
\(A^\top A = (QR)^\top (QR) = R^\top Q^\top Q R= R^\top R\) and thus we get:\[ R^\top R \hat{x} = R^\top Q^\top b \]Since \(R\) is invertible we simplify to: \[ R\hat{x} = Q^\top b \]which can efficiently be solved by back substitution since \(R\) is a triangular matrix.<br><img src="paste-bba0016ef7ccad1dad42a31c02e8c787f3e3dea9.jpg">
Let \(T :V \rightarrow W\) be a bijective linear transformation between vector spaces \(V\) and \(W\) . Let \(B = {v1, v2, . . . , v_l} \subseteq V\) be a finite set of size \(l\), and let \[ T(B) = {T(v_1), T(v_2), \dots, T(v_l)} \subseteq Q \] be the transformed set.
Then \(|T(B)| = |B|\). Moreover, \(B\) is a basis of \(V\) if and only if \(T(B)\) is a basis of \(W\). We therefore also have \(\dim(V) = \dim(W)\).
Let \(T :V \rightarrow W\) be a bijective linear transformation between vector spaces \(V\) and \(W\) . Let \(B = {v1, v2, . . . , v_l} \subseteq V\) be a finite set of size \(l\), and let \[ T(B) = {T(v_1), T(v_2), \dots, T(v_l)} \subseteq Q \] be the transformed set.
Then \(|T(B)| = |B|\). Moreover, \(B\) is a basis of \(V\) if and only if \(T(B)\) is a basis of \(W\). We therefore also have \(\dim(V) = \dim(W)\).
This holds because of the bijectivity of the linear transformation.
Further, if there is one such bijective transformation, then we call the vector spaces isomorphic and \(T\) an isomorphism between \(V\) and \(W\) (Definition 4.28).
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(T :V \rightarrow W\) be a bijective linear transformation between vector spaces \(V\) and \(W\) . Let \(B = {v1, v2, . . . , v_l} \subseteq V\) be a finite set of size \(l\), and let \[ T(B) = {T(v_1), T(v_2), \dots, T(v_l)} \subseteq Q \] be the transformed set.</div><div><br></div><div>Then {{c1::\(|T(B)| = |B|\)::cardinality comparison}}. Moreover, \(B\) is a basis of \(V\) if and only if {{c1::\(T(B)\) is a basis of \(W\)}}. We therefore also have {{c1::\(\dim(V) = \dim(W)\)}}.</div>
Extra
This holds because of the bijectivity of the linear transformation.<br><br>Further, if there is one such bijective transformation, then we call the vector spaces <i>isomorphic</i> and \(T\) an <i>isomorphism</i> between \(V\) and \(W\) (Definition 4.28).
Subspaces are orthogonal if their basis-vectors are orthogonal.
We can determine if two subspaces are orthogonal by only comparing their basis vectors, since if they are orthogonal, all their linear combinations will be as well.
Field-by-field Comparison
Field
Before
After
Text
Subspaces are orthogonal if {{c1::their basis-vectors are orthogonal::in terms of basis}}.
Extra
<div>We can determine if two <strong>subspaces are orthogonal by only comparing their basis vectors</strong>, since if they are orthogonal, all their linear combinations will be as well.</div>
Multilinearity of the determinant:\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = {{c1:: t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} }}\]
Field-by-field Comparison
Field
Before
After
Text
Multilinearity of the determinant:\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = {{c1:: t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} }}\]
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1,\lambda_2 \in \mathbb{R}\) be two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\):
\(v_1\) and \(v_2\) are orthogonal. Proof Included
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1,\lambda_2 \in \mathbb{R}\) be two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\):
\(v_1\) and \(v_2\) are orthogonal. Proof Included
Proof \(\lambda_1 v_1 ^\top v_2 = (Av_1)^\top v_2 = v_1^\top A ^\top v_2 = v_1^\top (Av_2) = \lambda_2 v_1^\top v_2\) Thus \(v_1^\top v_2\) must be \(0\).
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1,\lambda_2 \in \mathbb{R}\) be two {{c2::distinct}} eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\):</div><div><br></div><div>\(v_1\) and \(v_2\) are {{c1::orthogonal:: property}}. <i>Proof Included</i></div>
Extra
<div><b>Proof</b> \(\lambda_1 v_1 ^\top v_2 = (Av_1)^\top v_2 = v_1^\top A ^\top v_2 = v_1^\top (Av_2) = \lambda_2 v_1^\top v_2\) Thus \(v_1^\top v_2\) must be \(0\).</div>
A matrix has a complete set of real eigenvectors if all its eigenvalues are real and the geometric multiplicities are the same as the algebraic multiplicities of all it's eigenvalues.
A matrix has a complete set of real eigenvectors if all its eigenvalues are real and the geometric multiplicities are the same as the algebraic multiplicities of all it's eigenvalues.
Example \(I\) has eigenvalue \(1\) with geometric multiplicity \(n\) (\(\dim(N(I - 1 \cdot I)) = n\)) and algebraic multiplicity \(n\) (As the characteristic polynomial of \(I\), \(P(z) = (z - 1)(z - 1) \dots (z - 1)\) with that repeated \(n\) times).
Field-by-field Comparison
Field
Before
After
Text
A matrix has a <b>complete set of real eigenvectors</b> if {{c1::all its eigenvalues are real and the geometric multiplicities are the same as the algebraic multiplicities of all it's eigenvalues::in terms of multiplicities}}.
Extra
<div><strong>Example</strong> \(I\) has eigenvalue \(1\) with geometric multiplicity \(n\) (\(\dim(N(I - 1 \cdot I)) = n\)) and algebraic multiplicity \(n\) (As the characteristic polynomial of \(I\), \(P(z) = (z - 1)(z - 1) \dots (z - 1)\) with that repeated \(n\) times).</div>
Let \(Q\) be the \(m \times n\) matrix whose columns are an orthonormal basis of \(A\).
Then the least squares solution \(Qx = b\) is given by {{c1:: \(\hat{x} = Q^\top b\)}}.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(Q\) be the \(m \times n\) matrix whose columns are an orthonormal basis of \(A\).</div><div><br></div><div>Then the least squares solution \(Qx = b\) is given by {{c1:: \(\hat{x} = Q^\top b\)}}.</div>
For RREF on \(A, I\) we get \(R, M\) with the property that \(R = MA\) and \(M\) invertible.
Field-by-field Comparison
Field
Before
After
Text
For RREF on \(A, I\) we get \(R, M\) with the property that {{c1::\(R = MA\)::equation}} and {{c1::\(M\) invertible:: property of M}}.
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.
Give an example of a matrix with complex valued EWs:
Eigenvalues of the \(90^\circ\) degree counterclockwise rotation matrix \(A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\).
The solutions to \(0 = \det(A - \lambda I) = -\lambda \cdot -\lambda - 1 \cdot (-1) = \lambda^2 + 1\) which are \(\lambda_1 = i\) and \(\lambda_2 = -i\). The eigenvectors are given by \(v_1 = \begin{pmatrix} i \\ 1 \end{pmatrix}\) \(v_2 = \begin{pmatrix} -i \\ 1 \end{pmatrix}\).
This makes sense because the only vector staying on it's axis in a 2d rotation of a plane by \(90^\circ\) is the vector pointing straight up, out from the plane.
Field-by-field Comparison
Field
Before
After
Front
Give an example of a matrix with complex valued EWs:
Back
Eigenvalues of the \(90^\circ\) degree counterclockwise rotation matrix \(A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\).<br><br>The solutions to \(0 = \det(A - \lambda I) = -\lambda \cdot -\lambda - 1 \cdot (-1) = \lambda^2 + 1\) which are \(\lambda_1 = i\) and \(\lambda_2 = -i\). The eigenvectors are given by \(v_1 = \begin{pmatrix} i \\ 1 \end{pmatrix}\) \(v_2 = \begin{pmatrix} -i \\ 1 \end{pmatrix}\).<br><br>This makes sense because the only vector staying on it's axis in a 2d rotation of a plane by \(90^\circ\) is the vector pointing straight up, out from the plane.
What are the four Moore-Penrose conditions?<br><ol><li>{{c1::\(AA^\dagger A = A\)}}<br></li><li>{{c2::\(A^\dagger A A^\dagger = A^\dagger\)}}<br></li><li>{{c3::\((AA^\dagger )^\top = AA^\dagger \)}}</li><li>{{c4::\((A^\dagger A)^\top = A^\dagger A\)}}<br></li></ol>
We say that \(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices if {{c2::there exists an invertible matrix \(S\) such that \(B = S^{-1}AS\)}}.
We say that \(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are similar matrices if {{c2::there exists an invertible matrix \(S\) such that \(B = S^{-1}AS\)}}.
Field-by-field Comparison
Field
Before
After
Text
We say that \(A \in \mathbb{R}^{n \times n}\) and \(B \in \mathbb{R}^{n \times n}\) are {{c1::similar matrices}} if {{c2::there exists an invertible matrix \(S\) such that \(B = S^{-1}AS\)}}.
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \text{Tr}(A) = {{c1:: \sum_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Quite surprising, since the determinant and trace are \(\in \mathbb{R}\) where the eigenvalues in general must not be? It holds because complex eigenvalues \(z_1, z_2\) always show up in pairs: \(z_1 = \overline{z_2}\). And because \(z_1 \cdot \overline{z_1} = a^2 + b^2\) and \(z_1 + \overline{z_1} = 2a\).
Field-by-field Comparison
Field
Before
After
Text
Let \(A \in \mathbb{R}^{n \times n}\) and \(\lambda_1, \dots, \lambda_n\) its \(n\) eigenvalues. Then \[ \text{Tr}(A) = {{c1:: \sum_{i = 1}^n \lambda_i :: \text{in terms of EWs} }}\]
Extra
Quite surprising, since the determinant and trace are \(\in \mathbb{R}\) where the eigenvalues in general must not be?<br>It holds because complex eigenvalues \(z_1, z_2\) always show up in pairs: \(z_1 = \overline{z_2}\). And because \(z_1 \cdot \overline{z_1} = a^2 + b^2\) and \(z_1 + \overline{z_1} = 2a\).
If we have \(A\) with eigenvalues \(0, 1, 2\) then \(I + A^2\) has eigenvalues?
We have \(\lambda^2\) eigenvalues of \(A^2\) by lemma script. Thus \(0, 1, 4\) are EWs. Then \(1 + \lambda^2\) are the eigenvalues of \(I + A^2\) thus \(1, 2, 5\) are the EWs.
Field-by-field Comparison
Field
Before
After
Front
If we have \(A\) with eigenvalues \(0, 1, 2\) then \(I + A^2\) has eigenvalues?
Back
We have \(\lambda^2\) eigenvalues of \(A^2\) by lemma script. Thus \(0, 1, 4\) are EWs.<br>Then \(1 + \lambda^2\) are the eigenvalues of \(I + A^2\) thus \(1, 2, 5\) are the EWs.
Then the transpose \(A^T\) is also invertible and: \( (A^T)^{-1} = \) {{c1:: \((A^{-1})^T \)}}
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an \(m \times m\) invertible matrix.<br><br>Then the transpose \(A^T\) is also invertible and: \( (A^T)^{-1} = \) {{c1:: \((A^{-1})^T \)}}
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 exact same vector of coefficients.
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 exact same vector of coefficients.<div><br></div><div>Linear combinations are unique if all vectors are independent.</div>
How do we find a basis for the row space \(R(A) = C(A^\top)\)?
The first \(r\) columns of \(R^\top\) where \(R\) is the RREF of \(A\) form a basis of the row space (the non-zero rows). In particular \(\dim(\textbf{R}(A)) = r\)
This works because as noted before, multiplying by an invertible matrix \(M\) does not change the row-space of \(MA\) on the left.
Field-by-field Comparison
Field
Before
After
Front
How do we find a basis for the row space \(R(A) = C(A^\top)\)?
Back
The first \(r\) columns of \(R^\top\) where \(R\) is the RREF of \(A\) form a basis of the row space (the non-zero rows). In particular \(\dim(\textbf{R}(A)) = r\)<br><br><div>This works because as noted before, multiplying by an invertible matrix \(M\) does not change the row-space of \(MA\) on the left.</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>
A vector \(v \in \mathbb{R}^n \setminus \{0\}\) is an eigenvector associated with the eigenvalue \(\lambda\) if and only if \(v \in N(A - \lambda I)\).
A vector \(v \in \mathbb{R}^n \setminus \{0\}\) is an eigenvector associated with the eigenvalue \(\lambda\) if and only if \(v \in N(A - \lambda I)\).
Field-by-field Comparison
Field
Before
After
Text
A vector \(v \in \mathbb{R}^n \setminus \{0\}\) is {{c1::an eigenvector associated with the eigenvalue \(\lambda\)}} if and only if {{c2::\(v \in N(A - \lambda I)\)::subspace}}.
Vectors \(q_1, \dots, q_n \in \mathbb{R}^m\) are orthonormal if they are orthogonal and have norm \(1\).
In other words, for all \(i, j \in \{1, \dots, n\}\): \[ q_i^\top q_j = {{c1::\delta_{ij} }}\]
Field-by-field Comparison
Field
Before
After
Text
Vectors \(q_1, \dots, q_n \in \mathbb{R}^m\) are orthonormal if {{c1::they are orthogonal and have norm \(1\)}}. <br><br>In other words, for all \(i, j \in \{1, \dots, n\}\): \[ q_i^\top q_j = {{c1::\delta_{ij} }}\]
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\)}}.
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\), let {{c1:: \(S \in \mathbb{R}^{m \times r}\) and \(T \in \mathbb{R}^{r \times n}\)}} such that \(A = ST\). Then \[ A^\dagger = T^\dagger S^\dagger \]
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\), let {{c1:: \(S \in \mathbb{R}^{m \times r}\) and \(T \in \mathbb{R}^{r \times n}\)}} such that \(A = ST\). Then \[ A^\dagger = T^\dagger S^\dagger \]
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\), let {{c1:: \(S \in \mathbb{R}^{m \times r}\) and \(T \in \mathbb{R}^{r \times n}\)}} such that \(A = ST\). Then \[ A^\dagger ={{c2:: T^\dagger S^\dagger }}\]
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><i>This essentially means that: the length of the projecton of v onto w is smaller than the both of their lengths multiplied.<br>This explains the equality part: if they are already aligned, their projection doesn't lose any length...</i>
We can view the matrix-vector product \(Ax\) in two ways:
Row view: The result is a vector where each entry is the scalar product of row \(i\) of \(A\) with \(x\): \((Ax)_{i} = A_i^\top x\).
Column view: The resulting vector is a linear combination of the columns of \(A\).
Field-by-field Comparison
Field
Before
After
Front
We can view the matrix-vector product \(Ax\) in two ways:
Back
<ul><li>Row view: The result is a vector where each entry is the scalar product of row \(i\) of \(A\) with \(x\): \((Ax)_{i} = A_i^\top x\).</li><li>Column view: The resulting vector is a linear combination of the columns of \(A\).</li></ul>
When solving Least Squares (asking for a minimiser of \(||Ax - b||^2\)) we are asking \(Ax\) to be the projection of \(b\) onto \(C(A)\).
Least Squares is basically projection without multiplying by \(A\) at the end.
It's also basically the Pseudoinverse.
Field-by-field Comparison
Field
Before
After
Text
When solving Least Squares (asking for a minimiser of \(||Ax - b||^2\)) we are asking {{c1::\(Ax\) to be the projection of \(b\) onto \(C(A)\)}}.
Extra
Least Squares is basically projection without multiplying by \(A\) at the end.<br><br>It's also basically the Pseudoinverse.
By multilinearity, \(\det(\alpha A) = \) \(\alpha^n \det(A)\)Intuition included
the scaling affects all rows equally, thus the unit cube is scaled in all dimensions (power of n).
In other words, we have to extract \(\alpha\) from each row using multilinearity.
Field-by-field Comparison
Field
Before
After
Text
By multilinearity, \(\det(\alpha A) = \) {{c1:: \(\alpha^n \det(A)\)}} <i>Intuition included</i>
Extra
the scaling affects all rows equally, thus the unit cube is scaled in all dimensions (power of n).<br><br>In other words, we have to extract \(\alpha\) from each row using <b>multilinearity</b>.
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.
For \(A\) and \(MA\) (\(M\) invertible) they have:
the independent columns at the same indices
the same rank
Field-by-field Comparison
Field
Before
After
Text
For \(A\) and \(MA\) (\(M\) invertible) they have:<br><ul><li>the independent columns {{c1:: at the same indices}}</li><li>the same {{c1::rank}}</li></ul>
Theorem: A matrix \(A \in \mathbb{R}^{m \times n}\) of rank \(r\) can be written as the matrix-matrix product \[ A = C R’ \] where \(C\) is the \(m \times r\) submatrix containing the independent columns and the unique \(R’ \in \mathbb{R}^{r \times n}\) matrix.
Theorem: A matrix \(A \in \mathbb{R}^{m \times n}\) of rank \(r\) can be written as the matrix-matrix product \[ A = C R’ \] where \(C\) is the \(m \times r\) submatrix containing the independent columns and the unique \(R’ \in \mathbb{R}^{r \times n}\) matrix.
Field-by-field Comparison
Field
Before
After
Text
<div><b>Theorem</b>: A matrix \(A \in \mathbb{R}^{m \times n}\) of rank \(r\) can be written as the matrix-matrix product \[ A = C R’ \] where \(C\) is the \(m \times r\) submatrix containing {{c1:: the independent columns}} and the <b>unique</b> \(R’ \in \mathbb{R}^{r \times n}\) matrix.</div>
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}\)
\(\lambda \in \mathbb{R}\) is a real eigenvalue of \(A\) if and only if \(\det(A - \lambda I) = 0\).
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(A \in \mathbb{R}^{n \times n}\).</div><div>\(\lambda \in \mathbb{R}\) is a {{c1::real eigenvalue}} of \(A\) if and only if {{c2::\(\det(A - \lambda I) = 0\)}}. </div>
For a full row rank matrix \(A\), the unique solution to\[{{c1:: \min_{x \in \mathbb{R}^n} ||x||^2 \text{ s.t. } Ax = b}}\] is given by the vector \(\hat{x} = A^\dagger b\). This \(\hat{x}\) is in \(C(A^\top)\). Proof Included
For a full row rank matrix \(A\), the unique solution to\[{{c1:: \min_{x \in \mathbb{R}^n} ||x||^2 \text{ s.t. } Ax = b}}\] is given by the vector \(\hat{x} = A^\dagger b\). This \(\hat{x}\) is in \(C(A^\top)\). Proof Included
Proof
By Lemma 6.4.5 we only need to show that \(\hat{x} = A^\dagger b\) satisfies \(A \hat{x} = b\) and that \(\hat{x} \in C(A^\top)\).
\(A\hat{x} = AA^\dagger b = AA^\top (AA^\top)^{-1}b = b\)
\(\hat{x} = A^\dagger b = A^\top ((AA^\top)^{-1} b) = A^\top y\) for some \(y\) thus \(x \in C(A^\top)\).
Field-by-field Comparison
Field
Before
After
Text
<div>For a <b>full row rank</b> matrix \(A\), the unique solution to\[{{c1:: \min_{x \in \mathbb{R}^n} ||x||^2 \text{ s.t. } Ax = b}}\] is given by the vector \(\hat{x} = A^\dagger b\). This \(\hat{x}\) is in {{c1:: \(C(A^\top)\)}}. <i>Proof Included</i></div>
Extra
<div><strong>Proof</strong> </div><div>By Lemma 6.4.5 we only need to show that \(\hat{x} = A^\dagger b\) satisfies \(A \hat{x} = b\) and that \(\hat{x} \in C(A^\top)\).</div><div><ul><li>\(A\hat{x} = AA^\dagger b = AA^\top (AA^\top)^{-1}b = b\) </li><li>\(\hat{x} = A^\dagger b = A^\top ((AA^\top)^{-1} b) = A^\top y\) for some \(y\) thus \(x \in C(A^\top)\).</li></ul></div>
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}}.
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent columns?
Because \(rank(A) = r = n\) and thus \(m \geq n\)
\(R(A)\) spans \(\mathbb{R}^n\)(rows span the space)
\(C(A) \subseteq\) \(\mathbb{R}^m\) (as \(A\) is not necessarily square)
We therefore first project \(b\) into \(C(A)\) and then invert, which is Least Squares.
Field-by-field Comparison
Field
Before
After
Front
What is the pseudoinverse in the case where \(A \in \mathbb{R}^{n \times m}\) has independent columns?
Back
Because \(rank(A) = r = n\) and thus \(m \geq n\)<br><ul><li>\(R(A)\) spans \(\mathbb{R}^n\)(rows span the space)</li><li>\(C(A) \subseteq\) \(\mathbb{R}^m\) (as \(A\) is not necessarily square)</li></ul><div>We therefore first project \(b\) into \(C(A)\) and then invert, which is <b>Least Squares.</b></div><br><div> <img src="paste-455009459e5a5c70fa5574bdbcedcfb838341523.jpg"></div>
Then \(\dim(V)\) the dimension of \(V\) is the size of an arbitrary basis \(B\) of \(V\).
Field-by-field Comparison
Field
Before
After
Text
Let \(V\) be a finitely generated vector space.<br><br>Then {{c2::\(\dim(V)\) the dimension of \(V\)}} is {{c1::the size of an arbitrary basis \(B\) of \(V\)::given by which basis property?}}.
Let \(V\) and \(W\) be orthogonal subspaces of \(\mathbb{R}^n\). Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
The set of vectors \({v_1, \dots, v_k, w_1, \dots, w_l}\) is linearly independent.
Let \(V\) and \(W\) be orthogonal subspaces of \(\mathbb{R}^n\). Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
The set of vectors \({v_1, \dots, v_k, w_1, \dots, w_l}\) is linearly independent.
As all vectors are pairwise linearly independent, their union is also linearly independent. Therefore the union of two bases is still a basis of the sum of their subspaces:
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) and \(W\) be orthogonal subspaces of \(\mathbb{R}^n\). Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).</div><div><br></div><div>The set of vectors \({v_1, \dots, v_k, w_1, \dots, w_l}\) is {{c1::linearly independent}}.</div>
Extra
As all vectors are pairwise linearly independent, their <i>union is also linearly independent</i>. Therefore the <i>union of two bases is still a basis</i> of the sum of their subspaces:
Let \(S^\perp\) be the orthogonal complement of \(S\) and \(P\) the projection matrix onto \(S\).
Then \(I - P\) is the projection matrix that maps {{c2::\(b \in \mathbb{R}^m\) to \(\text{proj}_{S^\perp}(b)\)}}.
Proof Included
Since \(b = e + \text{proj}_S(b) = e + Pb\) with \(e \in S^\perp\) Thus \[ (I - P)b = b - Pb = e = \text{proj}_{S^\perp}(b) \]This is true, since it holds that indeed \(I - P\) is also idempotent: \((I - P)^2 = I - 2P + P^2 = I -P - P + P= I - P\)
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(S^\perp\) be the orthogonal complement of \(S\) and \(P\) the projection matrix onto \(S\).</div><div><br></div><div>Then {{c1::\(I - P\)}} is the projection matrix that maps {{c2::\(b \in \mathbb{R}^m\) to \(\text{proj}_{S^\perp}(b)\)}}.<br><br><i>Proof Included</i><br></div>
Extra
Since \(b = e + \text{proj}_S(b) = e + Pb\) with \(e \in S^\perp\) Thus \[ (I - P)b = b - Pb = e = \text{proj}_{S^\perp}(b) \]This is true, since it holds that indeed \(I - P\) is also idempotent: \((I - P)^2 = I - 2P + P^2 = I -P - P + P= I - P\)
Let \(A \in \mathbb{R}^{3 \times 3}\) be symmetric with eigenvalues \(−2, 1, 3\). What are the singular values of \(A\)?
The singular values are the square roots of the eigenvalues of \(A^\top A\)(or \(AA^\top\)).
As \(A^\top = A \), we have the eigenvalues \(\lambda^2\) for \(A^\top A = A^2\). Thus we have \(\sigma_i = \sqrt{\lambda_i^2}\) which is \(2, 1, 3\).
Field-by-field Comparison
Field
Before
After
Front
Let \(A \in \mathbb{R}^{3 \times 3}\) be symmetric with eigenvalues \(−2, 1, 3\).<br>What are the singular values of \(A\)?
Back
The singular values are the <b>square roots</b> of the eigenvalues of \(A^\top A\)(or \(AA^\top\)).<br><br>As \(A^\top = A \), we have the eigenvalues \(\lambda^2\) for \(A^\top A = A^2\). Thus we have \(\sigma_i = \sqrt{\lambda_i^2}\) which is \(2, 1, 3\).
Given a permutation matrix \(P \in \mathbb{R}^{n \times n}\) corresponding to a permutation \(\sigma\), then \(\det(P) = {{c1::\text{sgn}(\sigma)}}\)
(this is as \(P\) is also an orthogonal matrix, see 3.). We sometimes write \(\text{sgn}(P)\).
For the permutation matrix, each row contains only one entry: a \(1\). Thus the only permutation \(\sigma\) in the product that doesn't have a \(0\) factor is the permutation corresponding to the matrix \(P\) itself. The product is \(1 \cdot 1 \dots \cdot 1\) thus we get \(\text{sgn}(\sigma) = \text{sgn}(P)\).
Field-by-field Comparison
Field
Before
After
Text
Given a permutation matrix \(P \in \mathbb{R}^{n \times n}\) corresponding to a permutation \(\sigma\), then \(\det(P) = {{c1::\text{sgn}(\sigma)}}\)
Extra
(this is as \(P\) is also an orthogonal matrix, see 3.). We sometimes write \(\text{sgn}(P)\).<br><br>For the permutation matrix, each row contains only one entry: a \(1\). Thus the only permutation \(\sigma\) in the product that doesn't have a \(0\) factor is the permutation corresponding to the matrix \(P\) itself. The product is \(1 \cdot 1 \dots \cdot 1\) thus we get \(\text{sgn}(\sigma) = \text{sgn}(P)\).
Assume \(A \in \mathbb{R}^{m \times n}\) has linearly independent rows.
Since the rows are linearly independent, the only solution to \(z^\top A = 0\) is \(z = 0\). Hence \(z^\top b = 0 \neq 1\).
Thus \(P\) always contains a solution.
Field-by-field Comparison
Field
Before
After
Text
Applications of the certificate of no solutions:<br><br>Assume \(A \in \mathbb{R}^{m \times n}\) has <b>linearly independent rows</b>.<br><br>Since {{c1::the rows are linearly independent}}, the only solution to \(z^\top A = 0\) is {{c2::\(z = 0\)}}. Hence {{c2::\(z^\top b = 0 \neq 1\)}}.<br><br>Thus {{c3::\(P\) always contains a solution}}.
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\).
Give an example of the <b>compact form</b> of the SVD for \(A \in \mathbb{R}^{4 \times 5}\) with \(\text{rank}(A) = 3\): (name the dimensions)
Back
\[A = U_3 \Sigma_3 V_3^T = \begin{bmatrix} | & | & | \\ \mathbf{u}_1 & \mathbf{u}_2 & \mathbf{u}_3 \\ | & | & | \end{bmatrix} \begin{bmatrix} \sigma_1 & 0 & 0 \\ 0 & \sigma_2 & 0 \\ 0 & 0 & \sigma_3 \end{bmatrix} \begin{bmatrix} - & \mathbf{v}_1^T & - \\ - & \mathbf{v}_2^T & - \\ - & \mathbf{v}_3^T & - \end{bmatrix}\]<br>where \(U_3\) is \(4 \times 3\), \(\Sigma_3\) is \(3 \times 3\), and \(V_3^T\) is \(3 \times 5\).
Pseudoinverse from the SVD: \(A = U \Sigma V^\top\)
\(A^\dagger = V \Sigma^\dagger U^\top\)where \(\Sigma^\dagger\) is obtained from \(\Sigma\) by taking the reciprocal (\(\frac{1}{\sigma_i}\)) of each non-zero singular value, leaving the zeros in place, and transposing the matrix.
Field-by-field Comparison
Field
Before
After
Front
Pseudoinverse from the SVD: \(A = U \Sigma V^\top\)
Back
\(A^\dagger = V \Sigma^\dagger U^\top\)where \(\Sigma^\dagger\) is obtained from \(\Sigma\) by taking the reciprocal (\(\frac{1}{\sigma_i}\)) of each non-zero singular value, leaving the zeros in place, and transposing the matrix.
Intuition on where the normal equations \(A^\top A\hat{x} = A^\top b\) come from:
In the previous case, we had \(\mathbf{e} = (\mathbf{b} - proj_S(\mathbf{b})) \ \bot \ \mathbf{a}\). Here, the same orthogonality condition holds for all columns of \(A\) (that we are projecting on).
This is the same as stating \(A^\top (\mathbf{b} - proj_S(\mathbf{b})) = 0\) which by substituting \(proj_S(b) = \mathbf{p} = A \mathbf{\hat{x}}\) gives \(A^\top \mathbf{b} - A^\top A\mathbf{\hat{x}} = 0\) which we can restate as \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\), which is the normal equation.
Field-by-field Comparison
Field
Before
After
Front
Intuition on where the normal equations \(A^\top A\hat{x} = A^\top b\) come from:
Back
<div>In the previous case, we had \(\mathbf{e} = (\mathbf{b} - proj_S(\mathbf{b})) \ \bot \ \mathbf{a}\). Here, the same orthogonality condition holds for all columns of \(A\) (that we are projecting on).</div><div><br></div><div>This is the same as stating \(A^\top (\mathbf{b} - proj_S(\mathbf{b})) = 0\) which by substituting \(proj_S(b) = \mathbf{p} = A \mathbf{\hat{x}}\) gives \(A^\top \mathbf{b} - A^\top A\mathbf{\hat{x}} = 0\) which we can restate as \(A^\top A \mathbf{\hat{x}} = A^\top \mathbf{b}\), which is the normal equation.</div>
For all \(x\) and an orthogonal matrix \(Q\) we have \(||Qx|| = ||x||\) Proof included
\(||Qx||^2 = (Qx)^\top(Qx) = x^\top x = ||x||^2\) and note that \(||Qx|| \geq 0\) and \(||x|| \geq 0\) thus it suffices to show that the squares are equal.
Field-by-field Comparison
Field
Before
After
Text
For all \(x\) and an orthogonal matrix \(Q\) we have \(||Qx|| = {{c1::||x||}}\) <i>Proof included</i>
Extra
\(||Qx||^2 = (Qx)^\top(Qx) = x^\top x = ||x||^2\) and note that \(||Qx|| \geq 0\) and \(||x|| \geq 0\) thus it suffices to show that the squares are equal.
The determinant preserves “multilinearity”. This means that changing only a single row will preserve the rest of the determinant (it’s linear for each row).
The determinant preserves “multilinearity”. This means that changing only a single row will preserve the rest of the determinant (it’s linear for each row).
\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} \]
\[ \begin{vmatrix} a + a’ & b + b’ \\ c & d \end{vmatrix} = \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a’ & b’ \\ c & d \end{vmatrix} \]
Field-by-field Comparison
Field
Before
After
Text
<div>The determinant preserves “multilinearity”. This means that {{c1::changing only a single row will preserve the rest of the determinant (it’s <em>linear for each row)}}.</em></div>
Extra
<div>\[ \begin{vmatrix} ta & tb \\ c & d \end{vmatrix} = t \cdot \begin{vmatrix} a & b \\ c & d \end{vmatrix} \]</div><div>\[ \begin{vmatrix} a + a’ & b + b’ \\ c & d \end{vmatrix} = \begin{vmatrix} a & b \\ c & d \end{vmatrix} + \begin{vmatrix} a’ & b’ \\ c & d \end{vmatrix} \]</div>
What does Gram-Schmidt actually do? Why do we substract \(\sum^{k - 1}_{i = 1} (a_k^\top q_i) q_i\)?
For each new vector, Gram-Schmidt projects it onto our current orthogonal basis.
We then substract the components that overlap for each of those basis vectors, to get a \(q_i'\) that is linearly independent. We then normalise it and add it to the basis.
Field-by-field Comparison
Field
Before
After
Front
What does Gram-Schmidt actually do? Why do we substract \(\sum^{k - 1}_{i = 1} (a_k^\top q_i) q_i\)?
Back
For each new vector, Gram-Schmidt projects it onto our current orthogonal basis.<br><br>We then substract the components that overlap for each of those basis vectors, to get a \(q_i'\) that is linearly independent. We then normalise it and add it to the basis.<br><br><img src="paste-b6b55f36e78516fa3cd2e3dcf1fc622ee3a4fd8f.jpg">
For \(A\) a matrix and \(M\) an invertible matrix:
\(\textbf{N}(A) = \){{c1::\(\textbf{N}(MA)\) (nullspace is the same)}}
Field-by-field Comparison
Field
Before
After
Text
<div>For \(A\) a matrix and \(M\) an invertible matrix:</div>\(\textbf{N}(A) = \){{c1::\(\textbf{N}(MA)\) (nullspace is the same)}}<blockquote><ol>
</ol></blockquote>
Let \(V, W\) be two vector spaces. A function \(T: V \rightarrow W\) is called a linear transformation between vector spaces if the following linearity axiom holds for all \(x_1, x_2 \in V\) and all \(\lambda_1, \lambda_2 \in \mathbb{R}\): \[ T(\lambda_1 x_1 + \lambda_2 x_2) = \lambda_1 T(x_1) + \lambda_2 T(x_2) \]
Let \(V, W\) be two vector spaces. A function \(T: V \rightarrow W\) is called a linear transformation between vector spaces if the following linearity axiom holds for all \(x_1, x_2 \in V\) and all \(\lambda_1, \lambda_2 \in \mathbb{R}\): \[ T(\lambda_1 x_1 + \lambda_2 x_2) = \lambda_1 T(x_1) + \lambda_2 T(x_2) \]
Field-by-field Comparison
Field
Before
After
Text
Let \(V, W\) be two vector spaces. A function \(T: V \rightarrow W\) is called a <i>linear transformation between vector spaces</i> if the following {{c1::linearity}} axiom holds for all \(x_1, x_2 \in V\) and all \(\lambda_1, \lambda_2 \in \mathbb{R}\): \[ {{c1:: T(\lambda_1 x_1 + \lambda_2 x_2) = \lambda_1 T(x_1) + \lambda_2 T(x_2) }}\]
Let \(A\) be an \(m \times n\) matrix and \(M\) an invertible \(m \times m\) matrix.
Then the two systems \(Ax = b\) and \(MAx = Mb\) have the same solutions \(x\).
This is why Gauss-Jordan Elimination works.
Field-by-field Comparison
Field
Before
After
Text
Let \(A\) be an \(m \times n\) matrix and \(M\) an invertible \(m \times m\) matrix.<br><br>Then the two systems \(Ax = b\) and \(MAx = Mb\) have the {{c1::same solutions \(x\)}}.
For \(A\) a matrix and \(M\) an invertible matrix:
\(A\) has linearly independent columns if and only if \(MA\) has linearly independent colums.
Field-by-field Comparison
Field
Before
After
Text
<div>For \(A\) a matrix and \(M\) an invertible matrix:</div><div><br></div>\(A\) has {{c1::linearly independent columns}} if and only if {{c1::\(MA\) has linearly independent colums}}.
Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
\(V\) and \(W\) are orthogonal if and only if {{c1::\(v_i\) and \(w_j\) are orthogonal for all \(i \in \{1, \dots, k\}\) and \(j \in \{1, \dots, l\}\)}}.
Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).
\(V\) and \(W\) are orthogonal if and only if {{c1::\(v_i\) and \(w_j\) are orthogonal for all \(i \in \{1, \dots, k\}\) and \(j \in \{1, \dots, l\}\)}}.
Subspaces are orthogonal if their basis-vectors are orthogonal.
Field-by-field Comparison
Field
Before
After
Text
Let \(v_1, \dots, v_k\) be a basis of subspace \(V\). Let \(w_1, \dots, w_l\) be a basis of subspace \(W\).<br><br>\(V\) and \(W\) are orthogonal <i>if and only if</i> {{c1::\(v_i\) and \(w_j\) are orthogonal for all \(i \in \{1, \dots, k\}\) and \(j \in \{1, \dots, l\}\)}}.
Extra
Subspaces are orthogonal if their basis-vectors are orthogonal.
For \(A\) written in CR-Decomposition \(A = CR'\), \(R'\) is unique.
\(R'\) is unique because the \(C\) is linearly independent and there's only one way to write a vector (the columns of \(A\)) as the linear combination of independent vectors.
Field-by-field Comparison
Field
Before
After
Text
For \(A\) written in CR-Decomposition \(A = CR'\), \(R'\) is {{c1:: unique::property? and why proof?}}.
Extra
\(R'\) is unique because the \(C\) is linearly independent and there's only one way to write a vector (the columns of \(A\)) as the linear combination of independent vectors.
A diagonal matrix \(D\) has eigenvalues which are the diagonals and a full set of eigenvectors \(e_1, \dots, e_n\).
Field-by-field Comparison
Field
Before
After
Text
A diagonal matrix \(D\) has eigenvalues {{c1::which are the diagonals::where are they?}} and {{c1::a full set of eigenvectors \(e_1, \dots, e_n\)::EVs?}}.
We can write \(A\) as the sum of rank \(1\) matrices: \[A = {{c2::\sum_{k = 1}^n \lambda_i v_i v_i^\top}}\]where \(v_1, \dots, v_n\) are an orthonormal basis of eigenvectors (the \(V\) in diagonalisation) and \(\lambda_1, \dots, \lambda_n\) the associated eigenvectors.
We can write \(A\) as the sum of rank \(1\) matrices: \[A = {{c2::\sum_{k = 1}^n \lambda_i v_i v_i^\top}}\]where \(v_1, \dots, v_n\) are an orthonormal basis of eigenvectors (the \(V\) in diagonalisation) and \(\lambda_1, \dots, \lambda_n\) the associated eigenvectors.
Field-by-field Comparison
Field
Before
After
Text
We can write \(A\) as the sum of {{c1::rank \(1\) matrices}}: \[A = {{c2::\sum_{k = 1}^n \lambda_i v_i v_i^\top}}\]where {{c2:: \(v_1, \dots, v_n\) are an orthonormal basis of eigenvectors (the \(V\) in diagonalisation) and \(\lambda_1, \dots, \lambda_n\) the associated eigenvectors}}.<br>
If \(m = n\) (\(A\) is square), the system \(Ax = b\) is called square. Typically solvable.
If \(m < n\) (A is a wide matrix), the system \(Ax = b\) is called underdetermined. These are typically solvable.
If \(m > n\) (A is a tall matrix) the system \(Ax = b\) is called overdetermined. Typically not solvable.
(Undetermined because there are more variables than equations.)
Field-by-field Comparison
Field
Before
After
Text
<ol><li>If \(m = n\) (\(A\) is square), the system \(Ax = b\) is called square. Typically solvable. </li><li>If \(m < n\) (A is a wide matrix), the system \(Ax = b\) is called {{c1::underdetermined}}. These are {{c1::typically solvable::solvability}}. </li><li>If \(m > n\) (A is a tall matrix) the system \(Ax = b\) is called {{c2::overdetermined}}. Typically {{c2::not solvable::solvability}}.</li></ol>
Extra
(Undetermined because there are more variables than equations.)
Given \(n\) vectors \(v_1, \dots, v_n \in \mathbb{R}^n\) we call their Gram matrix the {{c2::\(n \times n\) matrix of inner products \(G_{ij} = v_i^\top v_j\)}}.
Given \(n\) vectors \(v_1, \dots, v_n \in \mathbb{R}^n\) we call their Gram matrix the {{c2::\(n \times n\) matrix of inner products \(G_{ij} = v_i^\top v_j\)}}.
Field-by-field Comparison
Field
Before
After
Text
Given \(n\) vectors \(v_1, \dots, v_n \in \mathbb{R}^n\) we call their {{c1::Gram matrix}} the {{c2::\(n \times n\) matrix of inner products \(G_{ij} = v_i^\top v_j\)}}.
If \(A\) is a matrix and \(P\) is a permutation that swaps two elements (i.e. \(\text{sgn}(P) = -1\)): \[\det(PA) = - \det(A) \]
\(PA\) corresponds to swapping two rows of \(A\)
Field-by-field Comparison
Field
Before
After
Text
If \(A\) is a matrix and \(P\) is a permutation that <i>swaps two elements</i> (i.e. \(\text{sgn}(P) = -1\)): \[\det(PA) = {{c1:: - \det(A) }}\]<br>
Extra
\(PA\) corresponds to swapping two rows of \(A\)
How do we find a basis for the nullspace of \(A\)?
Compute the RREF form \(R\) of \(A\) (\(MA\) has the same nullspace as \(A\): \(\textbf{N}(A) = \textbf{N}(MA)\))
Remove any zero rows (because \(0^\top x = 0\) regardless of \(x\))
Solve for \(Rx = 0\):
We seperate the matrix into the identity and the "rest". Note that for this we take columns 1 and 2 as they form the 2x2 identity.
Which becomes
We reduce this to a system of equations:
We choose two special solutions (independent) and then plug in the values into our equations to find the rest.
This gives us a basis of the nullspace as we get two linearly independent vectors in there and it has dimension 2. We call these particular solutions.
Final nullspace:
Field-by-field Comparison
Field
Before
After
Front
How do we find a basis for the nullspace of \(A\)?
Back
<ol><li>Compute the RREF form \(R\) of \(A\) (\(MA\) has the same nullspace as \(A\): \(\textbf{N}(A) = \textbf{N}(MA)\))<br><img src="paste-c7b63bea7d24d14a38bb7424b8db516858fabcf0.jpg"></li><li>Remove any zero rows (because \(0^\top x = 0\) regardless of \(x\))</li><li>Solve for \(Rx = 0\):<br><img src="paste-202adab412a02f3505cdc07a23c10560126d62b6.jpg"><br></li><li>We seperate the matrix into the identity and the "rest". Note that for this we take columns 1 and 2 as they form the 2x2 identity.<br><img src="paste-d1c60625d9e82f7d7e03e5e589fa3aadb665dcc3.jpg"></li><li>Which becomes <br><img src="paste-d411074ad0d64bb267df9e809e480d6930a8d42f.jpg"></li><li>We reduce this to a system of equations:<br><img src="paste-d836e1ad674f83289a6c984addc347470f0dc213.jpg"><br><div>We choose two special solutions (independent) and then plug in the values into our equations to find the rest.
This gives us a basis of the nullspace as we get two linearly independent vectors in there and it has dimension 2. We call these <strong>particular solutions</strong>.</div></li></ol><div>Final nullspace:</div><div><img src="paste-d862ea45eee333d57256e4b8635e0a0b714ae57a.jpg"></div>
\(A\) has an EW \(0\) \(\Longleftrightarrow\)\(A\) is not invertible Proof Included
We know the EVs are in the \(N(A - \lambda I)\) because they solve the formula \(Av = \lambda v \implies Av - \lambda v \)\(= 0 \implies (A - \lambda I)v = 0\). Thus \(v\) is in the nullspace of \((A - \lambda I)\).
If \(A\) is not invertible, then it will have an EV of \(0\), which means that there is an EV solving \((A - 0 \cdot I)v = 0 \implies Av = 0\). Thus \(v \neq 0\) is in the nullspace of \(A\), i.e. the nullspace is not empty.
Field-by-field Comparison
Field
Before
After
Text
{{c1::\(A\) has an EW \(0\)::EW}} \(\Longleftrightarrow\){{c2::\(A\) is not invertible}}<i> Proof Included</i>
Extra
<div>We know the EVs are in the \(N(A - \lambda I)\) because they solve the formula \(Av = \lambda v \implies Av - \lambda v \)\(= 0 \implies (A - \lambda I)v = 0\). Thus \(v\) is in the nullspace of \((A - \lambda I)\).</div><div><br></div><div>If \(A\) is not invertible, then it will have an EV of \(0\), which means that there is an EV solving \((A - 0 \cdot I)v = 0 \implies Av = 0\). Thus \(v \neq 0\) is in the nullspace of \(A\), i.e. the nullspace is not empty.</div>
The projection of a vector \(b \in \mathbb{R}^m\) onto a subspace \(S\) (of \(\mathbb{R}^m\)) is the point in \(S\) that is closest to \(b\). In other words \[ \text{proj}_S(b) = {{c1:: \text{argmin}_{p \in S} ||b - p|| }}\]
The projection of a vector \(b \in \mathbb{R}^m\) onto a subspace \(S\) (of \(\mathbb{R}^m\)) is the point in \(S\) that is closest to \(b\). In other words \[ \text{proj}_S(b) = {{c1:: \text{argmin}_{p \in S} ||b - p|| }}\]
Where \(b = p + e \implies b - p = e\), with \(e\) the error.
Field-by-field Comparison
Field
Before
After
Text
The projection of a vector \(b \in \mathbb{R}^m\) onto a subspace \(S\) (of \(\mathbb{R}^m\)) is the point in \(S\) {{c1::that is closest to \(b\)}}. In other words \[ \text{proj}_S(b) = {{c1:: \text{argmin}_{p \in S} ||b - p|| }}\]
Extra
Where \(b = p + e \implies b - p = e\), with \(e\) the error.
Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the non-zero eigenvalues of \(A^\top A\) are the same ones as of \(AA^\top\).
Both matrices are symmetric and PSD.
Proof Included
Proof \(G = AA^\top\) and \(G = A^\top A\) are PSD.
\(x^\top G x = x^\top (A^\top A ) x = (Ax)^\top (Ax) = ||Ax||^2 \geq 0\)
\(x^\top G x = x^\top AA^\top x = (A^\top x)^\top (A^\top x) = ||A^\top x||^2 \geq 0\)
Field-by-field Comparison
Field
Before
After
Text
<div>Given a real matrix \(A \in \mathbb{R}^{n \times n}\), the non-zero eigenvalues of \(A^\top A\) are the same ones as of \(AA^\top\).</div><div><br></div><div>Both matrices are {{c3::<em>symmetric</em> and <i>PSD</i>}}.</div><div><i>Proof Included</i><br></div>
Extra
<div><b>Proof</b> \(G = AA^\top\) and \(G = A^\top A\) are PSD.</div><div><ul><li> \(x^\top G x = x^\top (A^\top A ) x = (Ax)^\top (Ax) = ||Ax||^2 \geq 0\) </li><li>\(x^\top G x = x^\top AA^\top x = (A^\top x)^\top (A^\top x) = ||A^\top x||^2 \geq 0\)</li></ul></div><div><br></div><div></div>
The projection of \(b \in \mathbb{R}^m\) on \(S = \{\lambda a \ | \ \lambda \in \mathbb{R} \} = C(a)\) is given by: \[ \text{proj}_S(b) = {{c1:: \frac{aa^\top}{a^\top a}b }}\]
The projection of \(b \in \mathbb{R}^m\) on \(S = \{\lambda a \ | \ \lambda \in \mathbb{R} \} = C(a)\) is given by: \[ \text{proj}_S(b) = {{c1:: \frac{aa^\top}{a^\top a}b }}\]
This minimiser is unique.
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(a \in \mathbb{R}^m \ \backslash \ \{0\}\). </div><div><br></div><div>The projection of \(b \in \mathbb{R}^m\) on \(S = \{\lambda a \ | \ \lambda \in \mathbb{R} \} = C(a)\) is given by: \[ \text{proj}_S(b) = {{c1:: \frac{aa^\top}{a^\top a}b }}\]</div><div>This minimiser is unique.</div>
Let \(A \in \mathbb{R}^{m \times m}\). \(A\) is invertible if:
There is a \(m \times m\) matrix \(B\) such that \(BA = I\).
Exists only if \(A\) has linearly independent columns.
Field-by-field Comparison
Field
Before
After
Front
<div>Let \(A \in \mathbb{R}^{m \times m}\). \(A\) is invertible if:</div>
Back
There is a \(m \times m\) matrix \(B\) such that \(BA = I\).<br><br><i>Exists only if </i>\(A\)<i> has linearly independent columns.</i>
The co-factors of \(A\) are \( C_{ij} = {{c1:: (-1)^{i + j} \det(\mathcal{A}_{ij}) }}\) where \(\mathcal{A}_{ij}\) is the \((n - 1)\times (n-1)\) matrix without row \(i\) and column \(j\).
The co-factors of \(A\) are \( C_{ij} = {{c1:: (-1)^{i + j} \det(\mathcal{A}_{ij}) }}\) where \(\mathcal{A}_{ij}\) is the \((n - 1)\times (n-1)\) matrix without row \(i\) and column \(j\).
Field-by-field Comparison
Field
Before
After
Text
The c<b>o-factors</b> of \(A\) are \( C_{ij} = {{c1:: (-1)^{i + j} \det(\mathcal{A}_{ij}) }}\) where \(\mathcal{A}_{ij}\) is the \((n - 1)\times (n-1)\) matrix without row \(i\) and column \(j\).
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1::the parity of the number of elements that are out of order (inversions: \( i < j \text{ and } \sigma(i) > \sigma( j)\)) after applying the permutation::inversions}}.
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1::the parity of the number of elements that are out of order (inversions: \( i < j \text{ and } \sigma(i) > \sigma( j)\)) after applying the permutation::inversions}}.
\((1, 3, 2)\) has one inversion.
\(\text{sgn}(\sigma)=(−1)^k\) where \(k\) is the number of transpositions (swaps) needed to obtain \(σ\) from the identity.
Field-by-field Comparison
Field
Before
After
Text
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1::the parity of the number of elements that are out of order (inversions: \( i < j \text{ and } \sigma(i) > \sigma( j)\)) after applying the permutation::inversions}}.
Extra
\((1, 3, 2)\) has one inversion.<br><br>\(\text{sgn}(\sigma)=(−1)^k\) where \(k\) is the number of transpositions (swaps) needed to obtain \(σ\) from the identity.
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive definite if and only if {{c2::\(x^\top Ax > 0\) for all \(x \in \mathbb{R}^n \setminus \{0\}\)}}.
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is positive definite if and only if {{c2::\(x^\top Ax > 0\) for all \(x \in \mathbb{R}^n \setminus \{0\}\)}}.
Field-by-field Comparison
Field
Before
After
Text
A symmetric matrix \(A \in \mathbb{R}^{n \times n}\) is {{c1::positive definite}} if and only if {{c2::\(x^\top Ax > 0\) for all \(x \in \mathbb{R}^n \setminus \{0\}\)}}.
The sign of a permutation is {{c1::multiplicative::property}}: <br><br>\(\text{sgn}(\sigma \circ \lambda) = {{c1:: \text{sgn}(\sigma) \cdot \text{sgn}(\lambda)}}\).
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}||\)}}
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1 \neq \lambda_2 \in \mathbb{R}\) two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\).
Then \(v_1\) and \(v_2\) are orthogonal. Proof Included
Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1 \neq \lambda_2 \in \mathbb{R}\) two distinct eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\).
Then \(v_1\) and \(v_2\) are orthogonal. Proof Included
<div>Let \(A \in \mathbb{R}^{n \times n}\) be a symmetric matrix and \(\lambda_1 {{c2::\neq}} \lambda_2 \in \mathbb{R}\) two {{c2::distinct}} eigenvalues of \(A\) with corresponding eigenvectors \(v_1, v_2\).</div><div>Then \(v_1\) and \(v_2\) {{c1::are orthogonal}}. <i>Proof Included</i></div>
Let \(V\) be a finitely generated vector space, \(F \subseteq V\) a finite set of linearly independent vectors (note that \(F\) does not need to span \(V\)) and \(G \subseteq V\) a finite set of vectors with \(\textbf{Span}(G) = V\) (but they don't all need to be independent). Then the following two statements hold:
\(|F| \leq |G|\)
{{c2::There exists a subset \(E \subseteq G\) of size \(|G| - |F|\) such that \(\textbf{Span}(F \cup E) = V\).}}
Let \(V\) be a finitely generated vector space, \(F \subseteq V\) a finite set of linearly independent vectors (note that \(F\) does not need to span \(V\)) and \(G \subseteq V\) a finite set of vectors with \(\textbf{Span}(G) = V\) (but they don't all need to be independent). Then the following two statements hold:
\(|F| \leq |G|\)
{{c2::There exists a subset \(E \subseteq G\) of size \(|G| - |F|\) such that \(\textbf{Span}(F \cup E) = V\).}}
We can use the lemma to argue that there can't be more than \(n\) independent vectors in a space of dimension \(n\).
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) be a finitely generated vector space, \(F \subseteq V\) a finite set of linearly independent vectors (note that \(F\) does not need to span \(V\)) and \(G \subseteq V\) a finite set of vectors with \(\textbf{Span}(G) = V\) (but they don't all need to be independent). Then the following two statements hold:</div><div><ol><li>{{c1::\(|F| \leq |G|\)}}</li><li>{{c2::There exists a subset \(E \subseteq G\) of size \(|G| - |F|\) such that \(\textbf{Span}(F \cup E) = V\).}}</li></ol></div><blockquote><ol>
</ol></blockquote>
Extra
We can use the lemma to argue that there can't be more than \(n\) independent vectors in a space of dimension \(n\).
How to recover a matrix \(A\) from it's eigenvectors and eigenvalues (complete set)?
\(V\) the matrix with the eigenvectors of \(A\), orthogonal. Then we know \(AV = VD\) (\(Av_i = \lambda_i v_i\) in matrix form), with \(D = \Lambda\) the matrix with the eigenvalues on the diagonal.
Thus \(AVV^\top = VDV^\top \implies A = VDV^\top\) .
Field-by-field Comparison
Field
Before
After
Front
How to recover a matrix \(A\) from it's eigenvectors and eigenvalues (complete set)?
Back
\(V\) the matrix with the eigenvectors of \(A\), orthogonal. Then we know \(AV = VD\) (\(Av_i = \lambda_i v_i\) in matrix form), with \(D = \Lambda\) the matrix with the eigenvalues on the diagonal.<br><br>Thus \(AVV^\top = VDV^\top \implies A = VDV^\top\) .
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), we define the pseudo-inverse \(A^\dagger \in \mathbb{R}^{n \times m}\) as:\[ A^\dagger = {{c1::A^\top (A A^\top)^{-1} }}\]
For an \(A\) with full column-rank, we basically define, \(A^\dagger\) as the transpose of the pseudoinverse of the transpose:
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = m\), we define the <b>pseudo-inverse</b> \(A^\dagger \in \mathbb{R}^{n \times m}\) as:\[ A^\dagger = {{c1::A^\top (A A^\top)^{-1} }}\]
Extra
For an \(A\) with full column-rank, we basically define, \(A^\dagger\) as the transpose of the pseudoinverse of the transpose:<br><img src="paste-ea3dc98b302c74b79fb2bafc8b144f36da289e16.jpg"><br><br>
For a projection to exist using our formula \(P = A (A^\top A)^{-1} A^\top\) we need \(A\) to have independent columns, i.e. they form a basis for \(C(A)\).
For a projection to exist using our formula \(P = A (A^\top A)^{-1} A^\top\) we need \(A\) to have independent columns, i.e. they form a basis for \(C(A)\).
Otherwise the projection is not unique.
Field-by-field Comparison
Field
Before
After
Text
For a projection to exist using our formula \(P = A (A^\top A)^{-1} A^\top\) we need {{c1:: \(A\) to have independent columns, i.e. they form a basis for \(C(A)\)}}.
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.
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\) and CR decomposition \(A = CR\), we define the pseudoinverse \(A^\dagger\) as: \[ A^\dagger = R^\dagger C^\dagger \]
We can rewrite this as:
\(\begin{aligned}
A^\dagger &= R^\top (RR^\top)^{-1} (C^\top C)^{-1} C^\top \\
&= R^\top (C^\top C R R^\top)^{-1} C^\top \\
&= R^\top (C^\top A R^\top)^{-1} C^\top
\end{aligned}\)
Field-by-field Comparison
Field
Before
After
Text
For \(A \in \mathbb{R}^{m \times n}\) with \(\text{rank}(A) = r\) and CR decomposition \(A = CR\), we define the pseudoinverse \(A^\dagger\) as: \[ A^\dagger = {{c1::R^\dagger C^\dagger }}\]
Extra
We can rewrite this as:<br><br>\(\begin{aligned}
A^\dagger &= R^\top (RR^\top)^{-1} (C^\top C)^{-1} C^\top \\
&= R^\top (C^\top C R R^\top)^{-1} C^\top \\
&= R^\top (C^\top A R^\top)^{-1} C^\top
\end{aligned}\)
The {{c2::rank of a matrix \(\textbf{rank}(A), A \in \mathbb{R}^{m \times n}\) is a number between 0 and n}} which counts the number of independent columns.
The {{c2::rank of a matrix \(\textbf{rank}(A), A \in \mathbb{R}^{m \times n}\) is a number between 0 and n}} which counts the number of independent columns.
A column is independent if it is not the linear combination of the previous ones (or the next ones, if you do it the other way round).
Field-by-field Comparison
Field
Before
After
Text
The {{c2::rank of a matrix \(\textbf{rank}(A), A \in \mathbb{R}^{m \times n}\) is a number between 0 and n}} which {{c1::counts the number of independent columns}}.
Extra
<div>A column is independent if it is not the linear combination of the <b>previous ones</b> (or the <b>next ones</b>, if you do it the other way round).</div>
The triangle inequality \(||v|| + ||w|| \geq ||v+w||\) holds exactly if \(w = \lambda v\) for some \(\lambda\geq0\) (i.e., they point in the same direction).
The triangle inequality \(||v|| + ||w|| \geq ||v+w||\) holds exactly if \(w = \lambda v\) for some \(\lambda\geq0\) (i.e., they point in the same direction).
Field-by-field Comparison
Field
Before
After
Text
The triangle inequality \(||v|| + ||w|| \geq ||v+w||\) holds exactly if {{c1::\(w = \lambda v\) for some \(\lambda\geq0\) (i.e., they point in the same direction)}}.
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>
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is the parity of the number of row swaps necessary to get back to the identity .
Field-by-field Comparison
Field
Before
After
Text
The \(\text{sgn}(\sigma)\) where \(\sigma\) is a permutation is {{c1:: the parity of the number of row swaps necessary to get back to the identity ::swaps}}.
No, there are typically many bases for a vector space.
Every set \(B = \{v_1, v_2, \dots, v_m\} \subseteq \mathbb{R}^m\) of linearly independent vectors is a basis of \(\mathbb{R}^m\).
Field-by-field Comparison
Field
Before
After
Front
Is a basis for a vector space unique?
Back
No, there are typically many bases for a vector space.<br><br>Every set \(B = \{v_1, v_2, \dots, v_m\} \subseteq \mathbb{R}^m\) of linearly independent vectors is a basis of \(\mathbb{R}^m\).
Pseudoinverse of \(A = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 2 & 0 \end{bmatrix}\)?<br><br>Hint: It's already in SVD-form.
Back
<div>Already in “SVD form” with \(U = I_2\), \(V = I_3\), and \(\Sigma = \begin{pmatrix} 3 & 0 & 0 \\ 0 & 2 & 0 \end{pmatrix}\). </div><div>The pseudoinverse is: \[A^\dagger = \begin{pmatrix} \frac{1}{3} & 0 \\ 0 & \frac{1}{2} \\ 0 & 0 \end{pmatrix}\] Notice:</div><div><ul><li>Shape flipped: \(A\) is \(2\times3\), so \(A^\dagger\) is \(3\times2\)</li><li>Nonzero values inverted: \(3 \to \frac{1}{3}\), \(2 \to \frac{1}{2}\) </li><li>Zeros stay zero</li></ul></div>
\(\Sigma \in \mathbb{R}^{m \times n}\) is {{c1::a diagonal matrix (in the sense that \(\Sigma_{ij} = 0\) when \(i \neq j\) and the diagonal values are non-negative and ordered in descending order)}}.
\(U^\top U = I\) and \(V^\top V = I\) (\(U, V\) are orthogonal).
The columns \(u_1, \dots, u_m\) of \(U\) are called the left-singular vectors of \(A\) and are orthonormal.
The columns \(v_1, \dots, v_n\) of \(V\) are called the right-singular vectors of \(A\) and are orthonormal.
\(\Sigma \in \mathbb{R}^{m \times n}\) is {{c1::a diagonal matrix (in the sense that \(\Sigma_{ij} = 0\) when \(i \neq j\) and the diagonal values are non-negative and ordered in descending order)}}.
\(U^\top U = I\) and \(V^\top V = I\) (\(U, V\) are orthogonal).
The columns \(u_1, \dots, u_m\) of \(U\) are called the left-singular vectors of \(A\) and are orthonormal.
The columns \(v_1, \dots, v_n\) of \(V\) are called the right-singular vectors of \(A\) and are orthonormal.
Field-by-field Comparison
Field
Before
After
Text
In the SVD:<br><ol><li>\(\Sigma \in \mathbb{R}^{m \times n}\) is {{c1::a diagonal matrix (in the sense that \(\Sigma_{ij} = 0\) when \(i \neq j\) and the diagonal values are non-negative and ordered in descending order)}}.</li><li>{{c2::\(U^\top U = I\) and \(V^\top V = I\) (\(U, V\) are orthogonal)::Property of V and U}}.</li><li>The columns \(u_1, \dots, u_m\) of \(U\) are called {{c3::the left-singular vectors of \(A\) and are orthonormal}}.</li><li>The columns \(v_1, \dots, v_n\) of \(V\) are called {{c3::the right-singular vectors of \(A\) and are orthonormal}}.</li></ol>
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}\)}}
Given a matrix \(A \in \mathbb{R}^{n \times n}\) and an eigenvalue \(\lambda\) of \(A\) we call the dimension \(\dim(N(A - \lambda I))\) the geometric multiplicity of \(\lambda\).
Given a matrix \(A \in \mathbb{R}^{n \times n}\) and an eigenvalue \(\lambda\) of \(A\) we call the dimension \(\dim(N(A - \lambda I))\) the geometric multiplicity of \(\lambda\).
Field-by-field Comparison
Field
Before
After
Text
Given a matrix \(A \in \mathbb{R}^{n \times n}\) and an eigenvalue \(\lambda\) of \(A\) we call {{c2::the dimension \(\dim(N(A - \lambda I))\)}} the {{c1::geometric multiplicity}} of \(\lambda\).
Let \(P\) be the projection matrix onto the subspace \(U \subset \mathbb{R}^n\). Then \(P\) has two eigenvalues, \(0\) and \(1\).
Field-by-field Comparison
Field
Before
After
Text
Let \(P\) be the <i>projection matrix</i> onto the subspace \(U \subset \mathbb{R}^n\). Then \(P\) has {{c1::two eigenvalues, \(0\) and \(1\)::EW, EVs, and a complete set of real eigenvectors}}.
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\) }}.
How do we find the matrix \(A\) associated with a linear transformation \(T_A\)?
For \(e_1, e_2, \dots, e_n\) we calculate \(T_A(e_k)\) to find the \(k\)-th column of \(A\): \[ A = \begin{bmatrix} | & | & \text{} & | \\ T(e_1) & T(e_2) & \dots & T(e_n) \\ | & | & \text{ } & | \end{bmatrix} \]
Field-by-field Comparison
Field
Before
After
Front
How do we find the matrix \(A\) associated with a linear transformation \(T_A\)?
Back
For \(e_1, e_2, \dots, e_n\) we calculate \(T_A(e_k)\) to find the \(k\)-th column of \(A\): \[ A = \begin{bmatrix} | & | & \text{} & | \\ T(e_1) & T(e_2) & \dots & T(e_n) \\ | & | & \text{ } & | \end{bmatrix} \]<br>
The independent columns of \(A\), {{c1::span the column space \(\textbf{C}(A)\) of \(A\)}}.
Proven by induction, adding elements that are a linear combination of other ones doesn't change span, thus we can iteratively remove the dependent columns.
Lemma 2.11
Field-by-field Comparison
Field
Before
After
Text
The {{c2::independent}} columns of \(A\), {{c1::span the column space \(\textbf{C}(A)\) of \(A\)}}.
Extra
Proven by induction, adding elements that are a linear combination of other ones doesn't change span, thus we can iteratively remove the dependent columns.<br><br>Lemma 2.11
Let \(V\) be a vector space. A subset \(B \subseteq V\) is called a basis of \(V\) if
\(B\) is linearly independent
{{c1::\(\textbf{Span}(B) = V\).}}
Field-by-field Comparison
Field
Before
After
Text
<div>Let \(V\) be a vector space. A subset \(B \subseteq V\) is called a basis of \(V\) if </div><div><ul><li>{{c1::\(B\) is linearly independent}}</li><li>{{c1::\(\textbf{Span}(B) = V\).}}</li></ul></div>