Wednesday, January 6, 2010

Array of 0 and 1, put 0's at even position and 1's at odd position

you are given an array of integers containing only 0s and 1s. you have to place all the 0s in even position and 1s in odd position and if suppose no if 0s exceed no. of 1s or vice versa then keep them untouched. Do that in ONE PASS and WITHOUT taking EXTRA MEMORY.

input array:
{0 1 1 0 1 0 1 0 1 1 1 0 0 1 0 1 1 }
output array:
{0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 }

Thursday, May 15, 2008
 
 
This is similar to an implementation of partition method of quick sort.

oddInd==0;
evenInd=1;

while(true)
{
  while(oddInd
  if(oddInd>=strLen) break;
  while(evenInd
  if(evenInd>=strLen) break;
  swap(str[evenInd], str[oddInd]);
}

Well, one more challenging version of this problem is to consider an array containing 0s,1s and 2s and do the same thing. This question was asked in one microsoft internship interview.
jigsaw Send private email
Thursday, May 15, 2008
 
 
OOPS!!! There was a big mistake in the above code.
This is similar to an implementation of partition method of quick sort.

oddInd==0;
evenInd=1;

while(true)
{
  while(oddInd  if(oddInd>=strLen) break;
  while(evenInd  if(evenInd>=strLen) break;
  swap(str[evenInd], str[oddInd]);
}

Well, one more challenging version of this problem is to consider an array containing 0s,1s and 2s and do the same thing. This question was asked in one microsoft internship interview.
jigsaw Send private email
Thursday, May 15, 2008
 
 
Perish the thought that anyone should use extra memory!

BTW, the indexes into the array are extra memory.

Too many of these questions are isomorphic with:
"Oh, so you can type in your code?  How about if we tie one arm behind your back?  YANK!  Still typing?  How about if we keep hitting you with this baseball bat?  Whack, whack, whack!  Still at it, huh?  Well, at least we got him down to 2 WPM."

Sincerely,

Gene Wirchenko
Gene Wirchenko Send private email
Thursday, May 15, 2008
 
 
:) That's funny. BTW when he said extra memory, he meant variable amt of memory i guess.
jigsaw Send private email
Friday, May 16, 2008
 
 
That seems to be what they mean when they say no extra memory. Heck making a function call allocates a frame on the stack so does that mean no function calls either?

  I always took it to mean no building a data structure.  Which can be a  valid restriction if data is going to be changing often(high rebuild costs) or you have a truly large dataset. It can be hard to get a std::vector to hit 100mb if you already have a number of other 100mb chunks floating around.
soup
Friday, May 16, 2008
 
 
soup,

The usual complexity-theoretic definition of "no extra memory" is that the program can use a constant number of registers just large enough to index the input.
d
Friday, May 16, 2008
 
 
I tried JigSaw's solution in to java(http://pastebin.com/f41fe39d1). I might have mis-understood the code but the resulting array is
1 0 1 0 1 0 1 0 1 0  1  0  1  0  1  1
ved Send private email
Monday, May 26, 2008
 
 
I think there is a problem in jigsaw's solution.His solution says:
oddInd==0;
evenInd=1;

while(true)
{
  while(oddInd  if(oddInd>=strLen) break;
  while(evenInd  if(evenInd>=strLen) break;
  swap(str[evenInd], str[oddInd]);
}
First of all.it will produce an an arrangement of 10101010 type of string.But that can be solved by using str[oddInd]==0 and str[evenInd]==1. But more serious problem is if the array is such that it has even no. of elements and each even positions are correctly filled with 0s and there are some extra 0s in odd positions because in that case the first inner while loop executes and then the outer while loop terminates by break statement.
sagsriv Send private email
Friday, June 13, 2008
 
 
@sagsriv

i guess the depend on understanding of "and if suppose no if 0s exceed no. of 1s or vice versa then keep them untouched"

e.g., input array:
{0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 }
output array should be:
a)
{0 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 }
since in the question, it states
"if 0s exceed no. of 1s or vice versa then keep them untouched"

or

b)
{0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 }
to move "0s" to the end.which should can be also done in one pass.

which looks better..lol
ray Send private email
Monday, July 07, 2008
 
 
Add all the numbers in the array to get the sum. The sum equals to number of ONEs in the array? Then prepare the sequence of 0,1,0,1 ... based on the no. of ONEs using a simple for loop.

Monday, December 7, 2009

What is the least number of links you can cut in a chain of 21 links to be able to give someone all possible number of links up to 21

Assume that a chain of length k for every 1<=k<=length(chain)
must be doable with the open links. Then you can reach

links length dissection

0 1 1
1 5 1-(1)-3
2 13 1-(1)-3-(1)-7
3 29 1-(1)-3-(1)-7-(1)-15
4 61 1-(1)-3-(1)-7-(1)-15-(1)-31
n 2^(n+2)-3
we have taken links as 2^k-1...and hence get such answer.
The question can be modified a bit...
You are having 31kg of rice. You are provided with a 1kg stone for weighing. In how many weights the 31kg of rice can be weighed.
Now we can't have empty selection...so for 
n we have 2^(n+1)-3...
so we have 2^(n+1)-3 = 31
n+1 = 6 (because 2^5 < 35 < 2^6 )
n=5

CTS Aptitude Question paper(Yellow)

1. If all the 6 are replaced by 9, then the algebraic sum of all the numbers from 1 to 100(both inclusive) varies by Ans: 330

2. The total no. of numbers that are divisible by 2 or 3 between 100 and 200(both inclusive) are Ans:67

3. From a pack of cards Jack, Queen, King & ace are removed. Then the algebraic sum of rest of the cards is Ans:216

4. The average temperature of days from Monday to Wednesday is 37 degree Celsius and that of from Tuesday to Thursday is 34 degrees. The temperature of Thursday is 4/5th of Monday. Then the temperature of Thursday is
Ans: 36 degrees
5. Swetha, Tina, Uma and Vidya are playing a gambling. In this different people lose in different games-in the reverse alphabetical order. The rule is that if one loses she should double the amount of others. At the end of 4th game each of them have same amount of money (Rs.32). Which one of them started with the least amount? (6) Which one of them started with the largest amount of money? (7.) At the end of the 2nd game what is the amount of money with uma?
Ans: Vidya, Swetha, Rs.8
8. A cube of 12 mm is painted on all its side. If it is made up of small cubes of size 3mm. If the big cube is splitted into those small cubes, the number of cubes that remain unpainted is Ans: 8

9. B is 50% faster than A. If A starts at 9 A.M. and B starts at 10 A.M. A travels at a speed of 50 km/hr. If A and B are 300 kms apart, The time when they meet when they travel in opposite direction is Ans:12 noon

10. A graph will be there. Inside the graph sheet there will be a Quadrilateral. We have to count the number of squares in the Quadrilateral.

11. You are having 31kg of rice. You are provided with a 1kg stone for weighing. In how many weights the 31kg of rice can be weighed. Ans: 5

12. A starts at 11:00AM and travels at a speed of 4km/hr. B starts at 1:00PM and travels at 1km/hr for the first 1hr and 2km/hr for the next hr and so on. At what time they will meet each other. Ans:

13. There are 80 coins, among them one coin weighs less compared to other. You are given a physical balance to weigh. In how many wieghings the odd coin can be found. Ans:
14. Dia of the circle 4cm. The shaded part is 1/3 of the square area. What is the side of the square. Ans: root of 3pi

15. A,B,C, can do a work in 8,14,16 days respectively. A does the work for 2 days. B continues from it and finishes till 25% of the remaining work. C finishes the remaining work. How many days would have taken to complete the work Ans:

16. Raja went to a beauty contest .his wife was eager to know the result he told that the lady wear a yellow sari was winner. Miss. Andhra Pradesh Miss. Utter Pradesh, Miss. Maharashtra, Miss. West Bengal were the participants all the participants sat in a row. The conditions are (A) The woman wore yellow sari won the competition. (B) Miss. West Bengal was neither the runner-up or winner.(C) Miss. West Bengal was not at either ends.(D) Miss. Maharastra wore the white sari.(E) The women wore white sari and yellow sari sat at extreme ends.(F) The runner-up and winner did not sit together. [This was the passage given and the questions were easy]

17. The ratio of white balls and black balls is 1:2. If 9 gray balls is added it becomes 2:4:3. Then what is number of black balls. Ans:12

18. There are 10 coins. 6 coins showing head. And 4 showing tail. Each coin was randomly flipped (not tossed) seven times successively.after flipping the coins are 5 heads 4 tails one is hided the hided coin will have what.

19. Two cars are 500 cm apart. each is moving forward for 100 cm at a velocity of 50 cm/s and receding back for 50 cm at 25 cm/s at what time they will collide with each other.

20. People near the sea shore are leading a healthy life as they eat fish.but people at other part of the city are also healthy. Inference.

21. It is found from research that if u r a drunken then u have a less chance for chronic heart diseases. Inference.

22. A-B+c>A+B-C i) B is +ve, ii) B is ?ve when it will hold true.
23. i) C.P is Rs 120 and profit is 30%
ii) C.P is Rs 210 and profit is 20%
we can find the S.P by using
i)only ii)only both i &ii neither i&ii

