0% found this document useful (0 votes)
10 views12 pages

CSC 102 Course Content

Uploaded by

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

CSC 102 Course Content

Uploaded by

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

CSC 102

COURSE CONTENT
Learning Outcomes
At the end of this course, students should be able to explain concepts related to problem solving
and identify problem types; identify and explain problem solving methods; exemplify solvable
and unsolvable problems; interpret given problems and formulate solutions to them using
flowchart, pseudocode and/or other formalisms ;apply appropriate strategies and procedures to
arrive at workable solutions to problems and develop critical thinking and problem solving skills
required throughout the computing career.

Course Content
Introduction to the core concepts of computing, problems, and problem-solving. The
identification of problems and types of problems (routine problems and non-routine problems).
Method of solving computing problems (Introduction to Algorithms and heuristics). Solvable
and unsolvable problems. Solution techniques of solving problems (abstraction, analogy,
brainstorming, trial and error, hypothesis testing, reduction, literal thinking, means end analysis,
method of focal object, morphological analysis, research, root cause analysis, proof, divide and
conquer). General Problem-solving process. Solution formulation and design: flowchart,
pseudocode, decision table, decision tree. Implementation, evaluation and refinement.
Programming in C, Python etc.

Lab Work

Use of simple tools for algorithms and flowcharts; writing pseudocode; writing assignment
statements, input-output statements and condition statements; demonstrating simple programs
using any programming language (Visual Basic, Python, C)

NOTES

Introduction to the Core Concepts of Computing, Problems, and Problem-Solving

Computing is the study and use of computers and algorithms to process information and solve
problems. At its core, computing involves understanding how data is represented, how
instructions (algorithms) are created to manipulate that data, and how systems execute those
instructions efficiently.

What is a Problem?
A problem is a gap between an existing situation and a desired outcome. In computing, a
problem typically involves:
- Input: The given data or initial conditions.
- Processing: The steps needed to transform input into output.
- Output: The desired result or solution.

Problems in computing can be categorized into routine problems, which have well-defined
solutions and can be solved using standard methods, and non-routine problems, which are more
complex and often require creativity and innovative strategies.

Characteristics of a Problem:
- Well-defined vs. Ill-defined:
- Well-defined problems have clear goals and constraints (e.g., calculating the sum of two
numbers).
- Ill-defined problems lack clarity in objectives or solution paths (e.g., improving customer
satisfaction).
- Solvability: Some problems can be solved algorithmically, while others may not have a
solution (e.g., undecidable problems in computer science).

Problem-solving in computing involves several key steps:

1. Problem identification – understanding the nature and scope of the problem.


2. Analysis – breaking the problem into smaller, manageable parts.
3. Algorithm development – designing a sequence of logical steps to solve the problem.
4. Implementation – writing code or using software tools to carry out the algorithm.
5. Testing and debugging – ensuring the solution works correctly and efficiently.

1. Problem Identification

This is the first and most critical step in problem-solving. It involves clearly understanding
what the problem is, what is required, and the constraints involved.

Key actions in this step:

 Read and understand the problem statement carefully.


 Identify the inputs (what you are given) and the desired outputs (what you want to
achieve).
 Determine the problem’s scope: Is it technical? Logical? Does it involve numbers, data,
or user input?
 Ask questions if anything is unclear.
Example:
You're asked to develop a program that calculates a student’s average score and determines if
they passed. You must understand how many subjects are involved, what constitutes a pass, and
what format the data will come in.

2. Problem Analysis

Once the problem is identified, the next step is to analyze it and break it down into manageable
parts.

Key actions in this step:

 Break the problem into smaller sub-problems or modules.


 Identify relationships between components (e.g., cause-effect, sequence, or
dependencies).
 Look at patterns or rules that apply.
 Think about the logic behind the problem: What processes are required to turn input into
output?

Example:
In our student score program, analysis might reveal that:

 You need to sum all subject scores.


 Then divide by the number of subjects to get the average.
 Finally, compare the average to a threshold (e.g., 50%) to determine pass/fail.

3. Algorithm Development

This step involves designing a step-by-step logical procedure to solve the problem. This is
called an algorithm.

Key actions in this step:

 Write out the steps needed to solve each part of the problem.
 Use flowcharts or pseudocode to visualize the process.
 Ensure your algorithm is clear, efficient, and covers all possible inputs (including edge
cases).

Example (pseudocode):

Start
Set total = 0
For each subject:
Read score
Add score to total
Compute average = total / number of subjects
If average >= 50:
Output "Pass"
Else:
Output "Fail"
End

4. Implementation (Coding)

Here, the algorithm is translated into a programming language, such as Python, Java, or C++.

