The Josephus Problem

Introduction

The Josephus Problem is a count-out game which is regarded as a theoretical problem in Computer Science or Mathematics. In this game, n people stand in a circle s is the starting number of people. s is holding a sword where s kills s+k-1‘th people from his position and gives his sword to s+k‘th people. Thus s+k becomes new s.

Read More

How many regions do N lines divide a plane?

Explanations:

N straight lines are drawn on a plane paper. Each line intersects with rest all lines. That means N‘th line intersects N-1 lines. You can assume infinite number of lines can be drawn on that paper. You have to find total regions after N lines are drawn. An image is given below to understand the problem clearly.

Read More

The Tower of Hanoi Solution

Definition:

The Tower of Hanoi problem is a puzzle which can be solved by mathematically and can be implemented in programming code as well. The tower is also called Tower of Brahma or Lucas’ Tower. In this, game there are three pegs and one one of them hold n disks. n disks are ordered from higher radius to lower radius from the bottom to top.

Read More