Introduction to Problem Solving Class 11 Notes

Teachers and Examiners (CBSESkillEduction) collaborated to create the Introduction to Problem Solving Class 11 Notes. All the important Information are taken from the NCERT Textbook Computer Science (083) class 11.

Introduction to Problem Solving Class 11 Notes

Introduction to Problem Solving

Problems cannot be resolved by computers alone. We must provide clear, step-by-step directions on how to solve the issue. Therefore, the effectiveness of a computer in solving a problem depends on how exactly and correctly we describe the problem, create an algorithm to solve it, and then use a programming language to implement the algorithm to create a programme. So, the process of identifying a problem, creating an algorithm to solve it, and then putting the method into practise to create a computer programme is known as problem solving.

Steps for Problem Solving

To identify the best solution to a difficult problem in a computer system, a Problem Solving methodical approach is necessary. To put it another way, we must use problem-solving strategies to solve the difficult problem in a computer system. Problem fixing starts with the accurate identification of the issue and concludes with a fully functional programme or software application.
Program Solving Steps are –
1. Analysing the problem
2. Developing an Algorithm
3. Coding
4. Testing and Debugging

Analyzing the problem – It is important to clearly understand a problem before we begin to find the solution for it. If we are not clear
as to what is to be solved, we may end up developing a program which may not solve our purpose.

Developing an Algorithm – Before creating the programme code to solve a particular problem, a solution must be thought out. Algorithm is a step by step process where we write the problem and the steps of the programs.

Coding – After the algorithm is completed, it must be translated into a form that the computer can understand in order to produce the desired outcome. A programme can be written in a number of high level programming languages.

Testing and Debugging – The developed programme needs to pass different parameter tests. The programme needs to fulfil the user’s requirements. It must answer in the anticipated amount of time. For all conceivable inputs, it must produce accurate output.

Introduction to Problem Solving Class 11 Notes

What is the purpose of Algorithm?

A programme is created by a programmer to tell the computer how to carry out specific activities. Then, the computer executes the instructions contained in the programme code. As a result, before creating any code, the programmer first creates a roadmap for the software. Without a roadmap, a programmer might not be able to visualise the instructions that need to be written clearly and might end up creating a software that might not function as intended. This roadmap is known as algorithm.

Why do we need an Algorithm?

A programme is created by a programmer to tell the computer how to carry out specific activities. Then, the computer executes the instructions contained in the programme code. As a result, before creating any code, the programmer first creates a roadmap for the software. Without a roadmap, a programmer might not be able to visualise the instructions that need to be written clearly and might end up creating a software that might not function as intended. This roadmap is known as algorithm.

The purpose of using an algorithm is to increase the reliability, accuracy and efficiency of obtaining solutions.

Characteristics of a good algorithm

• Precision — the steps are precisely stated or defined.
• Uniqueness — results of each step are uniquely defined and only depend on the input and the result of the preceding steps.
• Finiteness — the algorithm always stops after a finite number of steps.
• Input — the algorithm receives some input.
• Output — the algorithm produces some output.

While writing an algorithm, it is required to clearly identify the following:

• The input to be taken from the user
• Processing or computation to be performed to get the desired result
• The output desired by the user

Introduction to Problem Solving Class 11 Notes

Representation of Algorithms

There are two common methods of representing an algorithm —flowchart and pseudocode. Either of the methods can be used to represent an algorithm while keeping in mind the following:
• it showcases the logic of the problem solution, excluding any implementational details
• it clearly reveals the flow of control during execution of the program

Flowchart — Visual Representation of Algorithms

A flowchart is a visual representation of an algorithm. A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows. Each shape represents a step of the solution process and the arrow represents the order or link among the steps.

There are standardized symbols to draw flowcharts. Some are given below –

flow chart symbols
Flow Chart Syntax
flow chart syntax

Introduction to Problem Solving Class 11 Notes

How to draw flowchart

Q. Draw a flowchart to find the sum of two numbers?

algorithm and flowchart for addition of two numbers

Q. Draw a flowchart to print the number from 1 to 10?

print the number from 1 to 10

Introduction to Problem Solving Class 11 Notes

Pseudocode

Another way to represent an algorithm is with a pseudocode, which is pronounced Soo-doh-kohd. It is regarded as a non-formal language that aids in the creation of algorithms by programmers. It is a thorough explanation of the steps a computer must take in a specific order.

The word “pseudo” means “not real,” so “pseudocode” means “not real code”. Following are some of the frequently used keywords while writing pseudocode –

  • INPUT
  • COMPUTE
  • PRINT
  • INCREMENT
  • DECREMENT
  • IF/ELSE
  • WHILE
  • TRUE/FALSE

Example

Write an algorithm to display the sum of two numbers entered by user, using both pseudocode and flowchart.

Pseudocode for the sum of two numbers will be –
input num1
input num2
COMPUTE Result = num1 + num2
PRINT Result

Flowchart for this pseudocode or algorithm –

algorithm and flowchart for addition of two numbers

Introduction to Problem Solving Class 11 Notes

Flow of Control

The flow of control depicts the flow of events as represented in the flow chart. The events can flow in a sequence, or on branch based on a decision or even repeat some part for a finite number of times.

Sequence – These algorithms are referred to as executing in sequence when each step is carried out one after the other.

Selection – An algorithm may require a question at some point because it has come to a stage when one or more options are available. This type of problem we can solve using If Statement and Switch Statement in algorithm or in the program.

Repetition – We often use phrases like “go 50 steps then turn right” while giving directions. or “Walk to the next intersection and turn right.” These are the kind of statements we use, when we want something to be done repeatedly.  This type of problem we can solve using For Statement, While and do-while statement.

Verifying Algorithms

Software is now used in even more important services, such as the medical industry and space missions. Such software must function properly in any circumstance. As a result, the software designer must ensure that every component’s operation is accurately defined, validated, and confirmed in every way.

To verify, we must use several input values and run the algorithm for each one to produce the desired result. We can then tweak or enhance the algorithm as necessary.

Comparison of Algorithm

There may be more than one method to use a computer to solve a problem, If you wish to compare two programmes that were created using two different approaches for resolving the same issue, they should both have been built using the same compiler and executed on the same machine under identical circumstances.

Introduction to Problem Solving Class 11 Notes

Coding

Once an algorithm is decided upon, it should be written in the high-level programming language of the programmer’s choice. By adhering to its grammar, the ordered collection of instructions is written in that programming language.
The grammar or set of rules known as syntax controls how sentences are produced in a language, including word order, punctuation, and spelling.

Decomposition

A problem may occasionally be complex, meaning that its solution cannot always be found. In these circumstances, we must break it down into simpler components. Decomposing or breaking down a complicated problem into smaller subproblems is the fundamental concept behind addressing a complex problem by decomposition. These side issues are more straightforward to resolve than the main issue.

Computer Science Class 11 Notes
Computer Science Class 11 MCQ
Computer Science Class 11 NCERT Solutions

Computer

Leave a Comment

error: Content is protected !!