0% found this document useful (0 votes)
6 views9 pages

Understanding Problem and Solving It Through Computer

The document discusses the importance of problem-solving in programming, outlining the process of defining, analyzing, and resolving issues. It introduces various problem-solving techniques, knowledge types, and the role of metacognition in enhancing software development. Additionally, it explains algorithms, pseudocode, and their differences, emphasizing their significance in programming and problem-solving.

Uploaded by

miso.sigwinta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Understanding Problem and Solving It Through Computer

The document discusses the importance of problem-solving in programming, outlining the process of defining, analyzing, and resolving issues. It introduces various problem-solving techniques, knowledge types, and the role of metacognition in enhancing software development. Additionally, it explains algorithms, pseudocode, and their differences, emphasizing their significance in programming and problem-solving.

Uploaded by

miso.sigwinta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Understanding problem and solving it through Computer

Why PROBLEM SOLVING?


Problem-solving and logic lie at the heart of programming. Once we start looking at problem
solving closely from a more analytical perspective, we can break a solution down into smaller
parts. This helps immensely once we move the solution to a computer.

We will therefore be looking at all the components of problem-solving, logic, and critical and
computational thinking. When we can describe a problem and its solution using concrete terms,
we can code a solution in any programming language.

WHAT IS THE PROBLEM SOLVING?


According to Mayer and Wittrock (2006), problem-solving can be defined as a critical cognitive
process through which individuals or groups identify, analyze, and resolve issues or challenges to
achieve a desired outcome. It is a fundamental aspect of human reasoning and decision-making
that enables us to navigate complex situations and achieve goals.

The process of problem solving typically encompasses:

• Defining the problem.

• Understanding the cause of the problem.

• Generating potential solutions and evaluating those solutions,

• Finally, Implementing the most effective solution.

PROBLEM SOLVING EXAMPLE?

Students are unable to access online course materials due to a server outage. This issue
disrupts learning and necessitates immediate intervention. The problem-solving process in
this case would begin with:

• Problem identification: Recognizing that the server is down and understanding its
impact on stakeholders.

• Conduct Root cause: The IT team would analyse the root cause, such as hardware failure
or an overloaded server.

• Propose and Evaluate Solutions: The IT team would then brainstorm potential
solutions, such as upgrading server capacity, repairing faulty components, or
implementing load balancing techniques.

• Implement Appropriate Solution: Finally, the IT team would implement and monitor the
chosen solution to restore functionality and prevent future occurrences

DEFINING THE PROBLEM


Sometimes the problem will be unclear. We will need to get more information regarding the
context and whether any constraints exist. Look at this example:

Problem: Find someone who can make a birthday cake.

1
This is a statement, but we need to form a full problem definition.

We can ask questions and make sure we have all the required information. From this definition
we can then create what is known as a problem concept or schema. So first, let’s collect all the
information and ensure our problem definition is complete.

Find someone who can make a birthday cake for a 21-year-old. It needs to be Marvel-themed and
should look artistic and professional. The shape of the cake is not important but there will be 12
people so the size should be sufficient. Budget is not an issue.

THREE PROBLEM STATEMENTS & HOW YOU WOULD GO ABOUT SOLVING EACH ONE:

PROBLEM SOLVING TERMS


• Structured problem: can be automated; can have a standard solution.
• Unstructured problem: generally, can’t be done by a computer – needs judgment and
insight.
• Well-defined problem: A straightforward problem with a single solution.
• Ill-defined problem: A complex problem with many variables and possible solutions.

PROBLEM SOLVING KNOWLEDGE


Whenever we are going to solve a problem, we generally use two types of knowledge:
declarative knowledge and procedural knowledge.

With problem one we need to collect the facts, such as communication tools in use and the
assess their gaps. This is declarative knowledge – the facts.

Once we have the facts, we need to use the information obtained to propose a solution – this is
procedural knowledge – knowing how to do something.

2
PROBLEM SOLVING COMPONENTS

Metacognition
Metacognition refers to the awareness and understanding of one’s own thought processes. It
involves the ability to think about thinking, plan, monitor, and evaluate one's cognitive
strategies. In simple terms, it's the practice of reflecting on how you learn and solve problems,
allowing you to improve your decision-making and problem-solving skills over time.

Metacognition in the Software Development Life Cycle (SDLC):


Metacognition plays a crucial role in enhancing productivity and quality throughout the SDLC.
It can be applied in the following phases:

1. Planning Phase:

o Reflecting on previous projects to identify strengths and weaknesses.

o Setting realistic goals and estimating timelines more effectively.

o Strategically selecting tools and methodologies based on past experiences.

2. Requirement Analysis Phase:

o Actively questioning assumptions to avoid misunderstandings.

o Engaging in collaborative discussions to ensure clarity in requirements.

3. Design Phase:

o Evaluating different design patterns and architectural approaches.

