From 692f3f0586f83ad7b4bef8f7ce0e41c0278af688 Mon Sep 17 00:00:00 2001 From: Zunaid Ahmed Date: Sat, 7 Sep 2024 18:51:19 -0500 Subject: [PATCH 1/2] removed the names with asterisk --- source/frontmatter.ptx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/source/frontmatter.ptx b/source/frontmatter.ptx index e5caa11..5866a9c 100644 --- a/source/frontmatter.ptx +++ b/source/frontmatter.ptx @@ -59,12 +59,6 @@

-
  • -

    - Simon King, University of Jena* -

    -
  • -
  • Vartuyi Manoyan, Wright College @@ -89,18 +83,6 @@

  • -
  • -

    - Soma Dey, Wright College* -

    -
  • - -
  • -

    - Sydney Hart, Wright College* -

    -
  • -
  • Ted Jankowski, Wright College From 5addf5358a3ace558857c2d05280d6b8631ee15a Mon Sep 17 00:00:00 2001 From: Zunaid Ahmed Date: Sun, 8 Sep 2024 17:43:27 -0500 Subject: [PATCH 2/2] added proof and induction section --- source/relations/ch-relations.ptx | 1 + source/relations/sec-proofs-inductions.ptx | 107 +++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 source/relations/sec-proofs-inductions.ptx diff --git a/source/relations/ch-relations.ptx b/source/relations/ch-relations.ptx index 9d50e30..1f331aa 100644 --- a/source/relations/ch-relations.ptx +++ b/source/relations/ch-relations.ptx @@ -16,4 +16,5 @@ + \ No newline at end of file diff --git a/source/relations/sec-proofs-inductions.ptx b/source/relations/sec-proofs-inductions.ptx new file mode 100644 index 0000000..d024eda --- /dev/null +++ b/source/relations/sec-proofs-inductions.ptx @@ -0,0 +1,107 @@ +

    + Proof and Induction + +

    + Proofs are fundamental to mathematics and computer science, providing the means to demonstrate the truth of statements. One powerful proof technique is mathematical induction, which is especially useful for proving properties about integers, sequences, and recursive structures. Induction allows us to prove that a statement holds for all natural numbers by first proving it for a base case and then showing that if it holds for an arbitrary case, it must also hold for the next case. +

    +
    + + + Direct Proofdirect proof +

    + A direct proof is a straightforward method of proving a statement by assuming the premises and logically deriving the conclusion. For example, let’s prove that the sum of two even integers is always even. +

    + + + # Direct proof in Sage: Checking the sum of two even numbers + + def is_even(n): + return n % 2 == 0 + + a, b = 4, 6 # Two even numbers + is_even(a + b) + + +

    + This simple example shows that the sum of two even numbers a and b is also even, as their sum can be divided evenly by 2. +

    +
    + + + Mathematical Inductioninductionmathematical induction +

    + Mathematical induction is a proof technique used to prove statements about natural numbers. It consists of two steps: +

    +
      +
    • +

      + Base Case: Prove that the statement holds for the first value (usually 0 or 1). +

      +
    • +
    • +

      + Inductive Step: Prove that if the statement holds for some arbitrary value k, then it also holds for k+1. +

      +
    • +
    +

    + Together, these steps show that the statement holds for all natural numbers. Let’s use induction to prove that the sum of the first n positive integers is \frac{n(n + 1)}{2}. +

    + + + # Proof by induction: Sum of first n positive integers + + def sum_n(n): + return sum(range(1, n+1)) + + def induction_step(k): + return sum_n(k) + (k + 1) + + base_case = (sum_n(1) == 1 * (1 + 1) // 2) + inductive_step = (induction_step(3) == 3 * (3 + 1) // 2) + + base_case, inductive_step + + +

    + In the base case, for n = 1, we check that the sum is 1, and for the inductive step, we assume the statement holds for some k and show it holds for k + 1. In this example, we check for k = 3. +

    +
    + + + Strong Inductionstrong induction +

    + Strong induction is similar to regular induction, but in the inductive step, we assume the statement is true for all values up to some k (not just k itself) and use this to prove it for k+1. This method is particularly useful when proving statements about recursive structures or algorithms. +

    +

    + Let’s prove that any integer greater than 1 can be written as a product of prime numbers using strong induction. +

    + + + # Example: Strong induction to prove prime factorization + + def is_prime(n): + if n < 2: + return False + for i in range(2, int(n ** 0.5) + 1): + if n % i == 0: + return False + return True + + def factorize(n): + factors = [] + for i in range(2, n + 1): + while n % i == 0: + factors.append(i) + n //= i + return factors + + strong_induction_example = factorize(12) + strong_induction_example + + +

    + Using strong induction, we can show that any number n > 1 can be factorized into primes. In this example, we factorize 12 as 2 \times 2 \times 3, all of which are prime numbers. +

    +
    +