0% found this document useful (0 votes)
7 views35 pages

Problem Solving Strategies in Python

The document outlines various problem-solving strategies and examples, emphasizing the importance of understanding and analyzing problems before attempting to solve them. It introduces the four phases of problem solving as defined by George Pólya, and discusses multiple strategies such as trial and error, algorithmic approaches, and heuristic methods. Additionally, it highlights the benefits of employing diverse strategies to enhance adaptability, efficiency, and outcomes in problem-solving.
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)
7 views35 pages

Problem Solving Strategies in Python

The document outlines various problem-solving strategies and examples, emphasizing the importance of understanding and analyzing problems before attempting to solve them. It introduces the four phases of problem solving as defined by George Pólya, and discusses multiple strategies such as trial and error, algorithmic approaches, and heuristic methods. Additionally, it highlights the benefits of employing diverse strategies to enhance adaptability, efficiency, and outcomes in problem-solving.
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

UCEST105: Algorithmic

Thinking With Python


Module 1
Examples for Problem
Problem-1: Suppose that you are back from college, and discover that you

have lost your wallet that is of great sentimental value to you. How do you

regain your lost wallet?


Examples for Problem
Problem-2: In a circle, a square with side length 2a is inscribed. What is

the area of the circle?


Problem-3: Suppose that you are to ship a wolf, a sheep, and a cabbage

across the river. The boat can only hold the weight of two: you plus another

item. You are the only one who can row the boat. The wolf must not be left

with the sheep alone, or the wolf will eat the sheep. Neither should the sheep

be left alone with the cabbage. How do you get them over to the other side of

the river?
Problem-4: Construct the well-known Pascal’s triangle
Problem-5: Suppose that you are given a rectangular 3 × 5 grid. You are

allowed to move from one intersection to another, governed by the rule that you

can travel only upwards or to the right, along the grid lines. How many paths

are there from each of the intersections to the top-right corner of the grid?

- Are the above two problems related? If so, how is this problem related to
- the Pascal’s triangle? Knowing that Problems 4 and 5 are related, how would
- you use Pascal’s triangle to solve this problem?
Four Phases of Problem Solving
- Hungarian mathematician George Pólya (1887-1985)
- famous book ”How To Solve It”

Step 1:

- First, we need to understand the problem and


- clarify any doubts about the problem statement if necessary

Step 2:

- we need to find the connection between the data and the unknown,
- to make out a plan for the solution.
- Auxiliary problems might be created in the process
Four Phases of Problem Solving
Step 3:

- to carry out our plan, checking the validity of each step

Step 4:

- To review the solution.


Phase 1: Understanding the problem
- What are the unknowns? What are the data?

- What is the condition? Is it possible to satisfy the condition? Is the condition

sufficient to determine the unknown? Or is it insufficient? Or redundant? Or

contradictory?

- Draw a figure. Introduce suitable notation.

- Separate the various parts of the condition. Can you write them down?
Phase 2: Devising a plan
- Have you seen it before? Or have you seen the same problem in a slightly
different form?
- Do you know a related problem?
- Look at the unknown! Try to think of a familiar problem having the same or
similar unknown.
- Split the problem into smaller, simpler sub-problems.
- If you cannot solve the proposed problem try to solve first some related
problem. Or solve a more general problem. Or a special case of the problem.
Or solve a part of the problem.
Phase 3: Carrying out the plan
● Carrying out your plan of the solution, check each step.

● Can you see clearly that the step is correct?

● Can you prove that it is correct?


Phase 4: Looking back.
- Can you check the result?

- Can you derive the result differently?

- Can you use the result, or the method, for some other problem?
Problem Solving
- encounter problems can be big and small
- some are easy to solve and some are really tough to solve
- Some call for a structured solution, whereas some require an unstructured
approach
- Some are interesting and some are not
- range from mathematical to philosophical

Algorithmic problems

- Solutions are expressed as algorithms


- a set of well-defined steps and instructions
- that can be translated into a form, usually known as the code or program,
- that is executable by a computing device
Problem 1:
Suppose that you are back from college, and discover that you have lost your
wallet that is of great sentimental value to you. How do you regain your lost
wallet?

First of all, the problem statement is incomplete.

● Where did you actually drop the wallet? Did you assume that it was
● dropped at the college? Could it have happened on the way back home? If
● the wallet was indeed dropped at the school, where in the school? In the
classroom
● or playground or the library or somewhere else?
- Assumptions should not be made without basis.
- Irrelevant information (such as the sentimental value of the wallet) should not
get in to the way.
- Incomplete information must be sought out.

