Вы находитесь на странице: 1из 38

Welcome to your Bachelor of

Information Technology
and hi to everyone else as well 
Lecture Outline
• The Bachelor of IT & where this subject fits in
• Why learn Problem Solving?
• What is Problem Solving?
• How to analyse a problem
• Problem Decomposition
• Communicating a Solution
Typical BIT outline
Programming strand
Minors
Programming strand
Other strands/ connections
Networking

Design Thinking
CP1401 – Introduction to
Problem Solving
(and Programming)
Why Problem Solving?
• Who uses problem solving?
– Everyone!
• Business
– How do we meet a new need?
– How do we compete/improve our market share?
– How do we market a new product?
• Education
– How do we teach new ideas?
– How do we build on existing knowledge?
• IT
– How do we fix it? (Have you turned it off and on again?)
– How do we fix this program? Can we just write our own?
Problem Solving and Programming

• Traditional approach:
– Blend both together, side by side
– Taught together
Problem Solving

Programming
Concepts First
Programing
Language

Programming Syntax
The problem with the traditional approach

When learning a second


programming language… Problem Does not change
Solving
Skills Will be added to
What changes?

First
Programming
Language

May change slightly Programming Programming Changes


Will be added to Concepts Syntax significantly
Our Approach
Can more easily learn a new language,
foundation remains unchanged
VBA

Programming
Concepts
Problem Solving
Skills
Onwards and upwards
Mobile
Computing Advanced
Game Design Software
Programing II Engineering

Design
Programing I
Thinking

Problem Solving
CLASS ACTIVITY! (this means you  )

My Life Story
The Story of my Life
For this exercise:
• Get into groups of 2 people
• If necessary there can be one group of 3
• Each person will need:
• A sheet of coloured paper
• The instruction sheet
• A pen/pencil
• Follow the instructions and ask if you have any
questions 
What is Problem Solving?

• How do we do it?

• What steps are involved?

• How do we share our solution with others?


LOTS of online resources…
Problem Solving Focus
• Domain Specific
– Business
– IT
– Medical
Our focus in CP1401
– and so on…

• General Purpose
– Applicable to any domain
Basic Programming Approach
Analyse the Programming
problem
Design a
solution
Check the
solution
Implement
the solution
Test the
Problem Solving implementation

DONE!

Weeks 1-4 Weeks 5-13


Analyse a Problem
• Depending on context, this may be a huge
step
– Make sure you solve the REAL problem!
– Otherwise you waste time and effort solving a
symptom, and not the cause

• Classic Business Technique – 5 Whys


– Ask ‘Why’ at least 5 times
5 ‘Why’s Example
• Problem: Your client is refusing to pay for the leaflets you printed for them.
• Why? The delivery was late, so the leaflets couldn't be used.
• Why? The job took longer than we anticipated.
• Why? We ran out of printer ink.
• Why? The ink was all used up on a big, last-minute order.
• Why? We didn't have enough in stock, and we couldn't order it in quickly enough.
• Counter-measure: We need to find a supplier who can deliver ink at very short
notice.

• Initial problem was a bill collection issue – REAL problem was


a supplier issue!
Problem Solving for IT
• Problem Decomposition

• Break a problem down into its parts


– Identify nouns – these are ‘things’ in the problem
– Identify verbs – these are things to do
Example
How much can the box hold?

We need to know how much a box can hold,


assuming that we have been given its
dimensions. We have been given the length,
width and depth of the box, and we need to
calculate the volume of the box.

What are the nouns or ‘things’ here?


Decomposition
We need to know how much a box can hold,
assuming that we have been given its
dimensions. We have been given the length,
width and depth of the box, and we need to
calculate the volume of the box.

• Nouns:
– box, dimensions, length, width, depth, volume
• Elimination (which ones are unnecessary?)
– box, dimensions, length, width, depth, volume
Decomposition
• ‘Things’ in our problem:
– length, width, depth, volume
Step 2 – What do we need to do?
We need to know how much a box can hold,
assuming that we have been given its
dimensions. We have been given the length,
width and depth of the box, and we need to
calculate the volume of the box.
What are the verbs?
Decomposition
We need to know how much a box can hold,
assuming that we have been given its
dimensions. We have been given the length,
width and depth of the box, and we need to
calculate the volume of the box.
• Things to do – ‘calculate the volume’
• Things - length, width, depth, volume
• So we need to calculate volume from length
width and depth
• volume = length X width X height
CLASS ACTIVITY! (this means you  )

