# Category Archives: Mathematical

## Lagrange’s InterpolationJanuary 28, 2016

What is Interpolation? Interpolation is a method of finding new data points within the range of a discrete set of known data points (Source Wiki).… Read More »

## Farey SequenceJanuary 21, 2016

Farey sequence is a sequence which is generated for order n. The sequence has all rational numbers in range [0/0 to 1/1] sorted in increasing… Read More »

## Adjoint and Inverse of a MatrixJanuary 20, 2016

Given a square matrix, find adjoint and inverse of the matrix. We strongly recommend you to refer below as a prerequisite of this. Determinant of… Read More »

## Find smallest values of x and y such that ax – by = 0January 18, 2016

Given two values ‘a’ and ‘b’ that represent coefficients in “ax – by = 0”, find the smallest values of x and y that satisfy… Read More »

## Sieve of AtkinJanuary 16, 2016

Given a limit, print all primes smaller than or equal to the given limit. Examples: Input: limit = 10 Output: 2, 3, 5, 7 Input:… Read More »

## Hungarian Algorithm for Assignment Problem | Set 1 (Introduction)January 14, 2016

Let there be n agents and n tasks. Any agent can be assigned to perform any task, incurring some cost that may vary depending on… Read More »

## Sieve of Sundaram to print all primes smaller than nJanuary 12, 2016

Given a number n, print all primes smaller than or equal to n. Examples: Input: n = 10 Output: 2, 3, 5, 7 Input: n… Read More »

## Determinant of a MatrixJanuary 8, 2016

What is Determinant of a Matrix? Determinant of a Matrix is a special number that is defined only for square matrices (matrices which have same… Read More »

## Program for Newton Raphson MethodJanuary 4, 2016

Given a function f(x) on floating number x and an initial guess for root, find root of function in interval. Here f(x) represents algebraic or… Read More »

## Pollard’s Rho Algorithm for Prime FactorizationJanuary 3, 2016

Given a positive integer n, and that it is composite, find a divisor of it. Example: Input: n = 12; Output: 2 [OR 3 OR… Read More »

## Program for Bisection MethodDecember 27, 2015

Given a function f(x) on floating number x and two numbers ‘a’ and ‘b’ such that f(a)*f(b) < 0 and f(x) is continuous in [a,… Read More »

## Gaussian Elimination to Solve Linear EquationsDecember 20, 2015

The article focuses on using an algorithm for solving a system of linear equations. We will deal with the matrix of coefficients. Gaussian Elimination does… Read More »

## Find Square Root under Modulo p | Set 1 (When p is in form of 4*i + 3)

Given a number ‘n’ and a prime ‘p’, find square root of n under modulo p if it exists. It may be given that p… Read More »

## Euler’s criterion (Check if square root under modulo p exists)December 19, 2015

Given a number ‘n’ and a prime p, find if square root of n under modulo p exists or not. A number x is square… Read More »

## Compute n! under modulo pDecember 16, 2015

Given a large number n and a prime p, how to efficiently compute n! % p? Examples: Input: n = 5, p = 13 Output:… Read More »