Sunday, November 2, 2014

Math IQ

Again a mathematics question.


When a number is divided by 2 the remainder is 1.
When it is divided by 3 the remainder is 2.
When it is divided by 4 the remainder is 3.


Find the number or numbers which satisfy these conditions and  tell how did you find it?

Answer :
When a number is divided by 2 the remainder is 1. That means the (number+1) is divisible by 2.
In the same way, number+1 is divisible by 3 and 4 as well. Now we need to find the number/numbers which are divisible by 2,3 and 4

LCM(Least common multiple) comes in to play.

LCM for 2,3 and 4 is 12

[(Any number that is multiple of 12) - 1 ] will be the answer for this question.

Eg: 11,23,35,47

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 :)

Sunday, September 28, 2014

Software Industry in 2100



The Software industry is changing very fast and new technologies are emerging every day. The technologies that we used few years ago are outdated now what we are using now may be outdated in a few years’ time in the future.

In this fast-paced world, I just wanted to see (imagine) how the software industry will be in a 100 years, may be in 2100? To find an answer, let me fly along with the horse mind and let me share what I found there. :)



In 2100……..
I see loads of changes in the new era. Here are a few.

1)      Robots- Not only human engineers but robots also work in the software industry and there is huge competition going on between human and robots.

2)      Tools based development – Not like in the start of 21st century, all the software developments are based on tools means very less coding and more conceptualized.

3)      Action oriented programming – The object oriented concept and procedural language concept have ceased to exist and there is a new concept called “Action oriented programming” that has become famous in the software industry. “Action oriented” means all the common functions or actions have been implemented in tools and developers’ work is to identify them and may be a drag and drop will be enough.

4)      Upside down interview culture – In 2010, there were limited no of entrepreneurs and job hunting culture was to hire employees by conducting interviews. As the years pass by, now in 2100, no of employers seems to be more than the no of workers. So the current culture is to conduct interviews for employers and select a person who has the best work offer.

5)      Universalization - with the immense growth of space technology, the earth is now strongly connected with other planets such as Mars and Saturn. The software industries in Mars are willing to outsource to earth mainly for cost reduction.

6)      The largest universal airport – Sri Lanka, a small country in the Asia continent has seen incredible growth in space science and the world first space/universal airport has been built in Sri Lanka. The people from west, east and north have to come to Sri Lanka if they want to visit Mars. :)

Wish I got more time to stay in the imaginary world so I could have shared more with you. :P

Anyway let me fly back from the dream world and here I’m getting ready for my monday’s business. :)

Sunday, September 14, 2014

Compare software to human

Can we compare software to a human being? I would say “Yes” and here are my reasons.:) I’m going to use the term “product” which is common for both software and human. Please check it out and see if you can relate. I have given some possible explanations for some of the points at the end.


  • Only the creator knows the internal details especially with the complex versions.
  • The more a product is networked the more it will be vulnerable to any virus or malicious attacks.
  • Some products will have amazing look and feel but no great functionalities inside.
     Some products will not have an impressive look but would have some extraordinary   functionalities.But, in general, all the products will have some special functionalities with a good look.

  • At the very beginning stage, the product might seem bug-free but when we start interacting with it only we will get to know all the issues in it.
  • There should be at least two (types of) products linked together to make it look like a complete product.
    1. Front end
    2. Back end

          Front end - It can work alone ideally but won’t be much useful without a strong backend support.
          Back end – This too can work alone but it will not give a “whole product” feeling.

  • Most of the products are made with a particular set of functionalities and they are not meant to cater any other functionalities.
       But in some exceptional cases, some products come with “All in one” functionality.

  • No product is perfect. Every product has its own set strengths and weaknesses. The amount of defects in each of them may vary.
  • Some products will be compatible with many other products and will be able to communicate with them. But some of them have limited compatibility and narrowed communication channel.
  • After a certain time period, the product will be expired and either it will be disposed or it will be rewritten as a solely new product with the very same concept


     Let me explain some of the terms/concepts I used.

     "Complex versions"- Hope you know the very famous complex versions in the world. That is “women”  :)

      "At the very beginning stage"- infant-hood. Having said that new born baby is pure in the heart.
       As per my understanding, we all are born with some talents as well as some defects.
       And when it comes to software when you start using it only, all the issues will start to pop-up.

     "Front end"- Woman
     "Back end"- Man
     You could put it in the other way as well .It is debatable.

     “Communicate with many other products”- Some people are very out-going and    friendly.
      But some are bit reserved types. Again that is a design issue

     “Either it will be disposed or it will be rewritten as a solely new product with the very same concept.” –
     I have given both options because some people do believe in the concept of life after death
     but some do not.

               “Either it will be disposed” – The death will be the end of the journey.

               “Solely new product with the very same concept”-
                With reincarnation, the soul will get a new body in  the  next  birth.