Module 1  : Algorithm Thinking


What is Algorithm ?

An algorithm is a step-by-step set of instructions used to solve a problem or perform a task.
 

एल्गोरिथम क्या है ?

एल्गोरिथम निर्देशों का एक चरण-दर-चरण समूह है जिसका उपयोग किसी समस्या को हल करने या कार्य करने के लिए किया जाता है।

Why Algorithms Matter :

  • Break down complex problems into smaller, manageable steps.
  • Think logically and systematically.
  • Prepare our mind for coding.
  • To identify possible errors before the actual coding begins.

 

एल्गोरिथम क्यों महत्वपूर्ण हैं :

  • जटिल समस्याओं को छोटे, प्रबंधनीय चरणों में विभाजित करने के लिए।
  • तार्किक और प्रणालीबद्ध तरीके से सोचने के लिए।
  • अपने मस्तिष्क को कोडिंग के लिए तैयार करने के लिए।
  • वास्तविक कोडिंग शुरू होने से पहले संभावित त्रुटियों की पहचान करने के लिए।


Characteristics of a Good Algorithm :

  • Unambiguous: Each step should be clear and not open to multiple interpretations.
  • Well-defined Inputs and Outputs
  • Finiteness: It should complete in a finite number of steps.
  • Effectiveness: Every step must be basic enough to be carried out.
  • Ordered: Steps must follow a logical sequence.

 

अच्छे एल्गोरिथम की विशेषताएँ :

  • स्पष्ट: प्रत्येक चरण स्पष्ट होना चाहिए और उनकी अनेक व्याख्याएं न निकलती हो।
  • इनपुट और आउटपुट स्पष्ट रूप से परिभाषित हो।
  • सीमितता: चरणों की संख्या सीमित होनी चाहिए।
  • प्रभावशीलता: प्रत्येक चरण सरल व उपयोगी होना चाहिए ताकि इसे लागू किया जा सके।
  • क्रमबद्ध: चरणों को एक तार्किक क्रम का पालन करना चाहिए।


Tips to Write Effective Algorithms :

  • Use simple language.
  • Number each step.
  • Ensure the steps are logically ordered.
  • Be as detailed as needed for someone new to the task.
  • Don't skip "obvious" steps — what’s obvious to you may not be obvious to others.
 

प्रभावी एल्गोरिथम लिखने के लिए सुझाव :

  • सरल भाषा का प्रयोग करें।
  • चरण की नंबरिंग करें।
  • सुनिश्चित करें कि चरण तार्किक क्रम में हो।
  • नए व्यक्ति को आवश्यकतानुसार जानकारी दे।
  • “स्पष्ट" चरण छोड़ें मत - जो आपके लिए स्पष्ट है वह दूसरों के लिए स्पष्ट नहीं हो सकता।


Click Here to Download PDF (English Notes)


Practice Exercise


1. Find the logic, write an algorithm for:

a. How to cook instant noodles (maggi) perfectly?

b. How to connect a Bluetooth speaker to a phone?

c. How to install a mobile app from the Play Store/App Store?

d. How to create and save a document in MS Word?

e. Packing your bag for school?

f. Booking a movie ticket online?

g. Taking a screenshot on your phone?


Solutions


Ans (a)

Step No. 1: Put water in a pan and let it boil.
Step No. 2: Put Maggi and Masalas in the pan.
Step No. 3: Stir it occasionally and wait for 15 minutes to boil.
Step No. 4: Transfer the cooked Maggi from pan to bowl.
Step No. 5: Serve the tasty Maggi in a bowl.

स्वादिष्ट मैग्गी बनाने की सही प्रक्रिया :

चरण 1: एक पैन में पानी डालें और इसे उबलने दें।
चरण 2: पैन में मग्गी और मसाले डालें।
चरण 3: इसे बीच बीच में हिलाते रहें और उबलने के लिए 15 मिनट तक प्रतीक्षा करें।
चरण 4: पैन से पकी हुई मैग्गी को कटोरे में स्थानांतरित करें।
चरण 5: कटोरे में स्वादिष्ट मैग्गी परोसें।

