Sunday, October 26, 2014

Pattern Recognition-3

Again a pattern recognition question.
If we can denote "Orange" by the following number code,  151811475               
what will be the code for "Apple" ?

Answer

We can give a number to each and every letter in the sequence regardless of the case.(upper/lower)

A,   B,   C,   D,   E,   F,  G,   H,   I,    J,      K,      L,     M,    N,    O,    P,    Q,    R,    S,    T,     U,     V,     W,     X,    Y ,  Z
1,    2,  3,   4,    5,    6,  7,    8,   9,  10,      11,    12,    13,   14,   15,   16,   17,  18   19,    20,    21,  22,    23,    24,   25, 26 

Orange O,r,a,n,g,e  - 15 18 1 14 7 5         - 151811475
 Apple   A,p,p,l,e    -  1  16 16 12 5          - 11616125

Sunday, October 19, 2014

Pattern Recognition - 2


Can you find 10th, 21st, 50th, 101st and 1000th element in this pattern?
 
0,2,1,4,1,6,2,8,…………


Answer

It is combination of two number series.

0,2,1,4,1,6,2,8,…………
  1. Fibonacci series - http://www.mathsisfun.com/numbers/fibonacci-sequence.html
          0,_,1,_,1,_,2……

   2. Even number series
         _,2,_,4,_,6,_,8……
 
All the even count elements will be from even number series and odd count elements will be from Fibonacci series.

10th element will be 10/2 = 5th even number – 10
21st element will be (21+1)/2 =11th fibonacci number -55
50th element will be 50/2 =25th even number -50
101st element will be 101+1/2 =51st Fibonacci number – 12586269025
1000th element will be 1000/2=500th even number -1000

To find nth fibonacci number

private long FindFibonacciNumber(int n)
        {
            long i=0,k = 0;
            long j = 1;
            if (n == 1)
                return 0;
            if (n == 2)
                return 1;
            for (long count= 3; count <= n; count++)
            {
                k = i + j;
                i = j;
                j = k;       
            }
            return k;
        }

Pattern Recognition -1



Can you find the number pattern/series which is NOT the regular number series (1, 2, 3, 4………) where the value of the nth element will be n when n is an even number. For example 10th element in the series will be 10. 100th element will be 100.  1200th element will be 1200. But 101st element will not be 101. 123rd element will not be 123.
 
 Answer :

Well, This was my idea. Very simple.

The pattern is a mix of two number series.

If we take regular number series 1,2,3,4,5…….  We can divide that in to two patterns.
  1. Odd number pattern 1,_,3,_,5……
  2. Even number pattern _,2,_,4,_6,_..........

Now let us keep the second pattern as it is and let us change the first pattern, the odd series like this 1*2,3*2,5*2………
2,6,10,…….. again there is a pattern…

Now the combined pattern is 2, 2, 6, 4, 10,6,………  nth element will be n always when n is an even number.

We can create so many pattern series like this which fits to the given criteria. Is not it?


But some body at office came up with the following single series
n*(-1)^n 
^ denotes power of

That is an excellent answer.:)

Sunday, October 12, 2014

Son of a geek software developer


A little boy, son of a geek software developer (male) is very enthusiastic about computer system and computer softwares.  But in the school semester exam he scored low marks in most of the subjects and parents were informed about his poor performance.

Now parents questioning him the reasons for the poor performance with the feedback given by each and every subject teacher.



Mother:  Mathematics teacher says, whatever she teaches you do not get anything at all. Please tell me why you are unable to understand what she teaches? I know she is a brilliant teacher who makes students score very high marks even in public exams.

Son: Mom, system does not meet the basic requirements for that particular new installation. Something wrong with the system design which I cannot help.

----------------------------------------------------------------------------------------------------
Father: Son, Science teacher says, you always sleep at the class room so that you do not concentrate on the studies. Why is that?

Son: Dad, science subject is there on the time table right before my favorite Piano class which is the last subject of the day. So I make the system go to sleep mode and let it save some power so it can function really well in the piano class rather than becoming low-charged/ fully down without power.

-----------------------------------------------------------------------------------------------------
Mother:  Social studies and history teacher says,sometimes you vaguely looking at the other side during class time with out concentrating on the subject. What is wrong with you dear?

Son: During history class, loads of information is passed to the system and it feels really difficult handle the high load and sometimes system gets stuck. So I have to shutdown all the processes and restart the system and it takes a while.

----------------------------------------------------------------------------------------------------

Father: Your headmaster says, you got in to fight with some of the class mates after school. I told you not to involve in any fight with any one. Did not I?

Son: Dad! You only taught me if any virus or any attack attempt detected, the system should fight back and make the attacker powerless then only it can function properly otherwise system will get severely damaged. They crossed my way so I fought back to protect the system.
-----------------------------------------------------------------------------------------------------

Mother to Father: I think I have made a mistake. I should have taken my dad’s words “Do not marry a software engineer if you want a peaceful life”

:P :)