Du befindest dich hier: FSI Informatik » Prüfungsfragen und Altklausuren » Prüfungen im Bachelor-Studium (1. - 5. Semester) » Lösungsvorschlag   (Übersicht)

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Nächste Überarbeitung
Vorherige Überarbeitung
pruefungen:bachelor:2014w-sp-klausur-loesung [28.07.2015 13:29] – angelegt Anolapruefungen:bachelor:2014w-sp-klausur-loesung [16.02.2016 22:31] (aktuell) since
Zeile 23: Zeile 23:
  
 ==== Aufgabe 2: pinboard ==== ==== Aufgabe 2: pinboard ====
 +**//TODO: FIX CODE!//**
 <code cpp> <code cpp>
   
Zeile 256: Zeile 256:
 } }
     // Funktion pin()     // Funktion pin()
-     
- 
 </code> </code>
  
-**b)** +==== Aufgabe 3====
-<code cpp> +
-  const float &Image::operator() (unsigned int i, unsigned int j) const { +
-    return data[i*width+j]; +
-  } +
-</code>+
  
-**c)** +**a)** TODO
-<code cpp> +
-  Image Filter::derivateX(const Image &input) { +
-    Image output(input.height, input.width-2); +
-    for(int y=0;y<input.height;y++) { +
-      for(int x=1;x<input.width-1;x++) { +
-        output(y,x-1)=0.5*(input(y,x+1) - input(y,x-1)); +
-      } +
-    } +
-    return output; +
-  } +
-</code>+
  
-**d)** +**b)**
-<code cpp> +
-  Image Filter::laplace(const Image &input) { +
-    Image output(input.height-2,input.width-2); +
-    float laplaceFilter[3][3]={{0,1,0}, +
-                                      {1,-4,1}, +
-                                      {0,1,0}};+
  
-    for(int y=1;y<input.height-1;y++) { +    .
-      for(int x=1;x<input.width-1;x++) { +
-        float newValue=0; +
-        for(int i=0;i<3;i++) { +
-          for(int j=0;j<3;j++) { +
-            newValue+=laplaceFilter[i][j]*input(y-1+i,x-1+j); +
-          } +
-        } +
-        output(y-1,x-1)=newValue; +
-      } +
-    } +
-    return output; +
-  } +
-</code> +
  
-**e)** +    .
-<code cpp> +
-  Image Filter::mean3(const Image &input) { +
-    Image output(input.height-2,input.width-2); +
-    Image tmp(input.height,input.width-2); +
-    float filterX[3]={1/3,1/3,1/3}; +
-    float filterY[3]={1/3,1/3,1/3}; +
-  +
-    for(int y=0;y<input.height;y++) { +
-      for(int x=1;x<input.width-1;x++) { +
-        float newValue=0; +
-        for(int i=0;i<3;i++) { +
-          newValue+=filterX[i]*input(y.x-1+i); +
-        } +
-        tmp(y,x-1)=newValue; +
-      } +
-    }+
  
-    for(int y=1;y<tmp.height-1;y++) { +    3 4000 rw-
-      for(int x=0;x<tmp.width;x++) { +
-        float newValue=0; +
-        for(int i=0;i<3;i++) { +
-          newValue+=filterY[i]*tmp(y-1+i.x); +
-        } +
-        output(y-1,x)=newValue; +
-      } +
-    } +
-    return output; +
-  } +
-</code>+
  
-==== Aufgabe 6 (Iterative Loesungsverfahren) ==== +    4 7000 rw-
-**a)** +
-   x1 = [1, 2, 5/2, 2, 1]^T +
-     +
-**b)** +
-  x1 = [1, 2, 3, 3, 2]^T+
  
-**c)** +    5 8000 1 rw-
-   Schwaches Zeilen-SummenKriterium (somit schwach diagonaldominant) + unzerlegbare Matrix => Konvergiert +
-    +
-==== Aufgabe 7 (Programmierung: Nichtlineare Optimierung) ==== +
-**a)** +
-<code cpp>  +
-  vec2 Optimizer::gradientDescent(const Function &f, const vec2 &x0, int maxIter) { +
-    vec2 currX=x0; +
-    for(int i=0;i<maxIter;i++) { +
-      if(f.gradF(currX).length() < 0.001) { +
-        break; // Genauigkeit erreicht +
-      } +
-      currX = currX + stepLength(f,currX,f.gradF(currX))*f.gradF(currX); +
-    } +
-    return currX; +
-+
-</code>+
  
-**b)** +    6 d000 1 rw-
-<code cpp> +
-  vec2 Optimizer::newton(const Function &f, const vec2 &x0, int maxIter) { +
-    vec2 currX=x0; +
-    for(int i=0;i<maxIter;i++) { +
-      if(f.gradF(currX).length() < 0.001) { +
-        break; // Genauigkeit erreicht +
-      } +
-      currX = currX f.hessian(currX).inverse()*f.gradF(currX); +
-    } +
-    return currX; +
-  } +
-</code>+
  