Ans (b)

Step 1: Turn on the Bluetooth speaker

  • First, turn on your Bluetooth speaker.

Step 2: Turn on the mobile's Bluetooth

  • Go to your mobile's Settings.
  • Open the Bluetooth option and turn it on.

Step 3: Search for devices

  • After turning on Bluetooth, your phone will search for nearby Bluetooth devices.
  • Your speaker's name will appear in the list.

Step 4: Connect to the speaker

  • Tap on your speaker's name.
  • Once connected, you will see 'Connected' displayed on the phone.

Step 5: Test it

  • Play a song and check the sound is coming from the speaker or not.


स्टेप 1: Bluetooth स्पीकर ऑन करें
  • सबसे पहले अपने ब्लूटूथ स्पीकर को ऑन करें।
स्टेप 2: मोबाइल का Bluetooth ऑन करें
  • अपने मोबाइल की Settings (सेटिंग्स) में जाएं।
  • Bluetooth ऑप्शन को खोलें और उसे On करें।
स्टेप 3: डिवाइस सर्च करें
  • Bluetooth ऑन करने के बाद, आपका फोन आसपास के ब्लूटूथ डिवाइसेज़ को सर्च करेगा।
  • लिस्ट में आपके स्पीकर का नाम दिखाई देगा।
स्टेप 4: स्पीकर से कनेक्ट करें
  • अपने स्पीकर के नाम पर टैप करें।
  • कनेक्ट हो जाने के बाद फोन पर “Connected” लिखा हुआ दिखाई देगा।
स्टेप 5: टेस्ट करें
  • कोई गाना प्ले करें और देखिए कि आवाज स्पीकर से आ रही है या नहीं।

Ans (c)

Step 1: Open Play Store

  • Open the "Play Store" app on your mobile.

Step 2: Search for the app

  • Type the name of the app you want to install (such as – WhatsApp, Instagram, YouTube, etc.) in the search box.

Step 3: Select the app

  • Identify the correct app from the search results and tap on it.

Step 4: Tap on the Install button

  • On the app's details page, you will see the "Install" button – tap on it.

Step 5: Allow the download and installation to complete

  • The app will be downloaded and will install automatically.
  • After installation, the "Open" button will be displayed – tap on it to open the app.


स्टेप 1: Play Store खोलें
  • अपने मोबाइल में "Play Store" ऐप को खोलें।
स्टेप 2: ऐप सर्च करें
  • सर्च बॉक्स में उस ऐप का नाम टाइप करें जिसे आप इंस्टॉल करना चाहते हैं (जैसे – WhatsApp, Instagram, YouTube आदि)।
स्टेप 3: ऐप को सिलेक्ट करें
  • सर्च रिजल्ट में से सही ऐप को पहचानें और उस पर टैप करें।
स्टेप 4: इंस्टॉल बटन पर टैप करें
  • ऐप की डिटेल्स पेज पर आपको "Install" बटन दिखाई देगा – उस पर टैप करें।
स्टेप 5: डाउनलोड और इंस्टॉलेशन पूरा होने दें
  • ऐप डाउनलोड होगा और अपने आप इंस्टॉल हो जाएगा।
  • इंस्टॉल होने के बाद "Open" बटन दिखेगा – उस पर टैप करके ऐप खोलें।

Ans (d)

Step 1: Open MS Word

  • Open Microsoft Word on your computer or laptop.
  • Start > All Programs > Microsoft Office > Microsoft Word

Step 2: Create a new document

  • Once Word is open, click on "Blank Document".
  • A blank page will open where you can type.

Step 3: Type text

  • Now type content whatever you want (such as - essay, report, letter, etc.) using the keyboard.

Step 4: Save the document

  • Click on the office button in the top left corner and then click on Save.
  • Type the file name.
  • Choose the location (folder) where you want to save the file (like - Desktop, Documents, etc.).
  • Click the Save button.