o Reflecting on past design decisions to avoid repeating mistakes.

4. Development Phase:

o Self-monitoring coding habits and continuously improving code quality.

o Using debugging strategies that have worked effectively in the past.

3
5. Testing Phase:

o Identifying potential areas of failure by reflecting on past bugs and issues.

o Strategically prioritizing test cases for better coverage.

6. Deployment Phase:

o Assessing deployment strategies based on previous successes or failures.

o Anticipating potential user experience issues by reflecting on prior feedback.

7. Maintenance and Support Phase:

o Continuously evaluating system performance and identifying areas for


improvement.

o Reflecting on customer feedback to enhance future updates.

Benefits of Metacognition in SDLC:

• Improved decision-making.

• Faster problem-solving and debugging.

• Better collaboration within development teams.

• Continuous learning and adaptation to new technologies.

In essence, metacognition empowers software developers and project managers to learn from
their experiences, adapt strategies, and optimize the SDLC process for better outcomes.

Problem solving techniques


Description of Problem-solving techniques:
1. Process of Elimination

• Definition: This technique involves systematically ruling out options that are incorrect
or unlikely until only the most viable solution remains.

• Example Scenario: A doctor diagnosing an illness rules out potential causes based on
symptoms and test results. If tests rule out viral infections and allergies, the doctor
narrows the diagnosis to bacterial infection.

2. Socratic Method

• Definition: This technique involves asking a series of probing questions to challenge


assumptions and stimulate critical thinking.

• Example Scenario: A teacher helping a student understand a math problem by asking,


"What happens if we change this variable?" or "Why do you think this step is
necessary?" This approach leads the student to discover the solution themselves.

3. Divide and Conquer

• Definition: This method involves breaking a complex problem into smaller, manageable
parts and solving each one individually.

4
• Example Scenario: A software engineer debugging a large codebase by isolating
different modules to identify which part is causing an error. By systematically testing
each module, the faulty one can be found and fixed.

4. Solve by Analogy

• Definition: This approach leverages knowledge from similar problems or past


experiences to solve the current problem.

• Example Scenario: An architect designing a new earthquake-resistant building by


studying how suspension bridges absorb seismic energy and applying similar structural
principles to the building design.

5. Scientific Method

• Definition: A structured approach that involves forming a hypothesis, conducting


experiments, gathering data, and drawing conclusions.

• Example Scenario: A scientist testing the effectiveness of a new fertilizer by creating


two identical plant groups, applying the fertilizer to one group, and observing the
differences in growth over time.

Comparison of problem-solving techniques:

Technique Key Approach Best For

Process of
Ruling out wrong options Diagnostics, decision-making
Elimination

Socratic Method Asking critical questions Education, ethics, philosophy

Divide and Conquer Breaking into smaller parts Large projects, coding, analysis

Applying past experience or Innovation, design, creative


Solve by Analogy
patterns solutions

Scientific Method Hypothesis and experimentation Research, science, product testing

Algorithm, Program and Pseudocode


Algorithms, pseudocode and programming languages are all tools used by programmers at
different stages of project development Life Cycle. If you understand their proper usage, you can
develop programs faster, and those programs will be easier to maintain.

1. Algorithms
An algorithm is simply a series of steps you follow when solving a problem. You list the steps
in the order they should be performed. If you give a friend instruction on how to get to your
house: beginning at his initial location and ending at your intended location - you could call
that an algorithm for getting to your house. Recipes for baking a cake or instructions for

5
building a house are also algorithms. However, Computer Programmers use the term
specifically to describe the steps a properly designed computer program will follow to
perform its intended purpose.

2. Program
Computers do not understand instructions written in human languages. The algorithm must
be "explained" to them in a language they understand, and that language is binary code. That
is, a series of zeroes and 1s that is difficult for humans to read and write without making a lot
of mistakes. Programming languages were designed to make this process easier. They use
special keywords and syntax (or structure), the equivalent of vocabulary and grammar in a
human language. The programming language then converts these keywords and syntax into
binary code which the computer executes to perform the algorithm.

3. Pseudocode
When they begin designing a program, the programmers often do not know in which
programming language the program will ultimately be written. Even if they do, they may find
that the programming language is not a natural way for them to think clearly about the logic
of the algorithm steps. To make this process easier, the programmers use an intermediate
form of code called "pseudocode." Pseudocode sounds like a simplified human language, but
it is not based on any specific programming language. Rather, it uses syntax which is common
to many programming languages. A good example is decision-making syntax like if-then
structures; another is looping syntax like for-next structures.

3.1. Why Should I Write Pseudocode?

A computer program generally tries to solve a well-defined problem using a well-defined


algorithm. However, both the problem to be solved and the recipe/algorithm for solving it
are initially written in natural language (very similar to day-to-day speaking). We need
something much closer to an actual set of a computer instructions but going straight from
natural language to computer code can be tedious and complex - especially if you need
to do this many time for many different computer languages (and we very often do).