-**c)** +(Seitennummer, Adresse, Rechte
-Falls die Hesse-Matrix nicht positiv definit istkann sie im jeweiligen Iterationsdurchlauf durch die EInheitsmatrix ersetzt werden. In diesem Falle geht das Newton-Verfahren in das Gradientenabstiegsverfahren ueber. +Adressepresent, read, write, execute 
-  Gradientenabstiegsverfahren +  0 0x0 0 0 0 0   ← BTBP 
-   +  1 0x6 1 1 0 1 
-==== Aufgabe 8 (Bezier-Kurven) ==== +  2 0xd 1 1 1 0 
-**a)** +  3 0x0 0 0 0 0  
-  Siehe Script +  4 0x0 0 0 0 
-   +  0x0 0 0 0 0 
-**b)** +  6 0x0 0 0 0 0 
-    [-2 0] [2 4] [6 4] [6 0] +  7 0x0 0 0 0 0 
-       [2] [4 4] [6 2] +  8 0x0 0 0 0 
-         [2 3] [3] +  9 0x0 0 0 0 0 
-           [3½ 3] +  A 0x0 0 0 0 0 
-  => c0..c3=[-2 0] [2] [2 3] [3½ 3] +  B 0x0 0 0 0 0 
-   d0..d3=[3½ 3] [5 3] [6 2] [6 0+  C 0x0 0 0 0 0 
- +  D 0x0 0 0 0 0 
-   +  E 0x0 0 0 0 0 
-==== Aufgabe (Faltung) ==== +  F 0x9 1 1 1 0 
-**a)** +  0x2140   ------> 0xd140 
-  [ r ] Distributivitaet\\ +**c)** 
-  [ r ] Kommutativitaet\\ +
-  [ f ] Denn: Neutrales Element der Faltung zu einer Funktion f ist nicht die Funktion f selbst - neutrales element zur faltung wäre übrigens die dirac funktion\\ +
-  [ r ] Assoziativitaet +
-   +
-**b)** +
-Angabe der Lösung zerlegt in Strecken, wobei P1 (x,y) immer den Startpunkt meint und P2 (x,y) den Endpunkt einer Strecke.\\ +
-P1 = (0,0) und P2 = (1,0) würde also die Strecke auf der x-Achse meinen von x = 0 bis x = 1 (hoffe das ist verständlich, weil ASCII Bild hier rein is doof)+
  
-Lösung:\\ +Damit Adressfehler zu einem Trap fuehren (NULL-Pointer)
-Strecke0: P1 = (-unendlich, 0) bis P2 = (-1/2, 0)\\ +
-Strecke1: P1 = (-1/2, 0) bis P2 = (0, 1/2)\\ +
-Strecke2: P1 = (0, 1/2) bis P2 = (1, -1/2)\\ +
-Strecke3: P1 = (1, -1/2) bis P2 = (3/2, 0)\\ +
-Strecke4: P1 = (3/2, 0) bis P2 = (unendlich, 0)+
  
-**c)** \\ +==== Aufgabe 4: ====
-Erklaert an einem Beispiel: http://nt.eit.uni-kl.de/fileadmin/lehre/guet/uebung/faltung.pdf +
-  - (keine Überlappung)   t < -1: h(x)*h(x)+
-  - (Eintrittsphase)   -1 <t <1: h(x)*h(x) Integral form -2 to t-1 of 1/2 dx t/2+0.5 +
-  - (Vollständige Überlappung)  1 <= t < 3h(x)*h(x) Integral form t-3 to t-1 of 1/2 dx +
-  - (Austrittsphase)  3 <t < 5: h(x)*h(x) = Integral form t-3 to 2 of 1/2 dx = -t/2 + 5/2 +
-  - (keine Überlappung)  5 <=t: h(x)*h(x) 0+
  
-==== Aufgabe 10 ( ) ==== +**a)** TODO
-**1a)** +
-  Baryzentrische Koordinaten: (1/4, 1/2, 1/4) +
-   +
-**1b)** +
-  sigma < 0, rho < 0 --> spitze  Flaeche rechts ueber Punkt T +
-  tau = 1 --> Gerade durch den Punkt T, sodass die Gerade parallel zur Strecke [RS] liegt +
-   +
-**1c)** +
-    a:b = beta/alpha +
-    c:d = (beta+gamma)/alpha +
-    e:f = gamma/alpha+
  
-**2)** +**b)**  
-  PfP = 3.5  +Kernel-Threadskoennen auf mehrere Kerne/Prozessoren aufgeteilt werde 
-  MittelpunktfM = 1/4*(fA+fB+fC+fD= 7/2+LightWeightkoenne auch aufgeteilt werden (da sie aber mitunter gemeinsamme Daten haben muessen diese im niedrigsten gemeinsammen Speicher liegen und umso "hoeher der Speicher desto langsammer der Zugriff)
 +User: koennen nicht aufgeteilt werden