You could only fully understand the problem after all ambiguities are removed.
Then only you should try to solve the problem.
Multiple Problem-Solving Strategies
- Equips individuals with a diverse toolkit to tackle a variety of challenges
- Different problems often require different
- allows for greater flexibility and adaptability
- enhances critical thinking and creativity
- outside the box and considering multiple perspectives
- more innovative and effective solutions
- recognizing patterns and similarities between different problems, making it
easier to apply previous knowledge to new situations
Some benefits of Multiple Problem-Solving Strategies
- Adaptability: Different problems require different approaches. Understanding
multiple strategies allows for flexibility and adaptability in problem solving.
- Efficiency: Some strategies are more effective for specific types of problems.
Having a repertoire of strategies can save time and resources
- Improved Outcomes: Diverse strategies offer multiple perspectives and
potential solutions, increasing the likelihood of finding optimal solutions.
- Skill Development: Exposure to various strategies enhances cognitive skills,
critical thinking, and creativity.
Problem-solving strategies
1. Trial And Error
2. Algorithmic
3. Heuristic
4. Means-Ends Analysis
5. Brainstorming
6. Lateral Thinking
7. Root Cause Analysis
8. Mind Mapping
9. SWOT Analysis
10. Decision Matrix
11. Simulation
12. Use Experience
Trial And Error Problem-Solving Strategy
- involves attempting different solutions and learning from mistakes until a
successful outcome is achieved
- method that relies on experimentation and iteration
- Practical when there is no clear pathway to the solution and allows for
discovering the correct answer through persistence and adaptability.
Eg. Forgotten the password to your online account
- Initial Attempts: You start by trying passwords you commonly use
- Learning from Mistakes:
- Refinement
- Success
Algorithmic Problem-Solving Strategy
- a step-by-step, logical procedure that guarantees a solution to a problem
- systematic and follows a defined sequence of operations
- Ensuring consistency and accuracy in finding the correct solution

Eg: baking a cake following a precise recipe


Heuristic Problem-Solving Strategy
- based on experience and intuition
- does not guarantee a perfect solution
- provides a good enough solution quickly
- through rules of thumb or educated guesses

“”While this heuristic approach does not guarantee that you will find the absolute

fastest route, it combines your experience and real-time data to make an

informed, efficient decision, likely saving you time compared to blindly following

the main routes””


Means-Ends Analysis Problem-Solving Strategy
- breaking down a problem into smaller, manageable parts (means)

and addressing each part to achieve the final goal (ends)

- involves identifying the current state, the desired end state, and

the steps needed to bridge the gap between the two

Problem decomposition When the problem to be solved is too complex to


manage, break it into manageable parts known as sub-problems
Steps involved in Problem Decomposition
- Understand the problem
- Identify the sub-problems
- Solving the sub-problems
- Combine the solution
- Test the combined solution
Brainstorming
- generating a wide range of ideas and solutions to a problem without
immediately judging or analyzing them.
- The goal is to encourage creative thinking and explore various possibilities.

Eg.

- a team meeting to improve customer satisfaction, everyone contributes


- different ideas
- enhancing product quality, improving customer service training, offering
loyalty programs, and using customer feedback to make improvements
- ideas are later evaluated and the best ones are implemented.
Lateral Thinking
- looking at problems from new and unconventional angles
- thinking outside the box and challenging established patterns and
assumptions
“”
A company facing declining sales of a product might use lateral thinking
to identify new uses for the product or new markets to target, rather than
just trying to improve the existing product or marketing strategy.
“”
Root Cause Analysis
- involves identifying the fundamental cause of a problem rather than just
addressing its symptoms
- The goal is to prevent the problem from recurring by solving its underlying
issues
“”
If a factory’s production line frequently breaks down, rather than just
repairing the machinery each time, the team conducts a root cause analysis
and discovers that poor maintenance scheduling is the underlying issue.
By implementing a better maintenance plan, they reduce the breakdowns.
“”
Mind Mapping
- a visual tool for organizing information
- helps in brainstorming, understanding, and solving problems by visually
connecting ideas and concepts

“”

When planning a large event, an organizer creates a mind map with the

event at the center, branching out into categories like venue, catering,

entertainment, invitations, and logistics.

“”
SWOT Analysis
- involves evaluating the Strengths, Weaknesses, Opportunities, and Threats
related to a particular problem or decision
- understanding both internal and external factors that impact the situation

“”

A business firm considering a new product launch performs a SWOT analysis.


They identify their strengths (strong brand, good distribution network),
weaknesses (limited R&D budget), opportunities (market demand, potential
partnerships), and threats (competition, economic downturn). This analysis guides
their decision-making process.

“”
Decision Matrix
- decision grid or Pugh matrix, helps in evaluating and prioritizing a list of
options
- involves listing options and criteria, assigning weights to each criterion, and
scoring each option based on the criteria
“”
A family deciding on a new car creates a decision matrix with criteria such
as cost, fuel efficiency, safety features, and brand reputation. They rate
each car option against these criteria and calculate a total score to make
an informed choice.
“”
Simulation
- Simulation involves creating a model of a real-world system and
experimenting with it to understand how the system behaves under different
conditions.
- It helps in predicting outcomes and identifying the best course of action.

“”

Urban planners use traffic simulation software to model the impact of new

road constructions on traffic flow. By testing different scenarios, they can

design the most effective road network to reduce congestion

“”
Use Experience
- involves drawing on previous knowledge and experiences to address current
challenges
- idea that similar problems often have similar solutions, and leveraging past
experiences can lead to efficient and effective outcomes

“”

A company trying to market a new clothing line may consider marketing tactics they have
previously used, such as magazine advertisements, influencer campaigns, or social
media advertisements. By analyzing what tactics have worked in the past, they can
create a successful marketing campaign again.

“”

You might also like