Introduction In this tutorial, we are going to create a containerized machine learning application. It is a simple application but it can be used as a template to build a more serious one. I hope by the end of this post you will have a basic idea about the following cool topics and technologies: Machine

Problem Write a Python recursive function to compute the product of two positive integers. Solution The product of two positive integers (A*B) is nothing but the sum of the first integer (A), (B) times Code Here is the code in Python //Includes def RecursiveProduct(a, b): # Base case 1 if a == 0 or b

Fore more information please refer to the following post. This post only implements the solution in Python Code def RecursiveAvg(A, i, n): # Base case if i == n-1: return A[i]/n return A[i]/n + RecursiveAvg(A, i + 1, n) A = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] print "Average of A

For definition and C++ implementation you may refer to the following post. This post reimplements it in Python. Python code # N = 0 1 2 3 4 5 6 7 # Fibonacci (N) = 0 1 1 2 3 5 8 13 def Fibonacci (N): # Initial case is 0 by definition if N

For definition and more details please refer to the following post. This post only reimplements the code in Python. Python Code def RecursiveExp(x, n): # First base case if n == 0: return 1 # Second base case if n == 1: return x # Even values of (n) if n % 2 == 0:

Definition Please refer to the following article for definition. This article reimplements it in Python. Code def isAmicable(n, m): # Sum of (n) proper divisors ns = 0 # Sum of (m) proper divisors ms = 0 # Boolean: 1 if the sum of (n) proper divisors equals to (m) nb = 0 # Boolean:

Problem Given two integers A less than B. Write Python code to find the greatest common divisor between A and B commonly known as GCD. Definition GCD(A, B) is the largest positive integer that divides A and B without a remainder. We can loop starting at 2 ending at A and whenever we find a

Syntax The power function in Python can be easily computed by importing the math module as follows: import math # This will print 8 which is 2 to the power 3 print pow(2, 3) You can alternatively use the ** syntax as follows: # This will print 8 print 2**3 Modular Exponentiation The power function

Amicable Numbers Definition Two positive integer numbers (m, n) are amicable if the sum of the proper divisors of (m) is equal to (n) and the sum of the proper divisors of (n) is equal to (m). A proper divisor of a number does not include the number itself. For example, the proper divisors of

Introduction One of the - confusing - topics in Algorithm design is the concept of NP completeness. If you search the topic on the internet you will probably find tons of articles and lectures on the subject however in this short article I will summarize it so that it is easy to remember by the