Runtime of sorting an array containing only \(1, 0\)?
Note 1: ETH::A&D
Deck: ETH::A&D
Note Type: Horvath Classic
GUID:
modified
Note Type: Horvath Classic
GUID:
A8P;P^G,v4
Before
Front
Back
Runtime of sorting an array containing only \(1, 0\)?
Using bucketsort, we can achieve \(O(n)\). this seems contradictory.
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.
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.
After
Front
Runtime of sorting an array containing only \(1, 0\)?
Back
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.
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 |
|---|---|---|
| Back | Using bucketsort, we can achieve \(O(n)\). |
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. |
Note 2: ETH::A&D
Deck: ETH::A&D
Note Type: Algorithms
GUID:
modified
Note Type: Algorithms
GUID:
Ah4U@kYYNJ
Before
Front
Runtime of Linear Search?
Back
Runtime of Linear Search?
\(\Theta(n)\) as we go through the entire list once.
After
Front
Runtime of Linear Search?
Back
Runtime of Linear Search?
\(\Theta(n)\) as we go through the entire list once.
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Approach | Go through the entire list and compare the current element to the one we are looking for. |
Note 3: ETH::A&D
Deck: ETH::A&D
Note Type: Algorithms
GUID:
modified
Note Type: Algorithms
GUID:
DD]dBe%Sn|
Before
Front
Runtime of Binary Search?
Back
Runtime of Binary Search?
\(O(\log(n))\) (optimal)
After
Front
Runtime of Binary Search?
Back
Runtime of Binary Search?
\(O(\log(n))\) (optimal)
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Approach | 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. |
Note 4: ETH::A&D
Deck: ETH::A&D
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
M,?u9cw(S%
Before
Front
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) \(O(n \log(n))\) (O notation)
Back
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) \(O(n \log(n))\) (O notation)
After
Front
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) \(O(n \log(n))\) (O-notation)
Back
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) \(O(n \log(n))\) (O-notation)
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Text | {{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(O(n \log(n))\) |
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(O(n \log(n))\) (O-notation)}} |
Note 5: ETH::A&D
Deck: ETH::A&D
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
yg-tkTB|,7
Before
Front
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(\sum_{i = 1}^n n \log(n) = n^2 \log n\)}} (Sum)
Back
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(\sum_{i = 1}^n n \log(n) = n^2 \log n\)}} (Sum)
After
Front
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(\sum_{i = 1}^n n \log(n) = n^2 \log n\) (Sum)}}
Back
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(\sum_{i = 1}^n n \log(n) = n^2 \log n\) (Sum)}}
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Text | {{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(\sum_{i = 1}^n n \log(n) = n^2 \log n\) |
{{c1:: \(\sum_{i = 1}^{n} i\log(i)\)}} \(\leq\) {{c2::\(\sum_{i = 1}^n n \log(n) = n^2 \log n\) (Sum)}} |
Note 6: ETH::DiskMat
Deck: ETH::DiskMat
Note Type: Horvath Classic
GUID:
modified
Note Type: Horvath Classic
GUID:
AluZ0L@#]a
Before
Front
What does it mean for a function \(f: A \to B\) to be injective (one-to-one)?
Back
What does it mean for a function \(f: A \to B\) to be injective (one-to-one)?
For \(a \neq a'\) we have \(f(a) \neq f(a')\). No two distinct values are mapped to the same function value (no "collisions").
After
Front
What does it mean for a function \(f: A \to B\) to be injective?
Back
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".
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 |
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')\). No two distinct values are mapped to the same function value (no "collisions"). | 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". |
Note 7: ETH::DiskMat
Deck: ETH::DiskMat
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
Gw~6}3;R1[
Before
Front
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
Back
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
After
Front
Consider the poset \((A;\preceq)\).
If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
Back
Consider the poset \((A;\preceq)\).
If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
If \(\{a,b\}\) have a greatest lower bound, then it is called the meet of \(a\) and \(b\) (also denoted \(a \land b\)).
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Text | \((A;\preceq)\) |
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> |
Note 8: ETH::DiskMat
Deck: ETH::DiskMat
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
HTIS
Before
Front
What are the two trivial equivalence relations on a set \(A\)?
1. Complete relation \(A \times A\) → single equivalence class \(A\)
2. {{c2:: Identity relation → equivalence classes are all singletons \(\{a\}\)}}
1. Complete relation \(A \times A\) → single equivalence class \(A\)
2. {{c2:: Identity relation → equivalence classes are all singletons \(\{a\}\)}}
Back
What are the two trivial equivalence relations on a set \(A\)?
1. Complete relation \(A \times A\) → single equivalence class \(A\)
2. {{c2:: Identity relation → equivalence classes are all singletons \(\{a\}\)}}
1. Complete relation \(A \times A\) → single equivalence class \(A\)
2. {{c2:: Identity relation → equivalence classes are all singletons \(\{a\}\)}}
After
Front
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\}\)}}
Back
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>< |
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> |
Note 9: ETH::DiskMat
Deck: ETH::DiskMat
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
otWm4$@-u8
Before
Front
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
Back
\((A;\preceq)\) is a poset. If \(\{a,b\}\) have a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
After
Front
Consider the poset \((A;\preceq)\).
If \(\{a,b\}\) has a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
If \(\{a,b\}\) has a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
Back
Consider the poset \((A;\preceq)\).
If \(\{a,b\}\) has a least upper bound, then it is called the join of \(a\) and \(b\) (also denoted \(a \lor b\)).
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 | \((A;\preceq)\) |
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\)).}} |
Note 10: ETH::DiskMat
Deck: ETH::DiskMat
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
v70IYM2s
Before
Front
What two properties must a relation \(f: A \to B\) have to be a function?
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\)
2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\)
2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
Back
What two properties must a relation \(f: A \to B\) have to be a function?
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\)
2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
1. Totally defined: \(\forall a \in A \ \exists b \in B : a \ f \ b\)
2. Well-defined: \(\forall a \in A \ \forall b, b' \in B : (a \ f \ b \land a \ f \ b' \rightarrow b = b')\)
After
Front
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')\)
Back
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>< |
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> |
Note 11: ETH::EProg
Deck: ETH::EProg
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
m%x4[`&]1%
Before
Front
Only name and input types determine the signature of a method in Java.
Back
Only name and input types determine the signature of a method in Java.
After
Front
Only names and input types determine the signature of a method in Java.
Back
Only names and input types determine the signature of a method in Java.
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Text | Only {{c1:: name and input types }} determine the signature of a method in Java. | Only {{c1:: names and input types }} determine the signature of a method in Java. |
Note 12: ETH::LinAlg
Deck: ETH::LinAlg
Note Type: Horvath Classic
GUID:
modified
Note Type: Horvath Classic
GUID:
Qp5sodd?T?
Before
Front
What is the definition of a linear transformation or a linear functional?
Back
What is the definition of a linear transformation or a linear functional?
a function \(T: \mathbb{R}^n \rightarrow \mathbb{R}^m / \ T: \mathbb{R}^n \rightarrow \mathbb{R}\) is called a linear transformation or a linear functional if the linearity axiom holds for it
linearity axiom: \(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\)
linearity axiom: \(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\)
After
Front
When is a function considered to be a linear transformation or a linear functional?
Back
When is a function considered to be a linear transformation or a linear functional?
If the linearity axiom holds for it:
\(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\)
\(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\)
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Front | Wh |
When is a function considered to be a linear transformation or a linear functional? |
| Back | If the <b>linearity axiom</b> holds for it:<br><b><br></b>\(T(\lambda_1x_1 + \lambda_2x_2) = \lambda_1T(x_1) + \lambda_2T(x_2)\) |
Note 13: ETH::LinAlg
Deck: ETH::LinAlg
Note Type: Horvath Classic
GUID:
modified
Note Type: Horvath Classic
GUID:
f>Z/u`5f-r
Before
Front
What does \(N(A) = \{0\}\) mean?
Back
What does \(N(A) = \{0\}\) mean?
it means that all the columns of the matrix are independent
After
Front
What does \(N(A) = \{0\}\) mean?
Back
What does \(N(A) = \{0\}\) mean?
That all the columns of the matrix are independent.
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Back | That all the columns of the matrix are independent. |
Note 14: ETH::LinAlg
Deck: ETH::LinAlg
Note Type: Horvath Cloze
GUID:
modified
Note Type: Horvath Cloze
GUID:
nkL&a6|Q;d
Before
Front
The span of m linearly independent vectors is \({{c1::\mathbb{R}^m}}\).
Back
The span of m linearly independent vectors is \({{c1::\mathbb{R}^m}}\).
This also means that a matrix in \(\mathbb{R}^{n \times n}\) with rank(A) = n spans all of the space.
After
Front
The span of m linearly independent vectors is \({{c1::\mathbb{R}^m}}\).
Back
The span of m linearly independent vectors is \({{c1::\mathbb{R}^m}}\).
This also means that a matrix in \(\mathbb{R}^{n \times n}\) with rank(A) = n spans the entire space.
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Extra | This also means that a matrix in \(\mathbb{R}^{n \times n}\) with rank(A) = n spans |
This also means that a matrix in \(\mathbb{R}^{n \times n}\) with rank(A) = n spans the entire space. |
Note 15: ETH::LinAlg
Deck: ETH::LinAlg
Note Type: Horvath Classic
GUID:
modified
Note Type: Horvath Classic
GUID:
uWwT2a*Vb[
Before
Front
What is the nullspace of a matrix?
Back
What is the nullspace of a matrix?
all vectors that when multiplied by the matrix give the 0-vector out
\(N(A) := \{x\in \mathbb{R} : Ax = \boldsymbol{0} \}\)
\(N(A) := \{x\in \mathbb{R} : Ax = \boldsymbol{0} \}\)
After
Front
What is the nullspace of a matrix?
Back
What is the nullspace of a matrix?
The set of vectors that give the 0-vector when multiplied with the given matrix.
\(N(A) := \{x\in \mathbb{R} : Ax = \boldsymbol{0} \}\)
\(N(A) := \{x\in \mathbb{R} : Ax = \boldsymbol{0} \}\)
Field-by-field Comparison
| Field | Before | After |
|---|---|---|
| Back | The set of vectors that give the 0-vector when multiplied with the given matrix.<br><br>\(N(A) := \{x\in \mathbb{R} : Ax = \boldsymbol{0} \}\) |