Friday, April 16, 2010

Judgement

A person found guilty
Judge told
If you say truth you will be mprisoned for 5 years and if you say a lie you will be imprisoned for 10
he said something and was set free
what did he say

timing complexity of an algo

in a room their there are n people
amongst them one is a vip
everybody knows vip
vip knows nobody
and a person can ask only one question to another
do you know me?
find out who is the vip
now give a algo for this and state its timing complexity

match switches to bulbs

You have 3 switches and 3 bulbs to it
now the 3 bulbs are not visible outside the room
switches are outside the room
you are allowed to enter only once in a room
how will you check that which switch belongs to which bulb

Tuesday, April 6, 2010

how can i keep my bottle filled

i have a 1 litre bottle and i want that everyday some amount of water has to be consumed but still the bottle should never be empty

how can i do that?

you can neglect the surface tension and molecular bonding theories here.

Time for Autotmata

We know that for dfa

d or transition function is defined as

q x s->q
where q is the set of all the states and s is the set of input symbols

and in nfa

d is defined as

q x s->2^q


what do you interpret by this?

Sunday, April 4, 2010

TRAVEL the WORLD

A man travels 1 km south
takes a left and travels 1 km east
again he travels 1 km north

now he measures the distance between his initial and final position (displacement) using chain survey

what will be the readings?

Saturday, April 3, 2010

Time for simple limits

lets
f(x) = number of solutions for (sin y = 1) where y is [0,x];
g(x) = number of solutions for (sin^2y = 1) where y is [0-x];


c(x) = f(x)/g(x);

find the value of c(x) lim 1/x->0;

answer is simple and to the point