commit a1ddfdb7c08be7533b5cf937c28ed4bacec3eaee Author: Never Gude Date: Thu Apr 30 16:08:36 2026 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..542f714 --- /dev/null +++ b/.gitignore @@ -0,0 +1,331 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bbl-SAVE-ERROR +*.bcf +*.bcf-SAVE-ERROR +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync +*.rubbercache +rubber.cache + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# attachfile2 +*.atfi + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc +*.loc + +# comment +*.cut + +# context +*.tuc +*.tui +*.tuo + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glg-abr +*.glo +*.glo-abr +*.gls +*.gls-abr +*.glsdefs +*.lzo +*.lzs +*.slg +*.slo +*.sls + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplot +*.gnuplot +*.table + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.glog +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hypdoc +*.hd + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# latexindent will create succesive backup files by default +#*.bak* + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.data.minted +*.pyg + +# morewrites +*.mw + +# newpax +*.newpax + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# spelling +*.spell.bad +*.spell.txt + +# svg +svg-inkscape/ + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# titletoc +*.ptc + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# latexindent.pl +*.bak[0-9]* + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib diff --git a/exercise_1/1_Übungsblatt_Nr_2-1.pdf b/exercise_1/1_Übungsblatt_Nr_2-1.pdf new file mode 100644 index 0000000..7b48af3 Binary files /dev/null and b/exercise_1/1_Übungsblatt_Nr_2-1.pdf differ diff --git a/exercise_1/2026SS-TheoInf-HAB01.pdf b/exercise_1/2026SS-TheoInf-HAB01.pdf new file mode 100644 index 0000000..b05c4c7 Binary files /dev/null and b/exercise_1/2026SS-TheoInf-HAB01.pdf differ diff --git a/exercise_1/HAB01-A3-Template.TXT b/exercise_1/HAB01-A3-Template.TXT new file mode 100644 index 0000000..c293896 --- /dev/null +++ b/exercise_1/HAB01-A3-Template.TXT @@ -0,0 +1,28 @@ +# Gefordert: kommentiertes WHILE-Programm +# Sie können weitere Hilfsfunktionen verwenden! +# Namen: +# +# +# + +########## HAUPTFUNKTIONEN ########## (Namen und Signatur nicht ändern!) +# Wir nutzen Python Type hints um die Eingabe-/Ausgabetypen anzuzeigen. In WHILE/LOOP-Programmen wegen des Syntax-Checkers als Kommentar zu finden. + +def divtwo(x): # divtwo(x: int) -> int + # ... + return # ... + + +def bin(n): # bin(n: int) + if(n <= 0): + print(0) + else: + # ... + # hier könnte divtwo(...) aufgerufen werden + # ... + # hier könnte print(...) aufgerufen werden + # ... + # Keine Ausgabe notwendig, Ausgabe findet über print statt + return -1 + + \ No newline at end of file diff --git a/exercise_1/task2.py b/exercise_1/task2.py new file mode 100644 index 0000000..287a9e0 --- /dev/null +++ b/exercise_1/task2.py @@ -0,0 +1,11 @@ +def g(x): + return (x + x) + +def f(x): + if (x < 0): + d = 0 + if (x == 0): + d = 1 + else: + d = g(f((x - 1))) + return d diff --git a/exercise_1/task3-l.py b/exercise_1/task3-l.py new file mode 100644 index 0000000..5229a1a --- /dev/null +++ b/exercise_1/task3-l.py @@ -0,0 +1,23 @@ +def divtwo(x): + y=0 + z=0 + if (x>=0): + z=x + while ((z-y)>1): + z=(z-1) + y=(y+1) + return y + +def bin(x): + z=0 + y=1 + if (x>0): + y=divtwo(x) + z=(x-(y+y)) + print(z) + x=y + else: + print(0) + return 0 + +print(bin(2)) diff --git a/exercise_1/task3.py b/exercise_1/task3.py new file mode 100644 index 0000000..9364daf --- /dev/null +++ b/exercise_1/task3.py @@ -0,0 +1,25 @@ +def divtwo(x): + if (x >= 0): + a = 0 + z = 0 + # Wie oft passt die 2 in x + while (a <= x): + a = (a + 2) + z = (z + 1) + z = (z - 1) + else: + z = 0 + return z + +def bin(n): + if (n == 0): + print(0) + if (n > 0): + a = n + # Das Verfahren zur Bestimmung der Binärdarstellung aus der Vorlesung + while (a > 0): + q = divtwo(a) # Quotient + r = (a - (q + q)) # Rest berechnen + a = q # Nächste Zeile im Verfahren + print(r) + return 0 diff --git a/exercise_1/task3.txt b/exercise_1/task3.txt new file mode 100644 index 0000000..9364daf --- /dev/null +++ b/exercise_1/task3.txt @@ -0,0 +1,25 @@ +def divtwo(x): + if (x >= 0): + a = 0 + z = 0 + # Wie oft passt die 2 in x + while (a <= x): + a = (a + 2) + z = (z + 1) + z = (z - 1) + else: + z = 0 + return z + +def bin(n): + if (n == 0): + print(0) + if (n > 0): + a = n + # Das Verfahren zur Bestimmung der Binärdarstellung aus der Vorlesung + while (a > 0): + q = divtwo(a) # Quotient + r = (a - (q + q)) # Rest berechnen + a = q # Nächste Zeile im Verfahren + print(r) + return 0 diff --git a/exercise_2/2025SS-TheoInf-HAB02-Quelltexte.txt b/exercise_2/2025SS-TheoInf-HAB02-Quelltexte.txt new file mode 100644 index 0000000..f0d02eb --- /dev/null +++ b/exercise_2/2025SS-TheoInf-HAB02-Quelltexte.txt @@ -0,0 +1,14 @@ +def f6(x): + y = 0 + while (x > 0): + x = (((x - y) - y) - 1) + y = (y + 1) + return y + +def f7(x,y): + z = 1 + if ((x>0) and (y>0)): + z = 0 + for i in range(0,x): + z = (z + f7(x,(y-1))) + return z \ No newline at end of file diff --git a/exercise_2/2026SS-TheoInf-HAB02.pdf b/exercise_2/2026SS-TheoInf-HAB02.pdf new file mode 100644 index 0000000..c8537b0 Binary files /dev/null and b/exercise_2/2026SS-TheoInf-HAB02.pdf differ diff --git a/exercise_2/HAB02-A3-Template.TXT b/exercise_2/HAB02-A3-Template.TXT new file mode 100644 index 0000000..9de998d --- /dev/null +++ b/exercise_2/HAB02-A3-Template.TXT @@ -0,0 +1,41 @@ +# Gefordert: kommentiertes WHILE-Programm +# Sie können weitere Hilfsfunktionen verwenden! +# Namen: +# +# +# + +########## HILFSFUNKTIONEN ########## + +def binLength(n): # binLength(n: int) -> int: + # ... + return # ... + +def binTestBit(n, i): # binTestBit(n: int, i: int) -> int: + # ... + return # ... + + + +########## HAUPTFUNKTIONEN ########## (Namen und Signatur nicht ändern!) + +def ListCreate(): # ListCreate() -> int: + # ... + return # Ausgabe ist Integer, KEINE LISTE + +def ListGetLength(l): # ListGetLength(l: int) -> int: + # ... + return # Parameter und Ausgabe sind Integer, KEINE LISTEN + +def ListGetElement(l, i): # ListGetElement(l: int, i: int) -> int: + # ... + return # Parameter und Ausgabe sind Integer, KEINE LISTEN + +def ListAppendElement(l, e): # ListAppendElement(l: int, e: int) -> int: + # ... + return # Parameter und Ausgabe sind Integer, KEINE LISTEN + + + + + \ No newline at end of file diff --git a/exercise_2/HAB02-Z1-Template.TXT b/exercise_2/HAB02-Z1-Template.TXT new file mode 100644 index 0000000..1c760d9 --- /dev/null +++ b/exercise_2/HAB02-Z1-Template.TXT @@ -0,0 +1,30 @@ +# Gefordert: kommentiertes WHILE-Programm; maximaler Eingabewert bei einer Minute Laufzeit (als Kommentar); Abschätzung Anzahl Rechenschritte (als Kommentar); +# Sie können weitere Hilfsfunktionen verwenden! +# Namen: +# +# +# + +########## HAUPTFUNKTION ########## (Namen und Signatur nicht ändern!) + +def IsOddFast(n): # IsOddFast(n: int) -> int: + # ... + return # Ausgabeformat: 0 für gerade, 1 für ungerade + + + + +# Maximaler Eingabewert bei ca. einer Minute Laufzeit: + +# Abschätzung Anzahl Rechenschritte (keine Sonderzeichen oder hochgestellte Zeichen verwenden): +# +# +# +# +# +# +# +# + + + \ No newline at end of file diff --git a/exercise_2/HAB02-Z2-Template.TXT b/exercise_2/HAB02-Z2-Template.TXT new file mode 100644 index 0000000..ffdbc2f --- /dev/null +++ b/exercise_2/HAB02-Z2-Template.TXT @@ -0,0 +1,53 @@ +# Gefordert: kommentiertes WHILE-Programm; maximales n zum Erzeugen und Auslesen von (1,...,n) in einer Minute; Abschätzung Anzahl Rechenschritte; +# Sie können weitere Hilfsfunktionen verwenden! +# Namen: +# +# +# + +########## HILFSFUNKTIONEN ########## + +def binLength(n): # binLength(n: int) -> int: + # ... + return # ... + +def binTestBit(n, i): # binTestBit(n: int, i: int) -> int: + # ... + return # ... + + + +########## HAUPTFUNKTIONEN ########## (Namen und Signatur nicht ändern!) + +def ListCreate(): # ListCreate() -> int: + # ... + return # Ausgabe ist Integer, KEINE LISTE + +def ListGetLength(l): # ListGetLength(l: int) -> int: + # ... + return # Parameter und Ausgabe sind Integer, KEINE LISTEN + +def ListGetElement(l, i): # ListGetElement(l: int, i: int) -> int: + # ... + return # Parameter und Ausgabe sind Integer, KEINE LISTEN + +def ListAppendElement(l, e): # ListAppendElement(l: int, e: int) -> int: + # ... + return # Parameter und Ausgabe sind Integer, KEINE LISTEN + + +# Maximales n zum Erzeugen und Auslesen der Liste (1,...,n) in ca. einer Minute: + +# Abschätzung Anzahl Rechenschritte in Abhängigkeit der Listengröße (=Anzahl Eingabebits): +# +# +# +# +# +# +# +# + + + + \ No newline at end of file diff --git a/exercise_2/task1.txt b/exercise_2/task1.txt new file mode 100644 index 0000000..bb64058 --- /dev/null +++ b/exercise_2/task1.txt @@ -0,0 +1,18 @@ + 0 R5 <- 4 + 1 R6 <- R0 - R5 + 2 IF R6 = 0 GOTO 5 // Wenn R0 <= 4 wird der RR0 / 5 berechnet, sonst wird 0 zurückgegeben + 3 R0 <- 0 + 4 GOTO 17 + 5 R5 <- 5 + 6 R7 <- 0 + 7 R8 <- 1 + 8 R9 <- RR0 + 9 R6 <- R5 - R9 +10 IF R6 = 0 GOTO 13 // Wenn RR0 >= 5 wird RR0 - 5 berechnet und R7 inkrementiert, sonst wird R7 zurückgegeben +11 R0 <- R7 +12 GOTO 16 +13 R6 <- R9 - R5 +14 RR0 <- R6 +15 R7 <- R7 + R8 +16 GOTO 8 +17 STOP