You might have seen the famous approximation $\sin(x) \approx x$ for $x$ near 0. We can use derivatives to approximate non-linear functions by simpler linear functions. We can better understand this by looking at the graph a function $f$ under magnification. The blue curve is the graph of $f(x) = \sin(x)$ and the yellow line is its tangent at $x = 0$. We can see that, under magnification of the curve at the point $x = 0$, the tangent line to the curve at $x = 0$ is a close approximation of the function for $x$ near 0. In general, for a function $f$: if $f$ is differentiable at a point $x_0$, then stronger and stronger magnifications at $(x_0,f(x_0))$ eventually make the curve containing $(x_0,f(x_0))$ look more and more like a non-vertical line segment, that line being the tangent line to the graph of $f$ at $(x_0,f(x)_0))$. Thus, a function $f$ that is differentiable at $x_0$ is said to be locally linear at the point $(x_0,f(x_0))$ . By contrast, the graph of a functi...
Sexy Primes, What are they? They are prime numbers that differ by 6. For example, 5 & 11, 7 & 13. The name comes from the Latin word for six; sex. What we are going to do is, write a program to generate all the sexy prime pairs within a given interval of natural numbers. Sexy Prime Pairs This is a program to generate all the sexy prime pairs below 10000. Program def check_prime(n): for i in range(2,n//2+1): if n%i == 0: return False return True def primes_list(a,b): primes_list = [] for i in range(a,b): if check_prime(i): primes_list.append(i) return (primes_list) def sexy_list(primes_list): sexy_list = [] for i in primes_list: for j in primes_list: if j-i == 6: sexy_list.append((i,j)) return(sexy_...