Finding qth real root of a real number

In this post we will see how to find nth roots of a positive real number. We will use the Newton-Raphson method to deduce an iterative formula, and see its convergence.

The task is to find the real qth root of a real number. Let there be a non-negative real number C, of which the real qth root is to be found. Let the square root of C be x. We represent this with x=\sqrt[q]{C} .

\Rightarrow x^{q}=C
\Rightarrow x^{q}-C=0

So we are now to find the roots of the qth order function f(x)=x^{q}-C

Continue reading “Finding qth real root of a real number”


Counting Rectangles in an n X m Checked Board

We have a checked board like a chess board, but instead of 8 x 8 it has a dimension of n x m . The task is to count the number of rectangles of all possible dimensions i x j in that checked board. Also the question arises how many squares of all possible dimensions are there. We will solve this problem by establishing formulas by construction. After this we can calculate the number of rectangles and squares of a Chess Board or any other such checked board.

Continue reading “Counting Rectangles in an n X m Checked Board”

All Combinations Without Repetitions

Problem : To generate all Combinations of a set of distinct elements

Before we start discussing about the implementation we will go through the basic definitions of Combinations. Then we discuss the method to generate all the Combinations with examples and descriptions. Then the source code to implement the method will be presented. Continue reading.

Continue reading “All Combinations Without Repetitions”

r-Permutations With Repetitions

Problem : To generate all r-Permutation with repetitions of a set of distinct elements

Before we start discussing about the implementation we will go through the basic definitions of Permutations. Then we discuss the method to generate r-Permutations with repetitions with examples, and at last we implement a C Language Program of the problem. Continue reading.

Continue reading “r-Permutations With Repetitions”

Swapping Values

Problem:Developing Algorithm to interchange of the values stored in two given variables.

The exchanging of the values between two given variables is commonly known as value “swap” and the process is known as “swapping”.This can be archived by various approaches. Below, we will discuss about two different approaches with a total of three processes, and see their benefits and pitfalls.

Continue reading “Swapping Values”

Jumble Word Solver

Jumbled Word: A string of characters is given, the task is to find all the meaningful words that can be created by rearranging its letters. Solving a jumble word means to find all the meaningful words that can be made with the initial string.

Objective Of The Article

In this article first we will describe how a jumbled word can be solved and then we present a very simple computer program. After this we present an advanced computer program which will make the solution very fast with the help of a specially designed tree.

Article Revision: 3
Notice 25.9.2009 : This article is undergoing an update and will be made online soon .

Here is another related post Jumbled word solver with C++ and Perl implementation with hash and list: Jumble word solver again.
*Please Note:* This article is very old and lengthy, I am planning for either a revision or a rewrite for the trie tree part which reflect the recent modifications. At the time I wrote this I did not know that the datastructure which I worked out was a trie :) therefore the long explanation.
Continue reading “Jumble Word Solver”

Generating Twin Primes, Cousin Primes and Sexy Primes

Twin Prime: A twin prime is a set of two prime numbers whose absolute difference is 2. Let p1 and p2 primes such that p2 – p1 = 2, then the set { p1 , p2 } are twin primes.

Objective Of The Article

The objective of this article is to describe the basic algorithm to search for the twin primes first, and then make some modifications to make it better and faster. At last we present the final code

Article Revision: 2

Continue reading “Generating Twin Primes, Cousin Primes and Sexy Primes”