Thursday, July 22, 2010

Is the question stupid?

Questions which dont make sense.


Question 1. Which of the following columns is greater?

Column A   The number of integersthat are less than -10                                                        
Column B   The number of integers that are greater than 9
        

The answer they provide goes something like this.

First, you'll need to know that there are as many negative integers as there are positive integers, because for every positive integer,

there is an equivalent negative integer. However, the set of numbers in Column B is greater than the set of numbers in Column A because

Column B also includes positive 10, while Column A does not include negative 10.

I have a counter argument for this.

For the time being, lets map -11 to +10.
Now I would have to map -12 to +11.
-13 to +12 etc.
If I represent -11 as x and +10 as y (x and y being constants), the mapping becomes like this.

X -> Y
x-1 -> y+1
x-2 -> Y+2.

Now I denote the numbers added to x and y as z (z is a variable which increases by one always).

X-Z -> Y+Z . Note that Z is the same for both L.H.S and R.H.S.

The mapping holds true irrespective of the value of Z, even when  z-> infinity ( basically we say that Z tends to infinity). . For any value of Z from 1 to infinity, there is a number X-Z which can map to X+Z.

Hence by the law of induction, both are equal.

Column A is infinity and column B is infinity. This is the reason we cannot compare one infinity to another.

Do let me know your views. :)

Wednesday, July 21, 2010

Similarity between bug report and a case on trial before the court!

Sometimes logging a bug is like putting a case before the court.
In court, we talk about "air tight" cases. Similar is the case with bugs. In cases put on trial before the court, if there is any ambiguity in the facts, the case is summarily rejected. Similarly, we cannot log defects bases on "hunches". Hunches can be the "basis" of bugs. That is when we need to do our homework and make the case (the bug report) as tight as possible.

If I say that, in a particular scenario, the application is not working, then I should do my homework and find out what other scenarios it works and what all scenarios it wont work. This helps devs ( in fixing the issue) also .
The major advantage is that all the manifestations of the bug are fixed in one shot and no more time is spent by devs in fixing the same bug.

I have seen time and again, when a bug is logged, it is fixed for a particular scenario.Later on, the same bug is reopened or a new bug logged for another manifestation of the same issue in another scenario.