Informatiker Board (http://www.informatikerboard.de/board/index.php)
- Themengebiete (http://www.informatikerboard.de/board/board.php?boardid=1)
--- Theoretische Informatik (http://www.informatikerboard.de/board/board.php?boardid=5)
---- formale Sprachen (http://www.informatikerboard.de/board/board.php?boardid=12)
----- Problem mit einer Wortfunktion (http://www.informatikerboard.de/board/thread.php?threadid=4019)
Geschrieben von sebampuerom am 28.09.2018 um 19:33:
Problem mit einer Wortfunktion
Ich bin jetzt in einem Master Telematik Studium und mache jetzt theorische Informatik. Nun habe ich ein Problem mit einer Aufgabe wie folgt:
Wortfunktion
anzahl : Sigma* X Sigma* -> N inkl. 0
die Funktion zählt, wie oft ein Buchstabe in einem Wort vorkommt. Sie ist definiert durch: anzahl(leeres Wort, b) = 0 für alle b in Sigma
anzahl(wa, b) = anzahl(w, b) +1, a=b
anzahl(w, b), a =/ b für a, b in Sigma, w in Sigma*
Schrittweise Arbeitsweise dieser Funktion für den folgenden Fall aufschreiben:
anzahl(01011, 1)
Da kann ich sagen das Erbenis ist 3, aber wie mache ich das schrittweise? Das hier
anzahl(w, b) +1, a=b
anzahl(w, b), a =/ b
verstehe ich auch nicht gut.
Vielen Dank im Voraus
Forensoftware: Burning Board, entwickelt von WoltLab GmbH