Posts

Showing posts from February, 2023

Prove that (f+g)(x) is an odd function, if f and g are odd functions (Stewart, Calculus)

Suppose f(x) and g(x) are odd functions. Prove that (f+g)(x) is also an odd function.  Answer:  1. Strategy By definition, f is an odd function if and only if f(-x) = - f(x) To show (f+g) is an odd function, we need to show (f+g)(-x) = - (f+g)(x) 2. Explanation Since $f(x)$ and $g(x)$ are odd functions $\Rightarrow f(-x) =-f(x)$ and $g(-x) =-g(x)$ By definition of sum of functions. $(f+g)(-x) =f(-x)+g(-x)$ $=-f(x)-g(x)$ $=-(f(x)+g(x))$ $=-(f+g)(x)$ (by definition of sum of functions) $\Rightarrow(f+g)(-x) =-(f+g)(x)$ $\Rightarrow f+g$ is an odd function. Q.E.D. 

[Math] Taking a square root of a number: finding an upper limit for factors of a non-prime number (Eratosthenes)

Eratosthenes has discovered that "a non-prime number has its factor (other than 1) that is less than the square root of the number."  1) Task: finding an upper limit for factors of a non-prime number.    2) Motivation: suppose number = 100 square root (100) = 10 factors of 100 = {1, 2, 4,5, 10, 20, 25, 50, 100}  Note that factors of 100 exist  before the square root of 100 (= 10). Namely, 1, 2, 4, 5 are those. With exception of 1, we have found prime factors of 10 that are less than 2,4, and 5. That's good enough information to determine that 100 is not a prime number.   3) An idea for mathematical proof would be: 1. suppose a number is a non-prime number. That is, this number = M * N where M>N > 0  2. multiplying N to both sides of the inequality  M>N results M*N > N^2  3. by design, this number = M*N > N^2 4. taking the square root, we have (M*N)^(1/2) > N  conclusion: a factor of a non-prime number is less than this number itself.    4

[Python] NOT operator examples

Image
  NOT operator takes 1 argument and gives you output based on the validity of the argument. If the argument is true, then the result of NOT operator(argument) is false.   If the argument is false, then the result of NOT operator(argument) is true.  I will provide a few examples: expression boolean value (true, false) of expression  NOT (boolean value of expression) 1 > 2 false true 3 == 3 true false "rain" == "Rain" false true "snow" == "snow" true false In Python codes: