<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6461099170288367321</id><updated>2012-01-20T15:25:31.344-08:00</updated><category term='math'/><category term='theory of gravity'/><category term='Babji Prashanth Chetty'/><category term='chetty prashanth'/><category term='einstein equation'/><category term='pi'/><category term='nth number in Fibonacci sequence'/><category term='chetty'/><category term='fibonacci numbers'/><category term='nuremberg'/><category term='india'/><category term='algorithms'/><category term='Java'/><category term='e'/><category term='Babji'/><category term='algorithm hacks'/><category term='sharing birthday puzzle'/><category term='journal of a nomad'/><category term='bangalore'/><category term='theory of relativity'/><category term='Disclaimer'/><category term='spiral walking'/><category term='hacks'/><category term='walk spirally in a rectangular grid'/><category term='Birthday puzzle'/><category term='nth Fibonacci number'/><category term='germany'/><category term='Prashanth'/><category term='algorithms in java'/><category term='probability'/><category term='famous mathematic equations'/><category term='fibonacci sequence'/><category term='google tale'/><title type='text'>Algorithm H4ckz</title><subtitle type='html'>Algorithm hacks</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://alg0-h4ckz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://alg0-h4ckz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Babji Prashanth, Chetty</name><uri>http://www.blogger.com/profile/13916612066453714169</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/-2bY6NuhCh6o/TwTTQ0AT7yI/AAAAAAAAhPQ/Lx6fytPpxfY/s220/mowgli3.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6461099170288367321.post-6293325920478246570</id><published>2008-07-26T11:27:00.000-07:00</published><updated>2009-10-19T12:30:36.267-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithms in java'/><category scheme='http://www.blogger.com/atom/ns#' term='sharing birthday puzzle'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='chetty prashanth'/><category scheme='http://www.blogger.com/atom/ns#' term='hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='probability'/><category scheme='http://www.blogger.com/atom/ns#' term='Babji'/><category scheme='http://www.blogger.com/atom/ns#' term='Birthday puzzle'/><category scheme='http://www.blogger.com/atom/ns#' term='math'/><title type='text'>Birthday Puzzle</title><content type='html'>Today, I was just reading some stuff and one of my friends who was surfing on the internet stumbled upon this puzzle and asked me the answer for that. Infact, I vaguely remember that I heard of this puzzle before, from one of my friends (who was questioned by some person in one of the interviews for a software job, at a good firm). The puzzle goes like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;Birthday Puzzle: In a software company (or any other place) of 48 employees, what is the percentage/probability that atleast 2 employees share the same birthday?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Answer&lt;/span&gt;: Most of the times, when someone comes across with questions like this, they make a guess and respond to that. But when asked a general question like that, the immediate thing that one should think about is "probability" and 'probability' gives you the best guess (doesnt guarantee you with the answer).&lt;br /&gt;&lt;br /&gt;Ok..The approach to solving this problem, is to calculate the probability that 'no two share the same birthday' and then subtract this from "1" (as the probabilty logic says), to arrive at the answer for the posed question. Here's the java code that I wrote:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;public class BirthdayPuzzle&lt;br /&gt;{&lt;br /&gt;  public static void main(String[] args) &lt;br /&gt;  {&lt;br /&gt;    System.out.println(&amp;quot;Enter The Year : &amp;quot;);&lt;br /&gt;    Scanner scanner = new Scanner(System.in);&lt;br /&gt;&lt;br /&gt;    String strYear = scanner.nextLine();&lt;br /&gt;&lt;br /&gt;    System.out.println(&amp;quot;Enter 'Number Of People' : &amp;quot;);&lt;br /&gt;    String strNumOfPeople = scanner.nextLine();&lt;br /&gt;    &lt;br /&gt;    try&lt;br /&gt;    {&lt;br /&gt;      int iYear = Integer.parseInt(strYear);&lt;br /&gt;      int iNumOfPeople = Integer.parseInt(strNumOfPeople);      &lt;br /&gt;&lt;br /&gt;      BirthdayPuzzle bp = new BirthdayPuzzle();&lt;br /&gt;      double probability = bp.findProbability(iNumOfPeople,iYear);&lt;br /&gt;      System.out.println(&amp;quot;Probability : &amp;quot; + probability);&lt;br /&gt;      System.out.println(&amp;quot;Exact Percentage : &amp;quot; + (probability * 100) + &amp;quot;%&amp;quot;);&lt;br /&gt;      System.out.println(&amp;quot;Rounded Percentage : &amp;quot; + &lt;br /&gt;        Math.round((probability * 100)) + &amp;quot;%&amp;quot;);&lt;br /&gt;    }&lt;br /&gt;    catch (Exception ex) {&lt;br /&gt;      System.out.println(&amp;quot;Wrong Input!&amp;quot;);&lt;br /&gt;      System.exit(0);&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public double findProbability(int numOfPeople, int year) {&lt;br /&gt;    double probability = 1;&lt;br /&gt;&lt;br /&gt;    int numOfDays = numOfDaysInAYear(year);&lt;br /&gt;    System.out.println(&amp;quot;Num of days in &amp;quot; + year + &amp;quot; : &amp;quot; + numOfDays);&lt;br /&gt;&lt;br /&gt;    for(int i=0;i&amp;lt;numOfPeople;i++) {&lt;br /&gt;      probability *= ((numOfDays-i) * 1.0)/numOfDays;&lt;br /&gt;    }&lt;br /&gt;    System.out.println(&amp;quot;Probability That 2 people dont &amp;quot; + &lt;br /&gt;      &amp;quot;share the same birthday : &amp;quot; + probability);&lt;br /&gt;&lt;br /&gt;    return (1.0 - probability);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public int numOfDaysInAYear(int year) {&lt;br /&gt;    if ((year % 4 == 0 &amp;amp;&amp;amp; year % 100 != 0) &amp;#124;&amp;#124; year % 400 == 0) {&lt;br /&gt;      return 366;&lt;br /&gt;    } else {&lt;br /&gt;      return 365;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above program asks for 'number of people' and 'year' as input and responds with the probabilty/percentage that atleast 2 people share the same birthday. Since, we are considering the 'year' also, I have taken care of leap years too.&lt;br /&gt;&lt;br /&gt;So, for '48' people and '2001' year, the above program responds with an probability of '0.9605979728794225'. (96%).&lt;br /&gt;&lt;br /&gt;And for '48' people and '2000' as input, it responds with '0.9602316176183399' (96%).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6461099170288367321-6293325920478246570?l=alg0-h4ckz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alg0-h4ckz.blogspot.com/feeds/6293325920478246570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://alg0-h4ckz.blogspot.com/2008/07/birthday-puzzle.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/6293325920478246570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/6293325920478246570'/><link rel='alternate' type='text/html' href='http://alg0-h4ckz.blogspot.com/2008/07/birthday-puzzle.html' title='Birthday Puzzle'/><author><name>Babji Prashanth, Chetty</name><uri>http://www.blogger.com/profile/13916612066453714169</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/-2bY6NuhCh6o/TwTTQ0AT7yI/AAAAAAAAhPQ/Lx6fytPpxfY/s220/mowgli3.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6461099170288367321.post-8718740286810587037</id><published>2008-07-04T13:14:00.000-07:00</published><updated>2009-10-19T12:27:37.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='india'/><category scheme='http://www.blogger.com/atom/ns#' term='walk spirally in a rectangular grid'/><category scheme='http://www.blogger.com/atom/ns#' term='Babji Prashanth Chetty'/><category scheme='http://www.blogger.com/atom/ns#' term='spiral walking'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='bangalore'/><category scheme='http://www.blogger.com/atom/ns#' term='Prashanth'/><category scheme='http://www.blogger.com/atom/ns#' term='Babji'/><category scheme='http://www.blogger.com/atom/ns#' term='chetty'/><category scheme='http://www.blogger.com/atom/ns#' term='germany'/><category scheme='http://www.blogger.com/atom/ns#' term='nuremberg'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm hacks'/><title type='text'>Spiral Walking</title><content type='html'>In this post, I'm gonna write down my Java solution to a problem/algorithm, called 'Spiral Walking', which is indeed well-known among folks who deal with or well-versed in algo's or any other important technical implementations. Some of the algo's sound familiar for developers (or would have implemented them in some of the other way, without knowing that), but when it comes to implementing them (as fast as possible) in any software language (in which, they are proficient), they would fail to do so, in most of the cases. This applies to all (including me). Infact, it aint that easy. They are all hard earned skills.&lt;br /&gt;&lt;br /&gt;I've implemented the solution for this 'Spiral Walking' problem, in Java. This solution might not be the best (or even upto the mark) and there might be many other ways to implement this, but I'm posting it any way, as its my soultion and I'm trying to do my best in coming up with a good and clear solution, for you folks to read and comment/suggest.&lt;br /&gt;&lt;br /&gt;Problem: Spiral Walking&lt;br /&gt;&lt;br /&gt;Description: The problem is to traverse a rectangular grid of cells, starting from the top first cell on the left. Initially, you start in the "right" direction and move through the grid, cell by cell. Each and every cell must be visited only once. If you end up in a cell, which is the last in that direction (or already visited), change direction and move forward. This should be done til you cover all the cells in that rectangular grid.&lt;br /&gt;&lt;br /&gt;Example: (for a 4*3 grid)&lt;br /&gt;&lt;br /&gt;- - &gt;&lt;br /&gt;^ &gt; |&lt;br /&gt;| v |&lt;br /&gt;&lt; - v       &lt;br /&gt;&lt;br /&gt;Java Solution:  In this solution, I'm using direction flags and a boolean matrix (to identify if a cell has been already visited or not) and returning a string[][] array of the resulting spiral path. I've not optimised the code for clarity and other reasons. Please feel free to comment/suggest with any other ideas or positive criticism. The Java implementation is as below:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public class SpiralWalking {&lt;br /&gt;    public static void main(String[] args)&lt;br /&gt;    {&lt;br /&gt;        SpiralWalking sw = new SpiralWalking();&lt;br /&gt;       &lt;br /&gt;        String res[][] = sw.walkSpirally(10,10);&lt;br /&gt;        for(int i=0;i&amp;lt;10;i++) {&lt;br /&gt;            System.out.println();&lt;br /&gt;            for(int j=0;j&amp;lt;10;j++) {&lt;br /&gt;                System.out.print(res[i][j] + &amp;quot; &amp;quot;);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public String[][] walkSpirally(int row, int col) {&lt;br /&gt;        boolean[][] matrix = new boolean[row][col];&lt;br /&gt;        String[][] res = new String[row][col];&lt;br /&gt;&lt;br /&gt;        for(int i=0;i&amp;lt;row;i++) {&lt;br /&gt;            java.util.Arrays.fill(matrix[i], false);&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        boolean east = true;&lt;br /&gt;        boolean south = false;&lt;br /&gt;        boolean west = false;&lt;br /&gt;        boolean north = false;&lt;br /&gt;        int x=0,y=0;&lt;br /&gt;&lt;br /&gt;        while(true) {&lt;br /&gt;            if(east) {&lt;br /&gt;                if(y &amp;lt; (col-1) &amp;amp;&amp;amp; !matrix[x][y]) {                   &lt;br /&gt;                    res[x][y] = &amp;quot;-&amp;quot;;&lt;br /&gt;                    matrix[x][y] = true;&lt;br /&gt;                    y++;&lt;br /&gt;                } else {&lt;br /&gt;                    if(!matrix[x][y]) {&lt;br /&gt;                        res[x][y] = &amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;                    } else {&lt;br /&gt;                        y--;&lt;br /&gt;                        res[x][y] = &amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;                    }&lt;br /&gt;                   &lt;br /&gt;                    x++;&lt;br /&gt;                    if(x &amp;gt;= row &amp;#124;&amp;#124; matrix[x][y]) {&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                    east = false;&lt;br /&gt;                    south = true;                   &lt;br /&gt;                }&lt;br /&gt;            } else if(south) {&lt;br /&gt;                if(x &amp;lt; (row-1) &amp;amp;&amp;amp; !matrix[x][y]) {&lt;br /&gt;                    res[x][y] = &amp;quot;&amp;#124;&amp;quot;;&lt;br /&gt;                    matrix[x][y] = true;&lt;br /&gt;                    x++;&lt;br /&gt;                } else {&lt;br /&gt;                    if(!matrix[x][y]) {&lt;br /&gt;                        res[x][y] = &amp;quot;v&amp;quot;;&lt;br /&gt;                    } else {&lt;br /&gt;                        x--;&lt;br /&gt;                        res[x][y] = &amp;quot;v&amp;quot;;&lt;br /&gt;                    }&lt;br /&gt;                   &lt;br /&gt;                    y--;&lt;br /&gt;                    if(y &amp;lt; 0 &amp;#124;&amp;#124; matrix[x][y]) {&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                    south = false;&lt;br /&gt;                    west = true;                   &lt;br /&gt;                }&lt;br /&gt;            } else if(west) {&lt;br /&gt;                if(y &amp;gt; 0 &amp;amp;&amp;amp; !matrix[x][y]) {&lt;br /&gt;                    res[x][y] = &amp;quot;-&amp;quot;;&lt;br /&gt;                    matrix[x][y] = true;&lt;br /&gt;                    y--;&lt;br /&gt;                } else {&lt;br /&gt;                    if(!matrix[x][y]) {&lt;br /&gt;                        res[x][y] = &amp;quot;&amp;lt;&amp;quot;;&lt;br /&gt;                    } else {&lt;br /&gt;                        y++;&lt;br /&gt;                        res[x][y] = &amp;quot;&amp;lt;&amp;quot;;&lt;br /&gt;                    }&lt;br /&gt;                   &lt;br /&gt;                    x--;&lt;br /&gt;                    if(x &amp;lt; 0 &amp;#124;&amp;#124; matrix[x][y]) {&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                    west = false;&lt;br /&gt;                    north = true;                   &lt;br /&gt;                }&lt;br /&gt;            } else if(north) {&lt;br /&gt;                if(x &amp;gt; 0 &amp;amp;&amp;amp; !matrix[x][y]) {&lt;br /&gt;                    res[x][y] = &amp;quot;&amp;#124;&amp;quot;;&lt;br /&gt;                    matrix[x][y] = true;&lt;br /&gt;                    x--;&lt;br /&gt;                } else {&lt;br /&gt;                    if(!matrix[x][y]) {&lt;br /&gt;                        res[x][y] = &amp;quot;^&amp;quot;;&lt;br /&gt;                    } else {&lt;br /&gt;                        x++;&lt;br /&gt;                        res[x][y] = &amp;quot;^&amp;quot;;&lt;br /&gt;                    }&lt;br /&gt;                   &lt;br /&gt;                    y++;&lt;br /&gt;                    if(y &amp;gt;= col &amp;#124;&amp;#124; matrix[x][y]) {&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                    north = false;&lt;br /&gt;                    east = true;                   &lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return res;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Since each and every cell has to be visited, this algo might be slow for large input values. But for this Java implementation, I've used 'int' for 'row' and 'col'. So, you cant specify large input values anyways, although it still matters.&lt;br /&gt;&lt;br /&gt;The code above outputs the following string[][] array, when provided with an input of 10 rows and 10 columns:&lt;br /&gt;&lt;br /&gt;- - - - - - - - - &gt;&lt;br /&gt;^ - - - - - - - &gt; |&lt;br /&gt;| ^ - - - - - &gt; | |&lt;br /&gt;| | ^ - - - &gt; | | |&lt;br /&gt;| | | ^ - &gt; | | | |&lt;br /&gt;| | | | &lt; v | | | |&lt;br /&gt;| | | &lt; - - v | | |&lt;br /&gt;| | &lt; - - - - v | |&lt;br /&gt;| &lt; - - - - - - v |&lt;br /&gt;&lt; - - - - - - - - v&lt;br /&gt;&lt;br /&gt;This solution can be optimised and customised, as per the requirements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6461099170288367321-8718740286810587037?l=alg0-h4ckz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alg0-h4ckz.blogspot.com/feeds/8718740286810587037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://alg0-h4ckz.blogspot.com/2008/07/spiral-walking.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/8718740286810587037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/8718740286810587037'/><link rel='alternate' type='text/html' href='http://alg0-h4ckz.blogspot.com/2008/07/spiral-walking.html' title='Spiral Walking'/><author><name>Babji Prashanth, Chetty</name><uri>http://www.blogger.com/profile/13916612066453714169</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/-2bY6NuhCh6o/TwTTQ0AT7yI/AAAAAAAAhPQ/Lx6fytPpxfY/s220/mowgli3.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6461099170288367321.post-4120481498787320017</id><published>2008-06-29T13:06:00.000-07:00</published><updated>2010-06-29T13:46:10.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nth number in Fibonacci sequence'/><category scheme='http://www.blogger.com/atom/ns#' term='fibonacci numbers'/><category scheme='http://www.blogger.com/atom/ns#' term='nth Fibonacci number'/><category scheme='http://www.blogger.com/atom/ns#' term='fibonacci sequence'/><title type='text'>nth Fibonacci Number</title><content type='html'>If someone asks you how to find the nth number in the Fibonacci sequence, remember the below formula:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_KT5j9JZRXjo/TCpXMqaE9AI/AAAAAAAAayk/W8rbJTknWos/s1600/fib.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_KT5j9JZRXjo/TCpXMqaE9AI/AAAAAAAAayk/W8rbJTknWos/s320/fib.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This formula is called '&lt;a href="http://en.wikipedia.org/wiki/Binet's_formula#Closed_form_expression"&gt;Binets Formula&lt;/a&gt;' and is based on the '&lt;a href="http://en.wikipedia.org/wiki/Golden_ratio"&gt;Golden Ratio&lt;/a&gt;'.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Other References:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;1) &lt;a href="http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html"&gt;Wolfram Mathworld&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) &lt;a href="http://www.google.com/search?rlz=1C1GGLS_enDE291DE304&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8&amp;amp;q=binets+formula"&gt;Let Me Google For You&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6461099170288367321-4120481498787320017?l=alg0-h4ckz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alg0-h4ckz.blogspot.com/feeds/4120481498787320017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://alg0-h4ckz.blogspot.com/2008/06/nth-fibonacci-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/4120481498787320017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/4120481498787320017'/><link rel='alternate' type='text/html' href='http://alg0-h4ckz.blogspot.com/2008/06/nth-fibonacci-number.html' title='nth Fibonacci Number'/><author><name>Babji Prashanth, Chetty</name><uri>http://www.blogger.com/profile/13916612066453714169</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/-2bY6NuhCh6o/TwTTQ0AT7yI/AAAAAAAAhPQ/Lx6fytPpxfY/s220/mowgli3.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_KT5j9JZRXjo/TCpXMqaE9AI/AAAAAAAAayk/W8rbJTknWos/s72-c/fib.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6461099170288367321.post-4944062172989459371</id><published>2007-10-06T04:24:00.000-07:00</published><updated>2008-07-06T06:08:16.643-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pi'/><category scheme='http://www.blogger.com/atom/ns#' term='einstein equation'/><category scheme='http://www.blogger.com/atom/ns#' term='e'/><category scheme='http://www.blogger.com/atom/ns#' term='theory of relativity'/><category scheme='http://www.blogger.com/atom/ns#' term='theory of gravity'/><category scheme='http://www.blogger.com/atom/ns#' term='famous mathematic equations'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='Babji Prashanth Chetty'/><title type='text'>Famous Math Equations</title><content type='html'>Time and again, there's this question/speculation about the famous 'Math Equations and Inequalities' (which are related to Physics too), that changed the world (or perception of the world) and helped in many ways. Infact, you can see their applications in everyday life. Here are some of the equations and inequalities, that I know (having read/used 'em long back in school and still dig 'em, for the love of math):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Euler's Number (e):&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_KT5j9JZRXjo/SHC-ddjfoUI/AAAAAAAAL8M/sEcD_0zFYiI/s1600-h/e2.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp2.blogger.com/_KT5j9JZRXjo/SHC-ddjfoUI/AAAAAAAAL8M/sEcD_0zFYiI/s320/e2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5219881381481390402" /&gt;&lt;/a&gt;&lt;br /&gt;This equation is one of the ways to calculate the Euler's number 'e'.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Pi:&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_KT5j9JZRXjo/SHC0wl4BTkI/AAAAAAAAL8E/MiI02B5DkVw/s1600-h/pi.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp1.blogger.com/_KT5j9JZRXjo/SHC0wl4BTkI/AAAAAAAAL8E/MiI02B5DkVw/s320/pi.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5219870715016203842" /&gt;&lt;/a&gt;&lt;br /&gt;'Pi' is defined as the ratio of the circumference of any circle to its diameter. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Equation Connecting 'e', 'Pi' and 'i':&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_KT5j9JZRXjo/SHCvGApid0I/AAAAAAAAL78/-Yuna4QUeeA/s1600-h/e.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://bp0.blogger.com/_KT5j9JZRXjo/SHCvGApid0I/AAAAAAAAL78/-Yuna4QUeeA/s320/e.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5219864485910705986" /&gt;&lt;/a&gt;&lt;br /&gt;All the 3 major constants in Mathematics are in this equation. Euler's number 'e', the most famous ratio of the circumference of a circle to its diameter 'pi' and the square root of '-1' (i).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Pythagoras/Pythagorean Theorem:&lt;/span&gt;&lt;br /&gt;a&lt;sup&gt;2&lt;/sup&gt; + b&lt;sup&gt;2&lt;/sup&gt; = c&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;In any "Right Triangle", the square of the 'Hypotenuse' is equal to the sum of the squares of the other 2 sides of the triangle.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Albert Einstein's Equation:&lt;/span&gt;&lt;br /&gt;E=mc&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;This equation connects 'mass', 'energy' and 'speed of light' which is considered by many, as the most famous equation in the world. This equation says that the amount of energy in a piece of mass ie equal to the mass multiplied with the square of the speed of light.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Equation For Gravitational Force:&lt;/span&gt;&lt;br /&gt;F = G(m1)(m2)/d&lt;sup&gt;2&lt;/sup&gt;&lt;br /&gt;If two objects 'm1' and 'm2' are separated by a distance 'd', then the 2 objects will attract each other with a force 'F' given in this formula. 'G' is the gravitational constant (which approximately equals to 6.67*10-11Nm&lt;sup&gt;2&lt;/sup&gt;kg-&lt;sup&gt;2&lt;/sup&gt;.&lt;br /&gt;&lt;br /&gt;Apart from this stuff, there are many other equations that I haven't listed. If you have some of your fav set of equations, feel free to comment/suggest. :-)&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6461099170288367321-4944062172989459371?l=alg0-h4ckz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alg0-h4ckz.blogspot.com/feeds/4944062172989459371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://alg0-h4ckz.blogspot.com/2007/10/famous-math-equations.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/4944062172989459371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/4944062172989459371'/><link rel='alternate' type='text/html' href='http://alg0-h4ckz.blogspot.com/2007/10/famous-math-equations.html' title='Famous Math Equations'/><author><name>Babji Prashanth, Chetty</name><uri>http://www.blogger.com/profile/13916612066453714169</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/-2bY6NuhCh6o/TwTTQ0AT7yI/AAAAAAAAhPQ/Lx6fytPpxfY/s220/mowgli3.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_KT5j9JZRXjo/SHC-ddjfoUI/AAAAAAAAL8M/sEcD_0zFYiI/s72-c/e2.gif' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6461099170288367321.post-2131990603189648881</id><published>2003-07-03T14:37:00.000-07:00</published><updated>2009-09-22T11:07:36.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='journal of a nomad'/><category scheme='http://www.blogger.com/atom/ns#' term='Disclaimer'/><category scheme='http://www.blogger.com/atom/ns#' term='bangalore'/><category scheme='http://www.blogger.com/atom/ns#' term='india'/><category scheme='http://www.blogger.com/atom/ns#' term='google tale'/><category scheme='http://www.blogger.com/atom/ns#' term='Prashanth'/><category scheme='http://www.blogger.com/atom/ns#' term='chetty'/><category scheme='http://www.blogger.com/atom/ns#' term='Babji'/><category scheme='http://www.blogger.com/atom/ns#' term='germany'/><category scheme='http://www.blogger.com/atom/ns#' term='nuremberg'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='Babji Prashanth Chetty'/><title type='text'>Disclaimer</title><content type='html'>DISCLAIMER:&lt;br /&gt;&lt;br /&gt;1) Someone said: "Thanks to the internet, stupid people all over the world can pedal their own shit while simultaneously imbibing the shit of millions of others leading to an exponential growth in shit, the full meaning of which we are still struggling to grasp. But it's bound to be shit".&lt;br /&gt;&lt;br /&gt;The Internet contains all sort of information. Some sources are genuine and some are fake (or scribbled by morons without proper knowledge in that field). So folks..its upto to you to use your intuition, do some research and cross-check with different sources of information and judge for yourself, what is right and what is wrong.&lt;br /&gt;&lt;br /&gt;2) I'm just one face in the IT-crowd and I'm 100% sure that I do mistakes and I dont know everything. So, this blog might contain mistakes too, as nothing is perfect and there is no Utopian place.&lt;br /&gt;&lt;br /&gt;5) I'm not trying to deal with any 'Politically Incorrect' stuff and I'm not trying to deal with (or hurt) anyone's sentiments.&lt;br /&gt;&lt;br /&gt;6) Finally, if there's anything that sounds/looks wrong, please feel free to correct me and I'm all ears for that.&lt;br /&gt;&lt;br /&gt;Happy Surfing! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6461099170288367321-2131990603189648881?l=alg0-h4ckz.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://alg0-h4ckz.blogspot.com/feeds/2131990603189648881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://alg0-h4ckz.blogspot.com/2006/07/disclaimer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/2131990603189648881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6461099170288367321/posts/default/2131990603189648881'/><link rel='alternate' type='text/html' href='http://alg0-h4ckz.blogspot.com/2006/07/disclaimer.html' title='Disclaimer'/><author><name>Babji Prashanth, Chetty</name><uri>http://www.blogger.com/profile/13916612066453714169</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='22' height='32' src='http://1.bp.blogspot.com/-2bY6NuhCh6o/TwTTQ0AT7yI/AAAAAAAAhPQ/Lx6fytPpxfY/s220/mowgli3.gif'/></author><thr:total>0</thr:total></entry></feed>
