This presentation is on problem solving & design for students taking computer science [2210]. Unfortunately I can't give the full explanation here. For any suggestions or clarifications, you can mail me on buxooa72@gmail.com.
This presentation contains:
1. Introduction
2. Central areas of TOC
3. Complexity theory
4. Computability theory
5. Automata theory
6. Related terminologies
7. Strings
8. Languages
9. Proof, Theorem, Lemma, Corollaries
Translation of a program written in a source language into a semantically equivalent program written in a target language
It also reports to its users the presence of errors in the source program
This presentation contains:
1. Introduction
2. Central areas of TOC
3. Complexity theory
4. Computability theory
5. Automata theory
6. Related terminologies
7. Strings
8. Languages
9. Proof, Theorem, Lemma, Corollaries
Translation of a program written in a source language into a semantically equivalent program written in a target language
It also reports to its users the presence of errors in the source program
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
We will discuss the following: Algorithms, Time Complexity & Space Complexity, Algorithm vs Pseudo code, Some Algorithm Types, Programming Languages, Python, Anaconda.
Relationship Among Token, Lexeme & PatternBharat Rathore
Relationship among Token, Lexeme and Pattern
Outline
Token
Lexeme
Pattern
Relationship
Tokens : A token is sequence of characters that can be treated
as a unit/single logical entity.
Examples
Keywords
Examples : for, while, if etc.
Identifier
Examples : Variable name, function name, etc.
Operators
Examples : '+', '++', '-' etc.
Separators
Examples : ',' ';' etc.
Pattern
Pattern is a rule describing all those lexemes that can represent a particular token in a source language.
Lexeme
It is a sequence of characters in the source program that is matched by the pattern for a token.
Example : “float”, “=“, “223”, “;”
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
We will discuss the following: Algorithms, Time Complexity & Space Complexity, Algorithm vs Pseudo code, Some Algorithm Types, Programming Languages, Python, Anaconda.
Relationship Among Token, Lexeme & PatternBharat Rathore
Relationship among Token, Lexeme and Pattern
Outline
Token
Lexeme
Pattern
Relationship
Tokens : A token is sequence of characters that can be treated
as a unit/single logical entity.
Examples
Keywords
Examples : for, while, if etc.
Identifier
Examples : Variable name, function name, etc.
Operators
Examples : '+', '++', '-' etc.
Separators
Examples : ',' ';' etc.
Pattern
Pattern is a rule describing all those lexemes that can represent a particular token in a source language.
Lexeme
It is a sequence of characters in the source program that is matched by the pattern for a token.
Example : “float”, “=“, “223”, “;”
Describes a model to analyze software systems and determine areas of risk. Discusses limitations of typical test design methods and provides an example of how to use the model to create high volume automated testing framework.
The systems development life cycle (SDLC), also referred to as the application development life-cycle, is a term used in systems engineering, information systems and software engineering to describe a process for planning, creating, testing, and deploying an information system.
Microsoft Excel is a spreadsheet program used to record and analyse numerical and statistical data. Microsoft Excel provides multiple features to perform various operations like calculations, pivot tables, graph tools, macro programming, etc.
An Excel spreadsheet can be understood as a collection of columns and rows that form a table. Alphabetical letters are usually assigned to columns, and numbers are usually assigned to rows. The point where a column and a row meet is called a cell.
SPSS (Statistical Package for the Social Sciences) is a versatile and responsive program designed to undertake a range of statistical procedures. SPSS software is widely used in a range of disciplines and is available from all computer pools within the University of South Australia.
DOE is an essential tool to ensure products and processes satisfy Quality by Design requirements imposed by regulatory agencies. Using a QbD approach to develop your testing process can help you reduce waste, meet compliance criteria and get to market faster.
DOE helps you create a reliable QbD process for assessing formula robustness, determining critical quality attributes and predicting shelf life by using a few months of historical data.
Minitab is a statistics package developed at the Pennsylvania State University by researchers Barbara F. Ryan, Thomas A. Ryan, Jr., and Brian L. Joiner in conjunction with Triola Statistics Company in 1972.
It began as a light version of OMNITAB 80, a statistical analysis program by NIST, which was conceived by Joseph Hilsenrath in years 1962-1964 as OMNITAB program for IBM 7090. The documentation for OMNITAB 80 was last published 1986, and there has been no significant development since then.
R is a language and environment for statistical computing and graphics."
"R provides a wide variety of statistical (linear and nonlinear modelling, classical statistical tests, time-series analysis, classification, clustering) and graphical techniques, and is highly extensible."
"One of R's strengths is the ease with which well-designed publication-quality plots can be produced, including mathematical symbols and formulae where needed.“
FOR COMMERCE SYLLABUS 7100. More to come.
For any comments or suggestion mail me on buxooa72@gmail.com.
Please leave a message on how you find the materials.
This explanation is the basic steps in learning python for beginners. Any student wishing to learn python can do so and practice this simple to use tutoril. Any feedback, suggestions or clarifications can be made to buxooa72@mail.com. For G9, G10 and especially G11 students taking computer science [2210].
This lesson is for students taking the Cambridge School certificate exams Computer science subject(2210).I hope that it will of help to students in this period of crisis. Send me your feedback or suggestions on buxooa72@ gmail.com,
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
1.4 modern child centered education - mahatma gandhi-2.pptx
2.1.1 PROBLEM SOLVING & DESIGN
1. UNIT 2.1.1 – PROBLEM SOLVING & DESIGN
• show understanding that every computer system is made up of sub-systems, which in turn are
made up of further sub-systems
• use top-down design, structure diagrams, flowcharts, pseudocode, library routines and subroutines
• work out the purpose of a given algorithm
• explain standard methods of solution
• suggest and apply suitable test data
• understand the need for validation and verification checks to be made on input data (validation
could include range checks, length checks, type checks and check digits)
• use trace tables to find the value of variables at each step in an algorithm
• identify errors in given algorithms and suggest ways of removing these errors
• produce an algorithm for a given problem (either in the form of pseudocode or flowchart)
• comment on the effectiveness of a given solution
2. What is a computer system?
A COMPUTER SYSTEM is made up of software, data, hardware,
communications and persware (the people who drive and run the
information system).
TOP-DOWN DESIGN is the breaking down of a computer system into a set of
sub- systems, then breaking each sub-system down into a set of smaller
sub-systems, until each sub-system just performs a single action. Each part
of the problem is broken down into smaller more manageable problems.
Stepwise refinement is the process of breaking down a complex system into
smaller sub-systems.
SUB-ROUTINE: It is a sequence of steps, part of a larger computer program.
Sub-routines written in high-level programming languages are called
‘procedures’ or ‘functions’ depending on how they are used.
PROGRAM LIBRARY / SUB-ROUTINE LIBRARY: It is a collection of standard
programs (subroutine, procedure, function etc), often designed to handle
commonly occurring problems or tasks that are stored. It is pretested and
usually performs a task that is frequently required.
Library routines are stored in a program library and given names. This
allows them to be called into immediate use when needed, even from other
programs. Using library routines make writing programs faster and easier
as part of the work has already been done (and debugged).
3. BENEFITS OF MODULAR PROGRAMMING
Modules can be easily tested and debugged (debug: remove errors from program)
Modules can be prewritten and reused.
Several programmers can work on separate modules.
It is easier to make changes to module without updating the entire program.
DRAWBACKS OF MODULAR PROGRAMMING
There should be proper planning of each module.
Additional testing must be done when linking the different module.
Testing and debugging of separate modules may prove to be time consuming.
TOOLS AND TECHNIQUES - There are different tools and techniques for modular programming: Structure chart,
flowchart and pseudocode. These techniques can be used to break down a complex problem and refine it to a sub-
system.
A top-down design approach can be used to produce structure diagrams that demonstrate the modular construction
the system. Each sub-system can be developed by a programmer as sub-routine or an existing library of routine may
already available for use.
STRUCTURE DIAGRAM - It shows the hierarchy or structure of the different components or modules of the system and
shows how they connect and interact with each other. It visualises how a system works from the initial input, to
processing and, finally, to the desired output.
4. STRUCTURE DIAGRAM EXAMPLE 1
Divide sum
by 10
Calculate sum
of 10
numbers
Program average of 10
numbers
Input 10 numbers Calculate average Print average
5. THIS IS THE END OF
CHAPTER 2.1.1- PROBLEM SOLVING &
DESIGN
IT IS DIFFICULT TO EXPLAIN
EVERYTHING. IT TOOK ME ALMOST 2
MONTHS TO EXPLAIN.
THERE ARE SO MANY EXERCISES TO
PRACTICE BUT UNFORNATELY CANNOT
ADD AS IT WILL BE TOO LENGTHY
6. STRUCTURE DIAGRAM EXAMPLE 2
Read payroll
record
Validate
payroll record
Calculate
deductions
Calculate
gross pay
Update
employee
record
Generate payroll
Get payroll record Calculate net pay Print payroll
8. PSEUDOCODE uses English-like words and mathematical operators that are set out to look like a
program.
FLOWCHART - a diagrammatic representation of an algorithm or process showing boxes representing
steps and arrows connecting the boxes, showing the flow of data. It is an effective way to
the algorithm that shows how a system or sub-system works.
ALGORITHM – It is a set of steps for solving a problem in terms of actions to be executed. This is
usually shown as a flowchart or pseudocode. Put it simply, the sequence of steps taken to solve a
problem, for example a recipe.
An algorithm expects a defined set of inputs, for example entering a series of marks in a computer
science exam.
It produces a define set of outputs, for example the number of passes and failures.
It terminates and produces a result always stopping after a finite loop. (a rogue value to stop the loop).
Most algorithms are guaranteed to produce the correct result.
9. TEST DATA
TEST DATA – A system should be thoroughly tested before
implementation. Computer programs can be tested using test data by
running them on a computer using any data that is required and seeing
what result is output. Test data is the data that is used in tests of a
software system. In order to test a software application, we need to enter
some data for testing most of the features.
10. NORMAL DATA
NORMAL DATA (ACCEPTABLE/VALID) – A system needs to be working
correctly. Normal test data will accept the data being tested to prove that
the solution works correctly. A set of normal test data should be used
together with the result(s) that are expected from that data.
Example: days of the month should be any value between 1 and 31 or
students marks in a test may be between 0 and 100.
A set of normal test data could be: 3,11,25,30 for days of the month.
11. ABNORMAL TEST DATA
ABNORMAL OR ERRONEOUS TEST DATA. This type of test data will
indicate the user that there is a problem. It will usually be rejected as
they are not appropriate and an error message displayed. Testing,
needs to be done to prove that the solution does not give incorrect
results.
Example: negative numbers for days of the month or students marks
in a test.
A set of abnormal test data could be: -5, 0, P,35 for days of
month.
12. EXTREME & BOUNDARY DATA
EXTREME/ LIMIT DATA - Extreme data are the largest and the smallest values that the system can
take and will be accepted.
Example: percentage marks should only be 0 (lowest possible value} and 100 (highest possible value}.
BOUNDARY DATA – Tests are performed using the boundary values and is used to establish where
the largest and smallest values occur. At each boundary two values are required, one value is
and the other value is rejected.
Example: In an exam the pass boundary is at 50 percent, merit at 75 percent and distinction at 85
percent. The Valid Boundary values for this situation will be as follows:
49, 50 - for pass
74, 75 - for merit
84, 85 - for distinction
Boundary values are validated against both the valid boundaries and invalid boundaries.
A SET OF TEST DATA is all the items of data required to work through a solution.
For example {-5, 0, 1, 20, 31, 50} can be used to test dates for a month.
13. VALIDATION AND VERIFICATION - In order for computer systems to only accept
data inputs that are reasonable and accurate, every item of data needs to be
examined before it is accepted by the system.
VALIDATION
It is the automated checking by a program that data is reasonable before it is
accepted into a computer system (performed automatically by a computer
program). Different types of check may be used on the same piece of data; for
example, an examination mark could be checked for reasonableness by using a
range check, a type check and a presence check. When data is validated by a
computer system, if the data is rejected a message should be output explaining
why the data was rejected and another opportunity given to enter the data.
VALIDATION & VERIFICATION
14. THERE ARE MANY DIFFERENT TYPES OF
VALIDATION CHECKS INCLUDING:
1. RANGE CHECK checks that the values lie within a specified range are accepted.
For example, days of the month should be between 1 and 31 inclusive or
percentage marks between 0 and 100 inclusive.
2. LENGTH CHECK (Check the correct length is entered) - Checks the data
isn't too short or too long. values must be a specific length.
Checks either:
• data contains an exact number of characters. Example: a password must be
exactly eight characters in length else, rejected. OR
• data entered is a reasonable number of characters, for example a family
name could be between 2 and 30 characters inclusive so that names with
one character or 31 or more characters would be rejected.
15. 3. TYPE CHECK checks that the data entered is of a given data type, for example
integer or real number.
4. CHARACTER CHECK checks that when a string of characters is entered it does not
contain any invalid characters or symbols, for example a name would contain letters
only and a telephone number would only contain digits.
5. FORMAT CHECK checks that the characters entered conform to a pre-defined
pattern, for example date of the year is in the format DD/MM/YY.
6. PRESENCE CHECK checks to ensure that some data has been entered and the value
has not been left blank, for example an email address must be given for an online
transaction or key field is not left blank
16. 7. CHECK DIGIT is the final digit included in a code; it is calculated from all the
other digits in the code. Check digits are used for barcodes, product codes,
International Standard Book Numbers (ISBN) and Vehicle Identification Numbers
(VIN).
Check digits are used to identify errors in data entry caused by mis-typing or mis-
scanning a barcode.
They can usually detect the following types of error:
• incorrect digit entered, for example 5327 entered instead of 5307
• transposition errors where two numbers have changed order, for example
5037 instead of 5307
• omitted or extra digits, for example 537 instead of 5307 or 53107 instead of
5307
• phonetic errors, for example 13, thirteen, instead of 30, thirty.
17. VERIFICATION
VERIFICATION - Verification is performed to ensure that the data entered exactly matches the
original source. Verification means checking the input data with the original data to make sure that
there have been no transcription errors (transcription means copying the data from one source to
another).
It is used to check that the data does not change as it is being entered. It involves a human as the
computer cannot do this by itself.
Verification methods include:
Double entry - to input data twice to the computer system. For example, entering password twice
during sign-up
Screen/visual check – it involves checking visually the data that has been input. The user may be
asked to confirm that it is correct before continuing
Proof reading – data entered is checked against the original, generally a person specially trained for
this.
Parity check
Checksum
18. TRACE TABLE
It is a technique used to test algorithms, to ensure that no logical
errors occur whilst the algorithm is being processed. The table is made
up of multiple rows and columns. The trace table is used to show any
changes to key variables or key expressions after each line in the
program has been "executed". Each column showing a variable and
any output, and each row showing each number input into the
algorithm and the subsequent values of the variables.
C-temp F_temp Output
19. DRY RUN
Dry running a program involves the programmer working through a program
on paper, usually using a table called a ‘trace table’. The programmer adds
columns for any variables or expressions that are important. When this has
been done, the programmer works through the program, line by line, filling
into the trace table the values of variables and expressions as they change. By
doing this, the programmer can spot the exact position when things start going
wrong with the program - when variables suddenly contain unexpected values
or expressions don't hold the expected state.
20. STAGES IN PRODUCING ALGORITHMS
An algorithm is a set of step by step plan to solve a computer-related problem and is
similar to a recipe.
Obtain a description of the problem and make sure that the problem is clearly specified.
Break the problem down into sub-problems;
Identify the input (what need to be input in the system and how is it going to be obtained)
Identify the processing (A process is an action that is carried out). {calculate, sort, locate,
search, etc..}
Output of results. (what to display/print etc.…)
To construct algorithm, should a flowchart or pseudocode be used.
Step by step test using several sets of test data and trace tables to find any errors.
Identify the different constant, variable and loop to be used.
If any errors are found, repeat the process until you think that your algorithm works
perfectly.
The algorithm should be understandable and clear. use meaningful names for any data
stores.
Refine the algorithm by adding more details if needed.
21. THE EFFECTIVENESS OF A SOLUTION
It is a measure of how good the results of the algorithm produced are, as there
are many different solutions to the same problem.
Does it do what it is supposed to do?
Does the solution work for all sets of data? (Normal/ abnormal/ boundary)
There should be no ambiguity. Each step should be clearly and precisely defined.
Can the algorithm be simplified?
Does the solution have any unnecessary processes that are never used?
Are any actions repeated more often than necessary?
22. EXAMPLE 1: AN ALGORITHM TO CONVERT A TEMPERATURE
FROM DEGREES CENTIGRADE TO DEGREES FAHRENHEIT.
FLOWCHART PSEUDOCODE TRACE TABLE
Input C_temp
F_temp := (1.8 * C_temp) + 32
Output F_temp
C-temp F_temp Output
23. EXAMPLE 1: AN ALGORITHM TO CONVERT A TEMPERATURE
FROM DEGREES CENTIGRADE TO DEGREES FAHRENHEIT.
FLOWCHART PSEUDOCODE TRACE TABLE
Input C_temp
F_temp := (1.8 * C_temp) + 32
Output F_temp
C-temp F_temp Output
24. ERRORS IN PSEUDOCODE
Always check that:
IF NUM < SMALL THEN SMALL = NUM; IF NUM > LARGE THEN LARGE = NUM; IF
X>Y THEN Y = X.
Output is always outside the loop.
Small = 1000 (a large number).
Count = count + 1.
There is no counter in repeat loop.
Total = total + num (if num is input) and average = total/ counter.
Check initialized value against counter
Check =, >, <, <=, >=, ><etc
25. SOME PAST EXAM QUESTIONS
AND ANSWERS ON THIS
CHAPTER
PROBLEM SOLVING &DESIGN
30. The following flowchart inputs ten temperatures and outputs the average (mean) temperature and the number of
temperatures which were negative (i.e. < 0). [JUN 11/P12/10]
32. NOV 06/P1/9 - A computer program is required which inputs 10 numbers, multiplies them together and
finally outputs the answer (the product). The following algorithm has been written to do this.
33. JUN 10/P11/12 - A golf course charges $10 for each game of two people. Each additional person incurs a
further charge of $2 per game. If they book two or more games in advance, they get a 10% discount on the
total charge. The following program has been written in pseudocode to calculate the charges for a game.
34. [NOV 10/P11 & 12/9] - The following algorithm inputs 20 numbers and outputs how many
numbers were positive (> 0) and how many numbers were negative (< 0).
35. JUN 10/P12/7 - (a) Read the following section of code that inputs twenty (20) numbers and
then outputs the largest number input.