COMPUTER
ONLINE
CLASS X
CHAPTER 1
PROBLEM SOLVING
AND ALGORITHM
DESIGNING
Outline
– Algorithm
– What is an algorithm?
– How are mathematical statements and algorithms
related?
– What do algorithms have to do with computers?
– Pseudo Code
– What is pseudocode?
– Writing pseudocode
– Pseudo Code vs Algorithm
What is an algorithm?
–An algorithm is a finite, explicit step-by-step procedure for solving a specific problem
or accomplishing a specific goal.
–We frequently talk about algorithms in mathematical terms, and many algorithms are
expressed using notation borrowed from mathematics, but algorithms aren't
necessarily mathematical in the operations performed, or in the results produced.
– In general, an effective algorithm has these characteristics:
– Explicit, complete, and precise initial conditions;
– A finite, complete, unbroken
– Explicit, complete, and precise terminal (stopping) conditions
WATCH A TUTORIAL
https://youtu.be/jaQzQC3ADQU
How are mathematical statements
and algorithms related?
5(𝐹− 32) = 9
𝐶
– First, convert expression into a form that expresses C as a function of F:
C=5/9 * (F – 32)
– Now it's a straightforward task to write an algorithm (based on the standard
order
of arithmetic operations) to convert from Fahrenheit to Celsius.
– Start with a given temperature in degrees Fahrenheit.
– Subtract 32 from the value used in step # 1.
– Multiply the result of step # 2 by 5.
– Divide the result of step # 3 by 9.
– The result of step # 4 is the temperature in degrees Celsius.
What do algorithms have to do
with computers?
– Computer programming consists, in large part, of creating unambiguous, step-by-step
procedures for the computer to follow, to produce specific results. In other words, we
might say that computer programming is almost all about algorithms.
– In many respects, computers are electronic idiot savants: they can perform amazing
feats of calculation and memory, but without our help, they're almost totally
incompetent when it comes to applying those abilities to practical problems.
– Want to compute the sine of an angle? How about computing the natural logarithm of a
number? These tasks are easy for a computer –, in most modern computers, these
operations are built into the CPU itself.
– But if you want to plot the graph of y=sin x on the screen, or balance your cheque
book, or compute the area of the region 1≤x≤100,0≤y≤1/x, the computer is helpless –
until someone writes algorithms to accomplish these tasks, and “teaches” them to the
computer.
Pseudo Code vs Algorithm
HOME WORK
DO
Q1: Describe the steps involved
in problem solving.
THANK YOU MEET YOU
NEXT CLASS!

Algorithm n problem solving x

  • 1.
  • 2.
    CHAPTER 1 PROBLEM SOLVING ANDALGORITHM DESIGNING
  • 3.
    Outline – Algorithm – Whatis an algorithm? – How are mathematical statements and algorithms related? – What do algorithms have to do with computers? – Pseudo Code – What is pseudocode? – Writing pseudocode – Pseudo Code vs Algorithm
  • 4.
    What is analgorithm? –An algorithm is a finite, explicit step-by-step procedure for solving a specific problem or accomplishing a specific goal. –We frequently talk about algorithms in mathematical terms, and many algorithms are expressed using notation borrowed from mathematics, but algorithms aren't necessarily mathematical in the operations performed, or in the results produced. – In general, an effective algorithm has these characteristics: – Explicit, complete, and precise initial conditions; – A finite, complete, unbroken – Explicit, complete, and precise terminal (stopping) conditions
  • 5.
  • 6.
    How are mathematicalstatements and algorithms related? 5(𝐹− 32) = 9 𝐶 – First, convert expression into a form that expresses C as a function of F: C=5/9 * (F – 32) – Now it's a straightforward task to write an algorithm (based on the standard order of arithmetic operations) to convert from Fahrenheit to Celsius. – Start with a given temperature in degrees Fahrenheit. – Subtract 32 from the value used in step # 1. – Multiply the result of step # 2 by 5. – Divide the result of step # 3 by 9. – The result of step # 4 is the temperature in degrees Celsius.
  • 7.
    What do algorithmshave to do with computers? – Computer programming consists, in large part, of creating unambiguous, step-by-step procedures for the computer to follow, to produce specific results. In other words, we might say that computer programming is almost all about algorithms. – In many respects, computers are electronic idiot savants: they can perform amazing feats of calculation and memory, but without our help, they're almost totally incompetent when it comes to applying those abilities to practical problems. – Want to compute the sine of an angle? How about computing the natural logarithm of a number? These tasks are easy for a computer –, in most modern computers, these operations are built into the CPU itself. – But if you want to plot the graph of y=sin x on the screen, or balance your cheque book, or compute the area of the region 1≤x≤100,0≤y≤1/x, the computer is helpless – until someone writes algorithms to accomplish these tasks, and “teaches” them to the computer.
  • 8.
    Pseudo Code vsAlgorithm
  • 9.
    HOME WORK DO Q1: Describethe steps involved in problem solving.
  • 10.
    THANK YOU MEETYOU NEXT CLASS!