Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 49 - CT_AI_Class-5
P. 49

    ALGORITHM IN REAL-LIFE

                     As you now understand what algorithms are, you might be surprised to know how
                     many algorithms you encounter every single day.

                     Here are a few examples of algorithm in real-life:

                     Example 1: ATM Machine

                     When you use an Automatic Teller Machine (ATM) to withdraw money, the ATM

                     follows a specific algorithm to verify your identity and check that you have enough
                     money in your account. Here is the simplified algorithm an ATM follows:

                     Step 1   User inserts debit card.

                     Step 2   ATM asks for PIN (secret number).

                     Step 3   Is PIN correct?

                              If NO: Show error and eject card.

                              If YES: Continue.

                     Step 4   User selects amount to withdraw.
                     Step 5   Is enough money in account?

                              If NO: Show error.

                              If YES: Dispense cash.

                     Step 6   Print receipt and eject card.

                                                      Example 2: Search Engine

                                                      When  you  search  something  on  a  search engine

                                                      like Google, it uses a smart set of steps to find useful
                                                      information  for you.  It  looks  at  your  search words,
                                                      related popular pages and past searches. It gives you

                                                      results in just a second.

                     Example 3: Traffic Lights

                     Traffic lights  also  follow an algorithm.  They systematically
                     change from red to yellow to green in a fixed order and stay on

                     for a certain time. Even in busy cities, more advanced algorithms

                                                                                              Algorithmic Thinking     47

| 44 45 46 47 48 49 50 51 52 53 54 |