Du befindest dich hier: FSI Informatik » Prüfungsfragen und Altklausuren » Prüfungen im Bachelor-Studium (1. - 5. Semester) » algoks » Forendiskussionen (Übersicht)
Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Forendiskussionen
Lösungsversuch
Aufgabe 1 - Komplexität
a) O(n)
b) O(n²)
c) O(n)
d) O(n)
e) O(n²)
f) O(n²)
g) O(n³)
h) O(n²)
Aufgabe 2 - Interpolation
a)
l(x) = { 0 für 0 <= x < 1 { 12x - 12 für 1 <= x < 2 { 60x - 108 für 2 <= x < 3
b)
Koeffizienten
c0 = 0, c1 = 0, c2 = 6, c3 = 6
Polynom:
a(x) = 6x³ - 12x² + 6x
c)
|1 0 0 0 | |1 1 0 0 | |1 2 2 0 | |1 3 6 6 |
d)
Die Systemmatrix A ist eine untere Dreiecksmatrix und lässt sich einfach durch Vorwärtseinsetzen lösen.
Aufgabe 3 - LU-Zerlegung
a)
|1 0 0 0| L = |2 1 0 0| |0 3 1 0| |0 0 2 1| |2 1 4 1| U = |0 1 1 1| |0 0 2 1| |0 0 0 3|
b)
x = (-3, 1, 4)^T
Aufgabe 4 - Eigenschaften von Bézier-Kurven
a)
- Affine Invarianz
- Bézier-Kurven liegt in der konvexen Hülle
- Variationsreduzierend
- In den Endpunkten tangential an das Kontroll-Polygon
b) …
c) …
Aufgabe 5 - Baryzentrische Koordinaten
a)
Fläche im spitzen Winkel bei T
b)
Halbgerade RS links von R (exklusiv)
c)
Punkt T
d)
P0: Auf 2/3 der Strecke von R nach S
P1: Relativ mittig im Dreieck, leicht in Richtung T bzw. der Strecke TS versetzt
P2: Existiert nicht (Summe ergibt 0 statt 1)
e)
ρ = -2
σ = 1
τ = 2
Aufgabe 6 - Singulärwertzerlegung
a)
Singulärwerte: 3/2, 3/4, 1/2
Rang: r = 3
Bild: span{(-1/3 -2/3 -2/3)^T, (-2/3 2/3 -1/3)^T, (-2/3 -1/3 2/3)^T}
Kern: span{(1/2 -1/2 -1/2 1/2)^T}
Konditionszahl: 6/4 * 4/2 = 3
b)
(-14 -4 4 14)^T
c)
|1 1 1 1| -1/4 x |2 2 2 2| |2 2 2 2|
Aufgabe 7 - Programmierung
a)
BezierCurve::BezierCurve(const Point* CPs, int numCPs) { this-numCPs = numCPs; this->CPs = new Point[numCPs]; for(int i = 0; i < numCPs; i++) { this->CPs[i] = CPs[i]; } } BezierCurve::~BezierCurve() { delete[] CPs; }
b)
void BezierCurve::removeControlPoint(int idx) { Points* newCPs = new Point[numCPs - 1]; for(int i = 0; i < numCPs; i++) { if(i < idx) newCPs[i] = CPs[i]; if(i > idx) { newCP[i - 1] = CPs[i]; } delete[] CPs; CPs = newCPs; this-numCPs = numCPs - 1; }
c)
Point BezierCurve::desCastlejau(float t) const { Point tmpCPs[numCPs]; for(int i = 0; i < numCPs; i++) tmpCPs[i] = CPs[i]; for(int c = 1; c < numCPs; c++) { for(int r = 0; r < numCPs, numCPs - c; r++) { tmpCPs[r] = (1-t) * tmpCPs[r] + t * tmpCPs[r + 1]; } } return tmpCPs[0]; }
d)
void BezierCurve::degreeElevation() { Point* newCPs = new Point[numCPs + 1]; newArr[0] = CPs[0]; newArr[numCPs] = CPs[numCPs - 1]; for(int i = 1; i < numCPs; i++) { float t = i / (numCPs + 1); float z = (numCPs + 1 - i) / (numCPs + 1); newArr[i] = t * CPs[i - 1] + z * CPs[i]; } delete[] CPs; CPs = newArr; numCPs++; }
e)
void BezierCurve::reflectCurve(const Point& p) { for(int i = 0; i < numCPs; i++) CPs[i] = 2 * p - CPs[i]; }
c)
Aufgabe 8 - Numerische Integration
a) 20
b) 17
c) 16
d) 16
e) 16
f) O(h²)
g) O(h^4)
Aufgabe 9 - Matrix-Norm und Kondition
a)
Das Problem ist für Funktion g(x) besser konditioniert, da die Tangente bei x = 1 eine geringere Steigung aufweist:
K(f) = π
K(g) = 1/π
g hat die kleinere Konditionszahl.
b)
7, 5, 19, 24, 6, 6
c)
mit 1-Norm:
K(A_1) = 49/25
K(A_3) = 24
d)
Die Geraden von SP_1 stehen fast senkrecht aufeinander.
Die Geraden von SP_2 verlaufen relativ parallel.
Damit ist SP_1 besser konditioniert.
Aufgabe 10 - Nullstellensuche
a)
…
b)
x_2 = 1/2
x_3 = -7
c)
(-4, 3)^T