Split the marbles into sets of 4 each
Compare the first and second sets
If both the sets are equal (the problem is in third set)
{
   choose 2 of the marbles in the third set
   compare with 2 marbles from the first set(which we know are good)
   if comparision is equal
   {
      compare one of the remaining 2 marbles in the third set with a good marble
      if comparison is equal
         culprit is the uncompared marble in the third set
      else
        culprit is the last chosen marble in the third set
   }
   else
   {
      compare one of the chosen 2 marbles in the third set with a good marble
      if comparison is equal
         culprit is the uncompared marble in the chosen 2 of the third set
      else
        culprit is the last chosen marble in the third set
   }
}
else
{
   choose one of the marbles from the first pan and shift to second pan
   remove the other 3 marbles from the second pan and put 3 from the third pan
  If the comparison value changes (now < , previous > or vice versa)
  {
     one of the transferred 2 marbles is the culprit
     found by comparing one of the marble with a standard one (from third set)
  }
  else
  {
    If comparison value is equal
    {
      one of the three marbles from second pan was the culprit (we
know heavier or lighter now ...from the first comparison)
      can be determined by comparing two of the marbles
     if equal
     third guy is the culprit
     else
     the (heavier or ligher guy) as determined by the first comparison

   }
   else (comparison values are same)
   {
      one of the three unshifted marbles from the first pan is the culprit
     can be found in a strategy similar to the previous cases
   }
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to