diff options
author | Julian T <julian@jtle.dk> | 2019-09-18 20:25:09 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2019-09-18 20:25:09 +0200 |
commit | c14b6a9b3e2f0a6128750e967c67f8324b46c0d3 (patch) | |
tree | 4a3ce656da2a1d7d08993d47dde4ec675a541eba /sem1/BfCI/mm3.md | |
parent | ceb14fd5301a7156102b62baa9add6c2beed351a (diff) |
Added all school stuff
Diffstat (limited to 'sem1/BfCI/mm3.md')
-rw-r--r-- | sem1/BfCI/mm3.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sem1/BfCI/mm3.md b/sem1/BfCI/mm3.md new file mode 100644 index 0000000..a0bb1b8 --- /dev/null +++ b/sem1/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 |