Define the Problem


Define the Problem
Although some problems are more complex
than others, one way we can define a sequence
of problem solving steps is the following:
1. Identify the problem,
2. understand the problem,
3. identify alternative solutions,
4. select the best solution,
5. prepare a list of instructions to solve the
problem and
6. evaluate the solution.
What to do tonight?
1. Identify the problem.
How do we want to spend the evening?
2. Understand the problem.
The only solutions that we will consider are those that everyone can participate in. E.g.
we wouldn’t suggest playing chess for a 2 year old, usually.
3. Identify alternative solutions.
Brainstorm ways that we would like to spend the evening (watch tv, play a game, have
friends over, go to the movies, etc)
4. Select the best way to solve the problem
Eliminate alternatives that are not acceptable (cost too much or not interesting to
everyone)
Specify pros and cons of each remaining idea
Weigh the pros and cons and make a final decision
5. Prepare a list of instructions to solve the problem
Assuming that we decide to stay home and watch tv, what steps do we follow. Who
picks the channel?
6. Evaluate the solution.
Are we having fun yet? Determine whether this solution led to the result that we want,
which is fun. If not everyone is having fun, start the decision making process again.
Group Task
Get into groups of 3
•Group Leader
•Recorder
•Reporter

Decide on and work through one of these 3 problems:


Your family has been offered an all-expense-paid trip to the country of your choosing.
Where will you go?

Your boss has asked you to make the hiring decision for a new employee in your
department. The two short-listed candidates seem to be equally suited for the role.
How will you decide which person will get the job?

You and a group of friends are going to have dinner and then see a movie. You have 3
different options for where to eat, and two choices of cinema. One cinema has better
facilities and is nicer, but is not showing a movie that some of the group want to see.
Of the three restaurants one is halfway between both cinemas, one is very close to the
first cinema and one is very close to the second. How will the group decide where to
eat and which cinema to go to?
How to communicate a solution?
• Option One – Wall of text
Get the length, width and depth of the box. Once
that is done then calculate the volume of the box by
multiplying the length by the width by the depth.
Then display the volume of the box.

• We can do better
– Algorithm – new vocabulary word
• Step-by-step explanation of the solution
– Cooking recipes, directions and instructions for almost
anything are all algorithms
Algorithm

Get length, width and depth


Calculate volume = length X width X depth
Display volume
Flowcharts
• Consistent and visual representation of a
problem
– an algorithm is more text-focussed, but either one
can communicate the same solution

• General purpose
– used in business, IT, everywhere

• Small set of symbols with different meanings


For Example
Key Symbols
• Five main symbols for our purposes:

– Start/Finish

– Get/Display information

– Do some calculations

– Make a decision

– Link to another flowchart


For now…

– Start/Finish

– Get/Display information

– Do some calculations
Volume of a box
Start
This is the same To improve this we could
‘solution’ as in our add some decisions…
Get length,
earlier algorithm: width and
height
Are there limits on these
Get length, width and depth
values? (can they be less
Calculate volume = length X Calculate: than one)
width X depth volume = length X
width X height What do we do if we are
Display volume
given illogical (or
impossible) numbers?
Show
volume
More on this next week

Finish
CLASS ACTIVITY! (this means you  )

Flowchart: Making a sandwich


Sandwich Flow chart
Get back into your group of 3
•Switch roles
Instructions:
1. Determine the steps in the process of making a sandwich. List each step in order
on a piece of paper and give each step a number. They should be organised in
numerical order. Make sure the instructions are as short and non-ambiguous as you
can.
2. Map each step in your list to the type of flowchart symbol that is needed to
represent the step.
3. Draw the symbol for each step on a sticky note, and then write the step description
on the note. Repeat for all of the steps.
4. Place your sticky notes on the paper in the order that the flowchart steps are to
occur. Review the steps and rearrange them if you decide on a different order of
steps that would be more appropriate. Arrows should only go one direction.
5. Draw the flowchart on to a blank piece of paper. Write the names of the people in
your group, and hand in the page when you are finished.

Вам также может понравиться