Skip to main content

HOW TO SEARCH

   


The search method that we are going to explore belongs to computers.  But it can be used in many real-life situations like crime investigation, eliciting an answer in an enquiry  etc,.  

     Consider a set of alphabetically arranged strings as given below.
1. ABC
2. BCD
3. CDE
4. DEF
 5. EFG
6. FGH
7. GHI
 8. HIJ
9. IJK
10. JKL
11. KLM
12. LMN
13. MNO

 I want to find the location of KLM.   Select the middle string in the list.  That is 7. GHI.  Since KLM is less than GHI, KLM must be present below it not above it.  So leave out the strings above 7.  Now we are left with, 
7. GHI
8.HIJ
9. IJK
10.JKL
11.KLM
12.LMN
13. MNO
  Now again go for the middle element which is 10.JKL.    Again KLM is less than JKL.  Hence leave out the top- half of the list.  Now we are left with,
10. JKL
11. KLM
12. LMN
13. MNO
 Now, if you select the middle element, you will land in KLM and its location is 11.  So we made it in 3 steps.

This kind of searching  is called binary searching.  Since we divide the list into 2 halves every time and leave out one half each time.  This is one of the fastest searching methods.  Suppose you want to search a data base of 100000 names.  In the first step we can eliminate 50000 names  and in the second step, 25000 names and so on.
 Say, a crime is committed and you want to find the culprit.  The investigating inquiry with the concerned people may go on as given below.

q1. Is the culprit alive or dead?
q2. Is the person man or woman?
q3. Is he /she known or unknown person?
q4. Is the person belongs to this town or not
q5. Is he /she belongs to your family or your office?
 In each question, we eliminate so many number of suspects and finally may zero in on the enemy.

     Long time ago, there was a television show by name 'what is in your mind?'.  The participant in the show has to think of a celebrity's name.  The expert shoots 15 questions to the participants one by one and ultimately finds out the name in the mind.  The questions were mainly based on binary elimination method.       

Comments

  1. I remember a scene of a movie, where the guy finds out the address of a Girl's college based on just a book with her and the local train that she catches during her morning sojourn.
    Indeed a simple and effective method to search a required data.

    ReplyDelete

Post a Comment

Popular posts from this blog

LISSAJOUS FIGURES

  Definition:  "When a particle is subjected to two sine wave motion or two oscillatory motion at right angles, the particle describes lissajous figures".      We know sine wave motion and circular motion is basically same.  Hence we draw two circles A and B perpendicular to each other.  The circle B rotates twice faster than circle A.  That is, frequency of circle B is two times than that of A.        A particle at the intersection of two circles is subjected to two sine wave motion   A and B at 90 degree simultaneously.  The particle will describe figures depending on the frequency and phase of A and B .  In our case, the ratio of frequency is  1:2 and the two waves are in phase.        To draw lissajous figures :  A moving point in both the circles are chosen.   Here we should remember; during the time taken by the circle A to complete one rotation, circle B completes two.  Hence the points are marked on the circles according to their speed.  Then straight lines

THE PARABOLA

          A jet of water shooting from a hose pipe will follow a parabolic path.  What is the so special about parabola.    Y= x^2 Draw a graph for the above equation.  It will result in a parabola.  This parabola is also called unit parabola.  Any equation involving square will yield a parabola. Example:  Y = 2x^2 +3x+3 (also called quadratic equation)    X= 2 and -2, both  satisfies the equation 4 = X^2.  Parabolic equations always have two solutions.     Any motion taking place freely under gravity follows parabolic path. Examples:   An object dropped from a moving train,   A bomb dropped from flying plane,  A ball kicked upwards.      If a beam of light rays fall on the parabolic shaped mirror, they will be reflected and brought to focus on a point.  This fact is made use of in Dish Antenna, Telescope mirrors, etc.      Inverted parabola shape is used in the construction of buildings and bridges.  Because the shape is able to bear more weight.      A plane

CASINO'S GAME

           Let us find out how the casino survives with mathematics.      Say, your friend invite you for a game of dice.  You must bet (wager) 2 dollars.  If you roll 'six' you will get back 8 dollars.  The game will go on for 30 rounds.  All sounds good.      The probability of rolling 'six' is 1/6.  Since the game will be played for 30 times, the 'expected win' is 30*1/6 = 5.  That is, you are expected to win 5 rounds out of 30.  Hence your gain will be 5 * 8 =40 dollars.  ok.  This also implies that you will loose 25 rounds.  Hence your loss will be 25*2 =50 dollars.  Your net gain will be gain-less = 40-50 = -10 dollars. For 30 rounds, the loss is -10 dollars, Hence, for one round =-10/30 = -1/3 dollars.  There will be a loss of -1/3 or 0.33 dollars per round.  It is not a fair game.     Let us make a simple formula to calculate  'Pay out per round\. The probability for a win = p The pay-out in case of win = V No. of rounds = n The expect