24. How will u find distance between Nagpur and Mumbai?
I took one hour more when I travel at 80 km/hr than at 90 km/hr.

25. 100 coins were collected by four persons each collected more than 10 each collected a different number each was an even number find what is the max possible no of coins, two more questions based on the same passage.

26. A car travels from B at a speed of 20 km/hr. The bus travel starts from A at a time of 6 A.M. There is a bus for every half an hour interval. The car starts at 12 noon. Each bus travels at a speed of 25 km/hr. Distance between A and B is 100 km. During its journey , The number of buses that the car encounter is

27. The ratio of the ages of the father and the son is 5:3, After 10 years it will be in the ratio 3:2. What will be their ages.
28. There was a Island. In that Island there was Rubys and Emeralds. Those were available in plenty. 0.3 kg of ruby is 4 lakhs and 0.4 kg of emeralds is 5 lakhs. Jayanth is buying 12 kg of Ruby and emerald. Choices will be given . Jayanth has to carry both ruby and emerald to the maximum profit.
29. Varun buys 8 books,10 pens and 2 pencils and Babu buys 6 books, 5pens and 5 pencils. Babu pays 50% more than Varun. What is the amount Varun spends in buying pencils.
30. Prakash and Revathi rent a fancy shop. Prakash imposes the following restrictions on Revathi for buying clips,stickers and lip sticks. The number of clips is twice the no. of stickers. The no. of lipsticks should be more than the sum of clips and stickers. Cost of clip is 1 rupee. Cost of lipstick is twice the clips. Cost of 1 lipstick is the cost of four stickers. Then What is the amount that Prakash spents for Revathi. Answer choices will be given.

