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

Your heart -you do not know

  Size and Location: The human heart is roughly the size of a clenched fist and is located slightly to the left of the center of the chest. Despite its relatively small size, the heart plays a crucial role in pumping blood throughout the entire body. Heartbeat Variability: The heart does not beat at a constant rate. The interval between heartbeats can vary, and this variability is considered a sign of a healthy heart. Factors such as breathing, emotions, and physical activity influence the heartbeat. Electrical Conduction: The heart's contractions are controlled by electrical impulses. The sinoatrial (SA) node, often called the "natural pacemaker," generates electrical signals that regulate the heartbeat and coordinate the pumping of blood. Blood Pumping Capacity: On average, the human heart pumps about 2,000 gallons (or 7,570 liters) of blood each day. Over a lifetime, this amounts to pumping enough blood to fill several Olympic-sized swimming pools. Heart Chambers and V...

THE WORK HORSE "="

    One cannot think of  a mathematical step without 'is equal to ' .  It balances right hand side and left hand side.  It aids simplification and manipulation of a mathematical expression. example: 2(A+B)  = C 2A+2B  = C         2A = C-2B           A = C-2B/ 2   In an electronic calculator,  the pressing of ' = " sign executes an asthmatic expression  or simply calculates.       In computer languages, it plays very important role.                                                                 A = B   When a computer looks at this expression, the value stored in the location named B is just transferred to the storage named A .  After execution both A and B will have the same value an...

How does your smart phone detect motion, steps, rotation, and location?

 How it works-1  An accelerometer in a smartphone is a microelectromechanical system (MEMS) device that measures acceleration and tilt. It works by detecting changes in motion by measuring the vibration or acceleration of the device. The accelerometer consists of a small mass suspended on a spring inside a sealed chamber. When the device is subjected to acceleration, the mass moves relative to the device, causing a change in capacitance that can be measured and processed by the smartphone's hardware. The accelerometer measures acceleration in three dimensions (x, y, and z) and provides data that the smartphone's software can use to determine the device's orientation, detect motion, and track changes in velocity and acceleration. The accelerometer is used for a variety of purposes in a smartphone, including screen rotation, motion tracking for games and fitness apps, and detecting the position of the device for navigation and location services. Additionally, it can be used t...