चरण 1: MS Word खोलें
  • अपने कंप्यूटर या लैपटॉप में Microsoft Word ओपन करें।
  • Start > All Program > Microsoft Office > Microsoft Word

चरण 2: नया डॉक्युमेंट बनाएं
  • Word ओपन होने पर "Blank Document" पर क्लिक करें।
  • एक खाली पेज खुलेगा, जिसमें आप टाइप कर सकते हैं।

चरण 3: टेक्स्ट टाइप करें
  • अब आप जो भी कंटेंट लिखना चाहते हैं (जैसे – निबंध, रिपोर्ट, पत्र आदि), कीबोर्ड से टाइप करें।

चरण 4: डॉक्युमेंट को सेव (Save) करें
  • बाएं कोने में ऑफिस बटन पर क्लिक करे फिर सेव पर क्लिक करे
  • फाइल का नाम (File Name) टाइप करें।
  • उस जगह (Folder) को चुनें जहाँ आप फाइल सेव करना चाहते हैं (जैसे – Desktop, Documents, आदि)।
  • Save बटन पर क्लिक करें।


Ans (e)

  • Check timetable for the next day.
  • For each subject:
    • Put the textbook in bag.
    • Put the notebook in bag.
  • Take the following daily essentials:
    • Pen, Pencil, Geometry box etc.
  • Take water bottle and lunch box.
  • Check everything again using timetable.
  • Close bag.


  • अगले दिन के लिए टाइमटेबल चेक करें।
  • प्रत्येक विषय के लिए:
    • पुस्तकों को बैग में डालें।
    • नोटबुक को बैग में डालें।
  • दैनिक आवश्यकता की चीजे ले:
    • पेन, पेंसिल, जमेट्री बॉक्स आदि।
  • पानी की बोतल और लंच बॉक्स ले।
  • टाइमटेबल का उपयोग करके सब कुछ फिर से चेक करें।
  • बैग बंद करें।


Ans (f)

  • Open the movie booking website or app
  • Log in to your account
  • Search for the movie you want to watch.
  • Select the location (city and theatre).
  • Choose the date and show time.
  • Pick the number of tickets you want to buy.
  • Select your seats from the seat map.
  • Review your selection (movie, date, time, theatre, number of seats, seat numbers)
  • Click on 'Proceed to Payment'
  • Choose a payment method (e.g., UPI, credit/debit card, wallet)
  • Enter payment details and complete the payment.
  • Wait for confirmation.
  • Download the ticket.

  • फिल्म बुकिंग वेबसाइट या ऐप खोलें।
  • अपने अकाउंट को लॉग इन करें।
  • जिस फिल्म को आप देखना चाहते हैं, उसे खोजें।
  • स्थान (शहर और थिएटर) का चयन करें।
  • तारीख और शो समय चुनें।
  • आप जितनी टिकटों को खरीदना चाहते हैं, उनकी संख्या चुनें।
  • सीट मैप से अपनी सीटें चुनें।
  • अपनी चयन की समीक्षा करें (फिल्म, तारीख, समय, थिएटर, सीटों की संख्या, सीट नंबर)
  • 'भुगतान के लिए आगे बढ़ें' पर क्लिक करें।
  • भुगतान विधि चुनें (जैसे UPI, क्रेडिट/डेबिट कार्ड, वॉलेट)
  • भुगतान विवरण दर्ज करें और भुगतान पूरा करें।
  • पुष्टि का इंतजार करें।
  • टिकट डाउनलोड करें।
  •  

Ans (g)

  • Go to the screen you want to capture.
  • Press Power + Volume Down at the same time.
  • You will see a flash or hear a click.
  • The screenshot is saved in Gallery.

 

  • जिस स्क्रीन को आप कैप्चर करना चाहते हैं, उस पर जाए।
  • एक साथ पावर + वॉल्यूम डाउन दबाएँ।
  • आप एक फ्लैश देखेंगे या क्लिक की आवाज सुनेंगे।
  • स्क्रीनशॉट गैलरी में सेव हो जाएगा।