It is often far better to rewrite the algorithm as a set of specific instructions which is very
similar to computer code, but not specific to any one computer. That's what we call
pseudocode...it looks like computer instructions but cannot be executed on a computer.

3.2. How Do I Write Pseudocode?

Writing pseudocode is pretty easy actually:

• Start with the algorithm you are using, and phrase it using words that are easily
transcribed into computer instructions.

• Indent when you are enclosing instructions within a loop or a conditional clause.
A loop is a set of instructions that is repeated. A conditional clause is formed by
a comparison and what to do if that comparison succeeds or fails. This technique
makes sure it's easy to read.

• Avoid words associated with a certain kind of computer language.

6
• It turns out that there are some standard words you can use. These include
standard looping structures like the following:

i. FOR … ENDFOR

ii. WHILE…ENDWHILE

• There are also some terms for standard conditional clauses:

i. IF … ENDIF

ii. WHILE … ENDWHILE (this is both a loop and a conditional clause by the
way)

iii. CASE … ENDCASE

4. Advantages of:

4.1. An Algorithms:

• Algorithms can be written in normal human language,

• It allows experts who are not programmers to provide input into the program's
development phase.

4.2. Pseudocode:

• Pseudocode allows programmers who specialize in different programming


languages to pool their knowledge and create the most efficient code, resulting in
fast, compact programs.

4.3. Programming

• The programming languages provide flexibility, as some languages are better


suited for certain jobs.

N.B: By using all three tools, better computer programs can be developed more quickly and
more economically.

5. Difference between a Computer Program and Algorithm

Program is a set of sequential instructions written in a particular syntax (i.e. structure) and
programming language to perform a particular task on a computer. Thus, we can say that an
algorithm is language independent, unlike a computer program. Fundamental difference
between algorithm and a program is that a program is always language-dependent while an
algorithm is never language dependent.

Algorithm is simply a step-by-step solution to a problem. It helps to simplify and understand


the problem. It is a well-defined procedure that allows a computer to solve a problem.

For example, if you wish to add two numbers, algorithm will be given by:

1. INPUT a & b.

2. c = a + b.

3. DISPLAY c.

7
Another great example of an algorithm apart from programming is recipe in a cookbook. It is
a clear sequential specification of how to cook.

6. Difference between Pseudocode and Algorithm


Pseudocode is a simple way of writing programming code in English. It is more of a method
to represent an algorithm. No specific syntax is required and thus it cannot be directly
executed by the computer. Further descriptions of the Pseudocode:

• Pseudocode is not an actual programming language.

• It uses short phrases to write code for programs before you actually create it in a
specific programming language.

• Pseudocodes are often written by programmers for their own convenience and thus
no standard syntax is followed.

• Pseudocode allows to include control structures such as WHILE, IF-THEN-ELSE,


REPEAT-UNTIL, FOR, and CASE, which are present in many high-level languages.

An algorithm is a systematic logical approach used to solve problems in a computer while


Pseudocode is the statement in plain English which may be translated later into a programming
language.

The main difference between algorithm and pseudocode is that an algorithm is a step-by-step
procedure to solve a given problem while a pseudocode is a method of writing an algorithm.

6.1. Examples of Algorithm and Pseudocode

The algorithm to find the largest number on the list is as follows:


1. Set max to 0.

2. For each number x in the list L, compare it to max. If x is larger, set max to x.

3. max is now set to the largest number in the list.

An alternative algorithm to find the largest number on the list is as follows

1. If L is of length 1, return the first item of L.

2. Set v1 to the first item of L.

3. Set v2 to the output of performing find_max() on the rest of L.

4. If v1 is larger than v2, return v1. Otherwise, return v2.

Pseudocode to find the area of a Rectangle is as follows:

AreaOfRectangle ()

Begin

Read: width, length;

Set area = width * length;

Print area;

8
End

Pseudocode to add 2 numbers is as follows:

SumOfTwoNumbers ()

Begin

Set sum=0;

Read: num1, num2;

Set sum = num1+num2;

Print sum;

End

6.2. Example of writing algorithm using Pseudocode:

7. Difference between a data structure and an algorithm


• A data structure is the way you define a certain object in a programming language. If you
define a data structure for a contact in a contact list, you will have members of that data
structure such as name, company, address, phone number, etc. The data structure is
defined by what you need the program to keep track of.

• An algorithm is a specific way of programming a task to make it work on the data you have.
For example, there are many algorithms to sort data in a database of information. An
algorithm is a specific way that the programmer writes a program to process the
information. Algorithms are unique in the way that the program runs and can be measured
by their efficiency in processing the data. The metrics are evaluated by how many
computer instructions it takes to calculate the results.

=============================THE END==============================\

You might also like