diff options
author | Julian T <julian@jtle.dk> | 2020-02-11 12:24:56 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-02-11 12:24:56 +0100 |
commit | 6db1a2cdd3b96731f2e092d55d8c2136eabc52d0 (patch) | |
tree | 2be8fae8ce82d708ed9f00f376dda14420850e80 /sem3/BfCI/mm3.md | |
parent | 57305119e05559c1c37e903aef89cd43f44c42c9 (diff) |
Rename and cleanup
Diffstat (limited to 'sem3/BfCI/mm3.md')
-rw-r--r-- | sem3/BfCI/mm3.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sem3/BfCI/mm3.md b/sem3/BfCI/mm3.md new file mode 100644 index 0000000..a0bb1b8 --- /dev/null +++ b/sem3/BfCI/mm3.md @@ -0,0 +1,19 @@ +# Lektier + +## Steps til strong induction bevis + +1. *[Basis step]* start med at bevis at P(1) er sandt. Altså hvad resten vil bygge på. +2. *[Inductive step]* bevis at hvis de første P(1 til k) er sandt er P(k+1) også sandt. + +## Recursive function + +En funktion der regner factorial. +Altså f(x) = 1 * 2 * 3 * .. * x + +Her vil f(1) = 1. +Og resten vil være f(x) = x * f(x-1). + +f(1) = 1 +f(2) = 2 * f(1) = 2 * 1 = 2 +f(3) = 3 * f(2) = 3 * 2 = 6 +f(4) = 4 * f(3) = 4 * 6 = 16 |