Page 68 - 2502_Pakistan-kifayat_C-8
P. 68

Step 6:  Print Max.
              Step 7:  Stop

              Solution 3: Using Sorting (More Advanced)
              Step 1:  Start

              Step 2:  Input three numbers: A, B, and C.
              Step 3:  Put the numbers in a list or group: [A, B, C].
              Step 4:  Sort the list in descending order (largest to smallest).

              Step 5:  The first number in the sorted list is the greatest.
              Step 6:  Print the greatest number.

              Step 7:  Stop
              Analysis of Each Solution

              Analysing different solutions helps us understand which method is easiest, fastest, or most suitable for
              a particular situation. By comparing various approaches, we can choose the best solution that saves
              time, uses fewer steps, and is simple to follow—especially important when learning new concepts. This
              analysis guides us in making smarter choices when solving problems.

                  Solution 1: Uses simple if-else statements to compare numbers directly; easy to understand and
                 great for beginners.
                  Solution 2: Uses a variable to keep track of the maximum, making the process efficient and easy to
                 follow with a little more logic.

                  Solution 3: Sorts the numbers and picks the largest, which is powerful but too complex for just three
                 numbers.

              Solution 1 is best because it is simple, clear, and teaches basic decision-making effectively.

                   COMPUTATIONAL PROBLEMS THAT CANNOT BE SOLVED


              While computers are powerful tools that can solve many problems quickly, there are some problems that no
              computer or algorithm can solve—no matter how smart or fast it is. These problems are called unsolvable
              or undecidable because there is no guaranteed step-by-step method to always find the answer.
              This might seem surprising, but it shows that even with all the technology we have, there are limits to
              what computers can do.

              Problems Beyond Computational Reach

              Some problems are not impossible in theory, but so complex that even the best computers cannot
              solve them in a reasonable amount of time. These are called intractable problems.

              Some common examples are factoring large numbers quickly and Turing’s Halting problem.
              Factoring Large Numbers Quickly

              Imagine a huge number made by multiplying two prime numbers (numbers only divisible by 1 and
              themselves). Finding those two primes again is called factoring. For very large numbers, factoring takes
              a very long time—so long that it’s practically impossible to do quickly. This concept is used in Internet
              security to keep information safe.



                  66  Premium Edition-VIII
   63   64   65   66   67   68   69   70   71   72   73