Brain teasers and answers


  1. By moving one of the following digits, make the equation correct. 62 - 63 = 1



    26 - 63 = 1 (In other words, 2x2x2x2x2x2, which equals 64)


  2. You have a fox, a chicken and a sack of grain. You must cross a river with only one of them at a time. If you leave the fox with the chicken he will eat it; if you leave the chicken with the grain he will eat it. How can you get all three across safely?

    Take the chicken over first. Go back and bring the grain next, but instead of leaving the chicken with the grain, come back with the chicken. Leave the chicken on the first side and take the fox with you. Leave it on the other side with the grain. Finally, go back over and get the chicken and bring it over.

  3. You have 12 black socks and 12 white socks mixed up in a drawer. It's early in the morning and you don't have any light to see the colors. How many socks must you pull out (blindly) to be sure of getting a matching pair?

    3 socks. If the first sock is black, the second one could be black, in which case you have a matching pair. If the second sock is white, the third sock will be either black and match the first sock, or white and match the second sock.



  4. What is special about the following sequence of numbers?
    8 5 4 9 1 7 6 10 3 2 0

    The numbers are in alphabetical order.
    (eight, five, four, nine, one, seven, six, ten, three, two, zero)
  5. Three travelers register at a hotel and are told that their rooms will cost $10 each so they pay $30. Later the clerk realizes that he made a mistake and should have only charged them $25. He gives a bellboy $5 to return to them but the bellboy is dishonest and gives them each only $1, keeping $2 for himself. So the men actually spent $27 and the bellboy kept $2 - what happened to the other dollar of the original $30?

    Nothing. The 3 travelers paid a total of $27, making $25 for the hotel and $2 for the clerk. There is no missing $1.


  6. You are the bus driver. At your first stop, you pick up 29 people. On your second stop, 18 of those 29 people get off, and at the same time 10 new passengers arrive. At your next stop, 3 of those 10 passengers get off, and 13 new passengers come on. On your fourth stop 4 of the remaining 10 passengers get off, 6 of those new 13 passengers get off as well, then 17 new passengers get on. What is the color of the bus driver's eyes?

    The eye color of the reader of this problem. The first sentence is the key: "You are the bus driver"


  7. A rooster lays an egg at the very top of a slanted roof. Which side is the egg going to roll off on?

    Neither, roosters don't lay eggs.


  8. U2 has a concert that starts in 17 minutes and they must all cross a bridge to get there. All four men begin on the same side of the bridge. You must help them across to the other side. It is night. There is one flashlight. A maximum of two people can cross at one time. Any party who crosses, either 1 or 2 people, must have the flashlight with them.

    The flashlight must be walked back and forth. It cannot be thrown and other tricks like that are not needed to solve the problem. The solution is simply a matter of allocating resources in a certain order. Each band member walks at a different speed. A pair must walk together at the rate of the slower man's pace:

    Bono: 1 minute to cross
    Edge: 2 minutes to cross
    Adam: 5 minutes to cross
    Larry: 10 minutes to cross

    For example: if Bono and Larry walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Larry then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission.

    Let’s name the as A,B,C & D and let’s assume that they take 1,2,5 and 10 minutes respectively. Here is how they should cross the bridge.
    ABCD |—————————–-------|
    CD     |——-AB(2min)————->| ( AB comes and A returns)
    ACD   |<——-A-(1min)————--|B
    A       || ——-CD(10min)———>| BCD  (CD come and B returns)
    A ||    |<——-B-(2min)————--|
    AB     |—————————–-------|ABCD  (AB come)
    If you count all the trips ie. 2+1+10+2+2, it will be 17 minutes

  9. Why is it very common to have a 9 minute snooze interval on alarm clocks, why not 10 instead?

    By setting the snooze time to 9 minutes, the alarm clock only needs to watch the last digit of the time. So, if you hit snooze at 6.45, the alarm goes off again when the last digit equals 4. They couldn't make it 10 minutes, otherwise the alarm would go off right away, or it would take more circuitry.
  10. A bookworm eats from the first page of an encyclopedia to the last page. The bookworm eats in a straight line. The encyclopedia consists of ten 1000-page volumes and is sitting on a bookshelf in the usual order. Not counting covers, title pages, etc., how many pages does the bookworm eat through?

    On a book shelf the first page of the first volume is on the "inside"
    __                             __
    B| | | |F
    A|1 |...........................|10|R
    C| | | |O
    K| | | |N
    | | | |T
    ----------------------------------
    so the bookworm eats only through the cover of the first volume, then 8 times 1000 pages of Volumes 2 - 9, then through the cover to the 1st page of Vol 10. He eats 8,000 pages.




  11. An Arab sheikh tells his two sons to race their camels to a distant city to see who will inherit his fortune. The one whose camel is slower will win. The brothers, after wandering aimlessly for days, ask a wise man for advise. After hearing the advice they jump on the camels and race as fast as they can to the city. What does the wise man say?

    Solution »



  12. An 18-wheeler is crossing a 4 kilometer bridge that can only support 10,000 kilograms and that's exactly how much the rig weighs. Halfway across the bridge a 30 gram sparrow lands on the cab, but the bridge doesn't collapse. Why not?

    Solution »



  13. A completely black dog was strolling down Main Street during a total blackout affecting the entire town. Not a single streetlight had been on for hours. Just as the dog was crossing the middle line a Buick Skylark with 2 broken headlights speedily approaches his position, but manages to swerve out of the way just in time. How could the driver have possibly seen the dog to swerve in time?

    Solution »



  14. In a small cabin in the woods, two men lay dead. The cabin itself is not burned, but the forest all around is burned to cinders. How did the men die?

    Solution »



  15. Ida puts her coffee into the microwave, as she does every morning, for exactly 2 minutes. When the microwave goes off, she opens the door, but then closes the door again and sets the microwave for 2 more seconds. What good would 2 more seconds be?

    Solution »



  16. Beulah died in the Appalachians while Craig died at sea. Everyone was much happier with Craig's death. Why?

    Solution »



  17. You are a cook in a remote area with no clocks or other way of keeping time other than a four minute sandglass timer and a seven minute sandglass timer. (The kind you turn over - hourglass shaped) You do have a stove, however, with water in a pot already boiling. Somebody asks you for a nine-minute egg, and you know this person is a perfectionist and will be able to tell if you undercook or overcook the eggs by even a few seconds. What is the least amount of time it will take to prepare the egg? And how will you prepare it so that it is neither undercooked or overcooked?

    Solution »



  18. I am the owner of a pet store. If I put in one canary per cage, I have one bird too many. If I put in two canaries per cage, I have one cage too many. How many cages and canaries do I have?

    Solution »



  19. Here is a series of numbers. What is the next number in the sequence?
    1
    11
    21
    1211
    111221
    312211
    13112221

    Solution »



  20. My daughter has many sisters. She has as many sisters as she has brothers. Each of her brothers has twice as many sisters as brothers. How many sons and daughters do I have?

    Solution »



  21. What seven-letter word has hundreds of letters in it?

    Solution »



  22. If you had a ton of feathers and a ton of stones which would be heavier?

    Solution »



  23. Tom's mother has three children. One is named April, one is named May. What is the third one named?

    Solution »



  24. Two women apply for a job. They are identical. They have the same mother, father and birthday. The interviewer asks, "Are you twins?" to which they honestly reply, "No".

    How is this possible?

    Solution »



  25. You are standing outside a closed door. On the other side of the door is a room that has three light bulbs in it. The room is completely sealed off from the outside. It has no windows and nothing can get in or out except through the door. On the outside of the room there are three light switches that control each of the respective light bulbs on the other side of the door.

    Your assignment is to determine which light switch controls which light bulb. You are allowed to enter the room only once, and once you come out, you must be able to state with 100% certainty which light switch controls which light bulb.

    Solution »



  26. If a bottle and a cork cost a dollar and a nickel, and the bottle costs a dollar more than the cork, how much does the cork cost?

    Solution »



  27. A boat has a ladder that has six rungs. Each rung is one foot apart. The bottom rung is one foot from the water. The tide rises at 12 inches every 15 minutes. High tide peaks in one hour.

    When the tide is at its highest, how many rungs are under water?

    Solution »



  28. You have a lighter and two fuses that take exactly one hour to burn, but they don't burn at a steady rate. For example, one fuse could take 59 minutes to burn the first inch and then burn the rest of the fuse in the last minute.

    How would you use these two fuses to measure 45 minutes?

    Solution »



  29. You have two buckets - one holds exactly 5 gallons and the other 3 gallons. How can you measure 4 gallons of water into the 5 gallon bucket?

    (Assume you have an unlimited supply of water and that there are no measurement markings of any kind on the buckets.)

    Solution »



  30. A princess is as old as the prince will be when the princess is twice the age that the prince was when the princess's age was half the sum of their present ages.

    What are their ages?

    Solution »



  31. During WWII, there was a bridge connecting Germany and Switzerland, and on the German side, there was a sentry tower with a guard in it. He would come out every three minutes to check on the bridge, and he had orders to turn back anyone who tried to get into Germany, and shoot anyone trying to escape without a pass. There was a woman who desperately needed to get into Switzerland, and she knew she didn't have time to get a pass. It would take her at least six minutes to cross the bridge, but she managed to do it. How?

    Solution »



  32. A man can make perfect counterfeit bills. They look exactly like real ones, they're made of exactly the same materials, made the same way, everything. So perfect, one could pretty much call them real bills. One day he successfully makes a perfect copy of another bill. However, he gets caught when he tries to use the copy. How is this possible?

    Solution »



  33. A prisoner is told "If you tell a lie we will hang you; if you tell the truth we will shoot you." What can he say to save himself?

    Solution »



  34. How many people can read hex if only you and dead people can read hex?

    Solution »



  35. A man is traveling with a fox and two chickens, if he leaves the fox alone with the chickens the fox will eat the chickens. He comes to a river and needs to cross it, he finds a small boat that can carry only him and one animal, how does he get himself, the fox and two chickens across the river safely?

    Solution »



  36. A man is looking at a picture of a man on the wall and states: Brothers and sisters I have none, but this man's father is my father's son. Who is the man in the picture in relation to the man looking at the picture?

    Solution »



  37. A man and his son had a terrible car accident and were rushed to the hospital. The man died on the way, but the son was still alive and a surgeon was called in to operate. However, the surgeon saw the young boy and said, "I can't operate on this boy. He's my son."
    How is this possible?

    Solution »



  38. A wise king devised a contest to see who would receive the Princess' hand in marriage. The Princess was put in a 50x50 foot carpeted room. Each of her four suitors were put in one corner of the room with a small box to stand on. The first one to touch the Princess hand would be the winner and become the new King.
    The rules of the test were that the contestants could not walk over the carpet, cross the plane of the carpet, or hang from anything; nor could they use anything but their body and wits (i.e. no magic or telepathy, nor any items such as ladders, block and tackles etc). One suitor figured out a way and married the Princess and became the new King. What did he do?

    Solution »



  39. Two guards were on duty outside a barracks. One faced up the road to watch for anyone approaching from the North. The other looked down the road to see if anyone approached from the South. Suddenly one of them said to the other, "Why are you smiling?"

    How did he know his companion was smiling?

    Solution »



  40. You're riding a horse. To the right of you is a cliff and in front of you is an elephant going the same pace as you and you can't overtake it. To the left of you is a hippo running at the same speed and behind you is a lion chasing you. How do you get to safety?

    Solution »



  41. You have 50 quarters on the table in front of you. You are blindfolded and cannot discern whether a coin is heads up or tails up by feeling it. You are told that x coins are heads up, where 0 < x < 50. You are asked to separate the coins into two piles in such a way that the number of heads up coins in both piles is the same at the end. You may flip any coin over as many times as you want. How will you do it?

    Solution »



  42. You have four chains. Each chain has three links in it. Although it is difficult to cut the links, you wish to make a single loop with all 12 links. What is the fewest number of cuts you must make to accomplish this task?

    Solution »



  43. Walking down the street one day, I met a woman strolling with her daughter. "What a lovely child," I remarked. "In fact, I have two children," she replied. What is the probability that both of her children are girls?

    Solution »



  44. Three closed boxes have either white marbles, black marbles or both, and they are labeled white, black and both. However, you're told that each of the labels are wrong. You may reach into one of the boxes and pull out only one marble. Which box should you remove a marble from to determine the contents of all three boxes?

    Solution »



  45. A glass of water with a single ice cube sits on a table. When the ice has completely melted, will the level of the water have increased, decreased or remain unchanged?

    Solution »



  46. You are given eight coins and told that one of them is counterfeit. The counterfeit one is slightly heavier than the other seven. Otherwise, the coins look identical. Using a simple balance scale, can you determine which coin is counterfeit using the scale only once?

    Solution »



  47. You are given eight coins and told that one of them is counterfeit. The counterfeit one is slightly heavier than the other seven. Otherwise, the coins look identical. Using a simple balance scale, can you determine which coin is counterfeit using the scale only twice?

    Solution »



  48. I was visiting a friend one evening and remembered that he had three daughters. I asked him how old they were. "The product of their ages is 72," he answered. Quizzically, I asked, "Is there anything else you can tell me?" "Yes," he replied, "the sum of their ages is equal to the number of my house." I stepped outside to see what the house number was. Upon returning inside, I said to my host, "I'm sorry, but I still can't figure out their ages." He responded apologetically, "I'm sorry, I forgot to mention that my oldest daughter likes strawberry shortcake." With this information, I was able to determine all of their ages. How old is each daughter? You have enough information to solve the puzzle.

    Solution »



  49. You're in a room with two doors. There's a guard at each door. One door is the exit, but behind the other door is something that will kill you. You're told that one guard always tells the truth and the other guard always lies. You don't know which guard is which. You are allowed to ask one question to either of the guards to determine which door is the exit. What question should you ask?

    Solution »



  50. How far can a dog run into the forest?

    Solution »



  51. If eggs are 12¢ a dozen, how much would it cost for 100 eggs?

    Solution »



  52. You are a prisoner sentenced to death. The Emperor offers you a chance to live by playing a simple game. He gives you 50 black marbles, 50 white marbles and 2 empty bowls. He then says, "Divide these 100 marbles into these 2 bowls. You can divide them any way you like as long as you use all the marbles. Then I will blindfold you and mix the bowls and marbles up. You can then choose one bowl and remove one marble. If the marble is white, you live, but if the marble is black...you die.

    How do you divide the marbles up so that you have the greatest probability of choosing a white marble?

    Solution »



  53. What is the next number in this series?
    1, 2, 6, 42, 1806, ?

    Solution »



  54. What do the following numerals specify?
    11111121113122223222

    Solution »



  55. You must buy 100 chickens for exactly $100. You must buy at least one chicken from each store. The first store charges 5 cents/chicken, the second charges $1/chicken and the third charges $5/chicken. How many chickens should you buy from each store?

    Solution »



  56. What is special about the following number sequence?
    8, 5, 4, 9, 1, 7, 6, 10, 3, 2, 0

    Solution »