Key actions in this step:

 Choose the appropriate language and tools.


 Translate the algorithm accurately into code.
 Follow proper coding standards (e.g., clear variable names, comments).
 Handle possible errors (e.g., invalid input, division by zero).

Example (Python code):

subjects = int(input("Enter number of subjects: "))


total = 0
for i in range(subjects):
score = float(input(f"Enter score for subject {i+1}: "))
total += score

average = total / subjects


if average >= 50:
print("Pass")
else:
print("Fail")

5. Testing and Debugging

After implementation, the program must be tested to ensure it works correctly and efficiently.

Key actions in this step:

 Run the program with various input scenarios (normal, edge, and incorrect inputs).
 Check if the output is accurate.
 Debug (fix) any errors or unexpected behavior.
 Optimize performance and simplify where possible.

Types of Testing:

 Unit Testing – test individual parts of the program.


 Integration Testing – ensure different parts work together.
 User Testing – verify the program meets user requirements.

Example:
Test with:

 3 subjects: 60, 70, 80 → average = 70 → Pass ✔️


 2 subjects: 45, 40 → average = 42.5 → Fail ✔️
 0 subjects → should handle division by zero ❌ → fix the code.

The Identification of Problems and Types of Problems (Routine and Non-Routine


Problems)

Problem identification is the first and most important step in the process of solving any
problem, especially in computing and real-life situations. It involves carefully observing a
situation to detect when something is not working as expected or when there is a need for
improvement. Once a problem is clearly identified, it becomes easier to analyze it and work
toward a solution.

1. Routine Problems

Routine problems are common, predictable, and repetitive problems that usually have clearly
defined solutions or procedures. These problems often occur in familiar settings, and because
they follow a known pattern, they can be solved using standard rules, formulas, or algorithms.

Features of Routine Problems:

 They have a specific structure.


 Solutions are often already known or taught.
 They require less creativity, but more accuracy.
 They are easier and faster to solve with practice.

Examples of Routine Problems

 Calculating the total of a list of numbers.


 Formatting text in a document.
 Sorting data in a spreadsheet.
 Writing a basic loop in a programming language.

2. Non-Routine Problems

Non-routine problems are new, unfamiliar, or complex problems that do not have a direct or
obvious solution. They require critical thinking, creativity, and sometimes trial and error.
Solving such problems often involves exploring different approaches, asking questions, and
sometimes breaking the problem into smaller parts.

Features of Non-Routine Problems

 They are less predictable and often unique.


 Solutions are not readily available.
 They require higher-order thinking skills like analysis, synthesis, and evaluation.
 They often involve real-world challenges with many variables.

Examples of Non-Routine Problems

 Designing a website to meet specific user needs.


 Debugging an unexpected software error.
 Creating a new algorithm to detect fraud.
 Planning a system to manage traffic in a smart city.

Why This Distinction Matters

Understanding whether a problem is routine or non-routine helps in choosing the right tools,
methods, and thinking strategies. While routine problems may require speed and accuracy, non-
routine problems demand creativity, innovation, and often teamwork.

In computing, both types of problems are important: routine problems help build foundational
skills and improve efficiency, while non-routine problems encourage innovation and deeper
learning.

Methods of Solving Computing Problems

Solving computing problems is a core aspect of computer science and software development.
Whether designing a search engine, sorting data, recognizing faces, or planning logistics, the
ability to choose the right method to solve a problem efficiently is critical.Let us explore key
methods for solving computing problems, starting with algorithms and heuristics, followed by
several other powerful techniques commonly used.
1. Algorithms

An algorithm is a finite, ordered set of instructions used to solve a problem or perform a


computation. It is precise, unambiguous, and guarantees a solution if one exists, given
sufficient resources.

Characteristics of a Good Algorithm:

 Input: Takes zero or more inputs.


 Output: Produces at least one output.
 Definiteness: Each step is clearly defined.
 Finiteness: Terminates after a finite number of steps.
 Effectiveness: Each operation is basic enough to be performed.

Examples:

 Linear Search: Searches for an element in a list.


 Bubble Sort: Sorts a list by swapping adjacent elements.
 Dijkstra’s Algorithm: Finds the shortest path in a graph.

Example Problem:
Finding the Largest Number in a List
Problem Statement: Given a list of numbers, find the largest one.

Algorithm (Step-by-Step Solution):


1. Start with the first number as the current maximum.
2. Compare it with the next number in the list.
3. If the next number is larger, update the current maximum.
4. Repeat until all numbers are checked.
5. Return the final maximum value.

Pseudocode:
FUNCTION find_max (list):
max = list [0]
FOR each number IN list:
IF number > max:
max = number
RETURN max

Example Execution:
Input: `[5, 2, 9, 1, 7]`
1. Set `max = 5` (first element).
2. Compare `5` and `2` → `5` is still max.
3. Compare `5` and `9` → update `max = 9`.
4. Compare `9` and `1` → `9` remains max.
5. Compare `9` and `7` → `9` is still max.
Output: `9`

