Datenkompression
Data Compression
Daten sollen möglichst effizient gespeichert und übertragen werden:
Beispiel: Tar o. Zip zur Kompression von Dateien
Data should be stored and transmitted as efficiently as possible:
Example: Tar or Zip for file compression
Komprimierung mit zwei Unterordnern: Textdatei und Bild
Textdatei eine .txt-Datei mit beliebigem Beispielinhalt
Bild
Komprimierung with two subfolders: Textdatei and Bild
Textdatei
Bild folder
Verlustfreie Datenkompression
Verlustbehaftete Datenkompression
Lossless Data Compression
Lossy Data Compression
Verlustfrei
Verlustbehaftet
Lossless
Lossy
Forderungen
Analogie: Koffer packen
Ziel: Koffer soll möglichst klein und kompakt gepackt werden
Requirements
Analogy: Packing a suitcase
Goal: Pack the suitcase as small and compact as possible
Redundanz
Konkurrierende Ziele:
Komprimierung
Redundanz in den Daten möglichst gering halten
Fehlertoleranz
Redundante Daten unterstützen Fehlererkennung und Fehlerkorrektur
Redundancy
Competing goals:
Compression
Keep redundancy in the data as low as possible
Fault Tolerance
Redundant data supports error detection and error correction
Zwei Seiten mit sich wiederholenden Inline-Styles — wo ist die Redundanz?
<html>
<body>
<h1 style="font-family: Arial;
font-size: 30px; color: red;">
Wartungsseite</h1>
<p style="font-family: Arial;
font-size: 16px; color: black;">
Diese Homepage wird erstellt</p>
<h2 style="font-family: Arial;
font-size: 24px; color: orange;">
Bitte habe noch etwas Geduld</h2>
</body>
</html>
<html>
<body>
<h1 style="font-family: Arial;
font-size: 30px; color: blue;">
Kontaktseite</h1>
<p style="font-family: Arial;
font-size: 16px; color: black;">
Feedback? Dann melde dich:</p>
<h2 style="font-family: Arial;
font-size: 24px; color: orange;">
dummy@email.de</h2>
</body>
</html>
Two pages with repeated inline styles — where is the redundancy?
<html>
<body>
<h1 style="font-family: Arial;
font-size: 30px; color: red;">
Maintenance Page</h1>
<p style="font-family: Arial;
font-size: 16px; color: black;">
This homepage is being created</p>
<h2 style="font-family: Arial;
font-size: 24px; color: orange;">
Please be patient</h2>
</body>
</html>
<html>
<body>
<h1 style="font-family: Arial;
font-size: 30px; color: blue;">
Contact Page</h1>
<p style="font-family: Arial;
font-size: 16px; color: black;">
Feedback? Then contact me:</p>
<h2 style="font-family: Arial;
font-size: 24px; color: orange;">
dummy@email.de</h2>
</body>
</html>
CSS-Syntax:
Die wiederholten Styles in eine eigene Datei:
p {
font-family: Arial;
font-size: 16px;
color: black;
}
h1 {
font-family: Arial;
font-size: 30px;
color: red;
}
h2 {
font-family: Arial;
font-size: 24px;
color: orange;
}
CSS syntax:
Extract the repeated styles into a separate file:
p {
font-family: Arial;
font-size: 16px;
color: black;
}
h1 {
font-family: Arial;
font-size: 30px;
color: red;
}
h2 {
font-family: Arial;
font-size: 24px;
color: orange;
}
<html>
<head>
<link rel="stylesheet"
href="stylesheet.css">
</head>
<body>
<h1>Wartungsseite</h1>
<p>Diese Homepage wird erstellt
von Name</p>
<h2>Bitte habe noch etwas
Geduld</h2>
<p><a href="kontakt.html">
Kontakt</a></p>
</body>
</html>
p {
font-family: Arial;
font-size: 16px;
color: black;
}
h1 {
font-family: Arial;
font-size: 30px;
color: red;
}
h2 {
font-family: Arial;
font-size: 24px;
color: orange;
}
Styles nur einmal definiert — gilt für alle HTML-Dateien, die das Stylesheet einbinden.
<html>
<head>
<link rel="stylesheet"
href="stylesheet.css">
</head>
<body>
<h1>Maintenance Page</h1>
<p>This homepage is being
created by Name</p>
<h2>Please be patient</h2>
<p><a href="kontakt.html">
Contact</a></p>
</body>
</html>
p {
font-family: Arial;
font-size: 16px;
color: black;
}
h1 {
font-family: Arial;
font-size: 30px;
color: red;
}
h2 {
font-family: Arial;
font-size: 24px;
color: orange;
}
Styles defined only once — applies to all HTML files that include the stylesheet.
index.html und kontakt.html in einem Texteditor
stylesheet.css — lagern Sie die wiederholten Styles dorthin aus
<link> in beiden HTML-Dateien
index.html and kontakt.html in a text editor
stylesheet.css — move the repeated styles there
<link> in both HTML files
Block-Codes (feste Wortlänge)
Variable Wortlänge
Block Codes (fixed length)
Variable Length
Herold et al. (2017): Grundlagen der Informatik
Herold et al. (2017): Grundlagen der Informatik
Codes mit variabler Wortlänge müssen für die Dekodierbarkeit folgende Bedingung erfüllen:
Ein Code erfüllt die Fano-Bedingung, wenn kein Wort aus dem Code der Anfang eines anderen Wortes ist.
Codes, die die Fano-Bedingung erfüllen, nennt man präfixfreie Codes.
Variable-length codes must satisfy the following condition for decodability:
A code satisfies the Fano condition if no codeword is the prefix of another codeword.
Codes that satisfy the Fano condition are called prefix-free codes.
Allgemein benötigen Huffman-codierte Texte ca. 2/3 des Speicherplatzes im Vergleich zur ASCII-Codierung.
In general, Huffman-encoded texts require about 2/3 of the storage space compared to ASCII encoding.
Überprüfung anhand der vier Kriterien (Schwill, 1993):
Horizontalkriterium
Komprimierung findet sich in Texten, Bildern, Audio, Video, Archiven, Datenbanken, Netzwerkprotokollen …
Vertikalkriterium
Von der Grundschule (ZIP-Dateien) bis zur Forschung (Informationstheorie, Shannon)
Zeitkriterium
Von Morse (1837) über Huffman (1952) bis heute (H.265, AVIF) — bleibt relevant
Sinnkriterium
Effizienz & Platzersparnis — im Alltag verankert (Streaming, Messenger, Cloud-Speicher)
Evaluation using the four criteria (Schwill, 1993):
Horizontal Criterion
Compression appears in text, images, audio, video, archives, databases, network protocols …
Vertical Criterion
From primary school (ZIP files) to research (information theory, Shannon)
Temporal Criterion
From Morse (1837) to Huffman (1952) to today (H.265, AVIF) — remains relevant
Significance Criterion
Efficiency & space savings — rooted in everyday life (streaming, messaging, cloud storage)
franke-lab.de/lehre/sose/fundidee/reflexion.html?sitzung=4
Artefakte & Reflexion verfassen → HTML kopieren → in Mahara einfügen
franke-lab.de/lehre/sose/fundidee/reflexion.html?sitzung=4
Write artifacts & reflection → copy HTML → paste into Mahara