PSYCHOMETRY TEST

Direction:
In this section you will find different questions with
the same meaning. In all such questions your answer has to be same.
for e.g.:
In being thrown by chance with a stranger, you wait for the
person to introduce himself or herself.
(a) Yes (b)
No (c) ?

It is difficult for you to chat about things in general with
people.
(a) Yes (b)
No (c) ?

These two questions have similar meanings. If you answer
the first one 'NO' and the second one 'YES', i.e. if you differ in
your answers to similar questions you lose marks for every question
with the above meaning.


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

The choices to these questions are:
(a) Yes.
(b) No.
(c) ?

1. You start to work on a project with great deal of enthusiasm.
2. You would rather plan an activity than take part in it.
3. You have more than once taken lead in organizing project or a
group of some kind.
4. You like to entertain guests.
5. Your interests change quickly from one thing to another.
6. When you eat a meal with others, you are usually one of the last
to finish.
7. You believe in the idea that we should " eat, drink and be
merry, for tomorrow we die."
8. When you find that something you have bought is defective, you
hesitate to demand an exchange or a
refund.
9. You find it easy to find new acquaintances.
10. You are sometimes bubbling over with energy and sometimes very
sluggish.
11. You are happiest when you get involved in some projects that
calls for rapid action.
12. Other people think of you as being very serious minded.
13. In being thrown by chance with a stranger, you wait for the
person to introduce himself or herself.
14. You like to take part in many social activities.
15. You sometimes feel "just miserable" for no good reason at all.
16. You are often so much " on the go" that sooner or later you may
wear yourself out.
17. You like parties you attend to be lively.
18. If you hold an opinion that is radically different that expressed
by a lecturer, you are likely to tell the
person about it either during or after the lecture.
19. It is difficult for you to chat about things in general with
people.
20. You give little thought to your failures after they are passed.
21. You often wonder where others get all the excess energy they seem
to have.
22. You are inclined to stop to think things over before you act.
23. You avoid arguing over a price with a clerk or sales person.
24. You would dislike very much to work alone in some alone place.
25. You often find it difficult to go to sleep at night because you
keep thinking of what happened during the
day.
26. You find yourself hurrying to get to places even when there is
plenty of time.
27. You like work that requires considerable attention to details.
28. You are satisfied to let some one else take the lead in group
activities.
29. You enjoy getting acquainted with people.
30. It takes a lot to get you emotionally stirred up or excited.
31. You work more slowly and deliberately than most people of your
sex and age.
32. You are a carefree individual.
33. When people do not play fair you hesitate to say anything about
it to them.
34. It bothers you to have people watch you at your work.
35. You have usually been optimistic about your future.
36. You like to have plenty of time to stop and rest.
37. You take life very seriously.
38. You enjoy applying for a job in person.
39. You would like to be a host or hostess for parties at club.
40. You often feel uncomfortable or uneasy.
41. You are the kind of person who is "on the go" all the time.
42. You often crave excitement.
43. The thought of making a speech frightens you.
44. You find it easy to start conversation with strangers.
45. You often feel guilty without a very good reason for it.
46. People think you are a very energetic person.
47. You sometimes make quick decisions that you later wish you hadn't
made.
48. You find it difficult to ask people for money or other donations,
even for a cause in which you are
interested.
49. You are so naturally friendly that people immediately feel at
ease with you.
50. You daydream a great deal.
51. You are quick in your actions.
52. You have a habit of starting things and then losing interest in
them.
53. When you were a child many of your playmates naturally expected
you to be the leader.
54. You sometimes avoid social contacts for fear of doing or saying
the wrong thing.
55. You have frequent ups and downs in mood, sometimes with and
sometimes without apparent cause.
56. You always seem to have plenty of vigour and vitality.
57. It is difficult for you to understand people who get very
concerned about things.
58. When a clerk in a store waits on others who come after you, you
call his or her attention to the fact.
59. You would be very unhappy if you were prevented from making
numerous social contacts.
60. There are times when your future looks very dark.
61. You sometimes wish that people would slow down a bit and give you
a chance to catch up.
62. Many of your friends think you take your work too seriously.
63. You hesitate to walk into a meeting when you know that everyone's
eye will be upon you.
64. You limit your friendships mostly to members of your own sex.
65. You almost always feel well and strong.
66. You seem to lack the drive necessary to get as much as other
people do.
67. You make decisions on the spur of the moment.
68. You are rather good at bluffing when you find yourself in
difficulty.
69. After being introduced to someone , you just cannot think of
things to say to make good conversation.
70. You feel lonesome even when with other people.
71. You are able to work for unusually long hours without feeling
tired.
72. You often act on the first thought that comes into your head.
73. At the scene of an accident, you take an active part in helping
out.
74. You have difficulty in making new friends.
75. Your mood often changes from happiness to sadness or vice versa
without knowing why.
76. You talk more slowly than most people.
77. You like to play practical jokes upon others.
78. You take the lead in putting life into a dull party.
79. You would like to belong to as many clubs and social
organizations as possible.
80. There are times when your mind seems to work very slowly and
other times when it works very rapidly.
81. You like to do things slowly and deliberately.
82. You are a happy-go-lucky individual.
83. When you are served stale or inferior food in a restaurant, you
say nothing about it.
84. You would rather apply for a job by writing a letter than by
going through with a personal interview.
85. You are often in low spirits.
86. You are inclined to rush from one activity to another without
pausing enough for rest.
87. You are so concerned about the future that you do not get as much
fun out of the present as you might.
88. When you are attracted to a person whom you have not met earlier
you make an active attempt to get
acquainted even though it may be quite difficult.
89. You are inclined to limit your acquaintances to select few
90. you seldom give your past mistakes a second thought.
91. You are less energetic than many people you know.
92. You often stop to analyzed your thoughts and feelings.
93. You speak out in meetings to oppose those whom you feel sure are
wrong.
94. You are so shy it bothers you.
95. You are sometimes bothered by having a useless thought come into
your mind over and over.
96. You get things in hurry.
97. It is difficult for you to understand how some people can be so
unconcerned about the future.
98. You lie to sell things (i.e. to act as a sales person)
99. You are often "Life of the Party".
100. You find daydreaming very enjoyable.
101. At work or at play other people find it hard to keep up with the
pace you set.
102. You can listen to a lecture without feeling restless.
103. You would rather work for a good boss than for yourself.
104. You can express yourself more easily in speech than in writing.
105. You keep in fairly uniform spirits.
106. You dislike to be hurried in your work.
107. You sometimes find yourself "crossing bridges before you come to
them".
108. You find it somewhat difficult to say "no" to a sales person who
tries to sell you something you do not
really want.
109. There are only a few friends with whom you can relax and have a
good time.
110. You usually keep cheerful in spite of trouble.
111. People sometimes tell you to "slow down" or "take it easy".
112. You are one of those who drink or smoke more than they know they
should.
113. When you think you recognize people you see in a public place,
you ask them whether you have met
them before.
114. You prefer to work alone.
115. Disappointment affect you so little that you seldom think about
them twice.
116. You are slow and deliberate in movements.
117. You like wild enthusiasm, sometimes to a point bordering on
rowdyism at a football or baseball game.
118. You feel self conscious in the presence of important people.
119. People think of you as being a very social type of person.
120. You have often lost sleep over your worries.
121. You can turn out a large amount of work in a short time.
122. You keep at a task until it is done, even after nearly everyone
else has given up.
123. You can think of a good excuse when you need one.
124. Other people say that it is difficult to get to know you well.
125. You daydreams are often about things that can never come true.
126. You often run upstairs taking two steps at a time.
127. You seldom let your responsibility interfere with your having a
good time.
128. You like to take on important responsibilities such as
organizing a new business.
129. You have hesitated to make or to accept "dates" because of
shyness.
130. Your mood is very easily influenced by people around you.
131. Others are often amazed by the amount of work you turn out.
132. You generally feel as though you haven't a care in the world.
133. You find it difficult to get rid of sales person whom you do not
care to listen or give your time.
134. You are a listener rather than a talker in a social conversation.
135. You almost always feel that life is very much worth living.
136. It irritates you to have to wait at a crossing for a long
freight train to pass.
137. You usually say what you feel like saying at the moment.
138. You like to speak in public.
139. You like to be with people.
140. You generally keep cool and think clearly in exciting situations.
141. Other people regard you as a lively individual.
142. When you get angry, if you let yourself go, you feel better.
143. You seek to avoid all trouble with other people.
144. People seem to enjoy being with you.
145. You sometimes feel listless and tired for no good reason.
146. It is hard to understand why many people are so slow and get so
little done.
147. You are fond of betting on horse races and games, whether you
can afford it or not.
148. If someone you know has been spreading untrue and bad stories
about you, you see the person as
soon as possible and have a talk about it.
149. Shyness keep you from being as popular as you should be.
150. You are generally free from worry about possible misfortunes.

Answers

Focus on word

A man has Ten Horses and nine stables as shown here.
[] [] [] [] [] [] [] [] []
The man wants to fit Ten Horses into nine stables. How can he fit Ten horses into nine stables? Submitted
Answer The answer is simple. It says the man wants to fit "Ten Horses" into nine stables. There are nine letters in the phrase "Ten Horses". So you can put one letter each in all nine stables.
[T] [E] [N] [H] [O] [R] [S] [E] [S]

Adding 2 character puzzles

ABC + DEF + GHI = JJJ

If different letters represent different digits, and there are no leading zeros, what does J represent?

Answer The value of J must be 9.
Since there are no leading zeros, J must be 7, 8, or 9. (JJJ = ABC + DEF + GHI = 14? + 25? + 36? = 7??) Now, the remainder left after dividing any number by 9 is the same as the remainder left after dividing the sum of the digits of that number by 9. Also, note that 0 + 1 + ... + 9 has a remainder of 0 after dividing by 9 and JJJ has a remainder of 0, 3, or 6. The number 9 is the only number from 7, 8 and 9 that leaves a remainder of 0, 3, or 6 if you remove it from the sum 0 + 1 + ... + 9. Hence, it follows that J must be 9.