2. Heuristics

A heuristic is a strategy or approach used to make decisions or solve problems when traditional
methods (like algorithms) are too slow or complex. Heuristics offer approximate solutions and
are especially useful for large-scale or NP-hard problems.

Key Features:

 Based on experience, intuition, or practical methods.


 Do not guarantee the optimal solution.
 Are often used in AI, optimization, and real-world decision-making.
Examples:

 Greedy Methods: Make the locally optimal choice at each step.


 A Search*: Combines heuristics with path cost for efficient graph traversal.
 Genetic Algorithms: Use principles of natural selection to evolve good solutions.

3. Other Methods of Solving Computing Problems

In addition to algorithms and heuristics, the following methods are commonly employed
depending on the nature and complexity of the problem:

3.1 Brute Force

 Definition: Try all possible solutions until the correct one is found.
 Example: Password cracking by trying all combinations.
 Pros/Cons: Simple but inefficient for large problems.

3.2 Divide and Conquer

 Definition: Break the problem into smaller sub-problems, solve them independently, and
combine the results.
 Example: Merge Sort, Binary Search.
 Use Case: Recursive problems with clear substructure.

3.3 Dynamic Programming (DP)

 Definition: Solves problems by breaking them into overlapping sub-problems and storing
their solutions.
 Example: Fibonacci sequence, Knapsack problem.
 Advantage: Avoids redundant computation through memoization or tabulation.

3.4 Greedy Method

 Definition: Make the best decision at each step assuming it leads to the global optimum.
 Example: Kruskal’s algorithm for Minimum Spanning Tree.
 Limitation: May not always yield the best overall solution.
3.5 Backtracking

 Definition: Builds solutions incrementally and abandons paths that lead to failure.
 Example: Solving a Sudoku puzzle, N-Queens problem.
 Strength: Suitable for constraint satisfaction problems.

3.6 Randomized Algorithms

 Definition: Uses random numbers at key steps to influence decision-making.


 Example: Randomized Quick Sort, Monte Carlo simulations.
 Advantage: Often faster or simpler for complex problems.

3.7 Machine Learning Approaches

 Definition: Uses data to train models that learn patterns and make predictions.
 Example: Image recognition using neural networks.
 Best For: Problems that cannot be easily defined using rules.

3.8 Approximation Algorithms

 Definition: Produces near-optimal solutions with provable bounds.


 Example: Traveling Salesman Problem (TSP) approximations.
 Use Case: When exact solutions are computationally expensive.

3.9 Constraint Programming

 Definition: Defines the problem in terms of constraints and searches for feasible
solutions.
 Example: Job or exam scheduling.
 Used In: Operations research, planning, logistics.

3.10 Simulation and Modeling

 Definition: Mimics real-world systems over time to evaluate behavior.


 Example: Traffic simulations, weather modeling.
 When to Use: When mathematical modeling is difficult or infeasible.
Choosing the Right Method

Problem Type Suitable Method(s)

Simple, well-defined Algorithm

Large or complex Heuristic, Approximation, ML

Optimization Dynamic Programming, Greedy, Heuristics

Constraint Satisfaction Backtracking, Constraint Programming

Uncertain/real-world modeling Simulation, Machine Learning

Understanding the various methods of solving computing problems is fundamental for any
computer scientist or software engineer. While algorithms and heuristics are foundational, the
complementary methods such as dynamic programming, backtracking, machine learning, and
simulations enhance your ability to tackle a wide range of real-world problems.

Selecting the right technique requires a balance between accuracy, efficiency, and feasibility,
and often, combining multiple methods yields the best results.
COMPUTER SCIENCE CONCEPTS
1. CS50 Notes and Textbook-Harvard’s Introduction to Computer Science
https://cs50.harvard.edu/x/
2. Think like a computer scientist-How to think like a Computer Scientist(Python
Version)by Allen B. Downey
http://greenteapress.com/wp/think-python-2e/
3. Foundation of Computation by CarolCritchlow & David Eck
http://gaustav.edu/mcs/max/foundation.pdf

PROBLEM SOLVING TECHNIQUES


1. Creative Problem solving for managers:Developing Skills for Decision making and
innovation by Tony Proctor. Genesis LIBRARY
2. Problem solving with Algorithm and Data structures using Python by Bradley N.
Miller and David L. Ranum
https://runestone.academy/ns/books/published/pythonds/index.html

FLOWCHARTS,PSEUDOCADE ,DECISION TREES


1. Introduction to programming using Python by Y. Daniel Liang (Intoductory
Chapters)
2. Introduction to Computing by David Evans https://computingbook.org

You might also like