0% found this document useful (0 votes)
5 views

IT notes complete

Uploaded by

lolaaa
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)
5 views

IT notes complete

Uploaded by

lolaaa
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
You are on page 1/ 82

Chapter 1

Data Processing and


Information
Chapter 1 Data Processing and Information

1.1 Data and Information.


 Data: Raw numbers, letters, symbols, sounds or images with no meaning on its
own.
o Example: 11431
o Context: Postal code

 Information: Data that has been processed and given context and meaning and
can be understood on its own.
o Example: 11431
o Context: Postal code
o Meaning: This is a postal code in Egypt.

1.2 Sources of Data


Direct data Indirect data
Collected from a primary source
Definition

that must be used for the same Collected from a secondary source and
purpose for which it was already existed for another purpose.
collected.
Asking the retailer for the shoes
Asking someone who bought the shoes
Examples

price.
about the price.
Questionnaires, Interviews,
Electoral Register and third parties.
Observation and Data Logging
The data will be relevant because
Additional unwanted data will exist or
Difference between static and dynamic information

what is needed has been


wanted data may not exist.
collected.

The original source is known and The original source may not be known
so can be trusted. and so it can’t be assumed that is reliable.

It can take a long time to gather


original data rather than using The data is immediately available.
sources

data that already exists.

The data is likely to be up-to-date


Data may be out of date because it was
because it has been collected
collected at a different time.
recently

Bias can eliminated by asking a


specific question or search for a It can be biased due to its source.
specific thing.

Page | 2 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

1.2.1 Direct data sources

 Questionnaires: set of questions specific to a subject or an issue designed to gather


data from people being questioned. Questionnaires are easy to distribute, complete and
collect as most people are familiar with this process. It can be on paper or on computer.

 Interviews: Arranged format meeting, usually between two people. The interviewer
keeps asking questions in a structured or unstructured way. Structured interviews are
similar to questionnaires, set of questions asked in the same order every time.
Unstructured interviews are different from every interviewer and there’s no scenarios to
be followed.

 Observation: It’s a method of collection of data, observers are asked to collect data
about a given situation by just watching by themselves what happens.

 Data Logging: Data logging means using a computer and sensors to collect data. The
data is then analysed, saved and the results are output, often in the form of graphs and
charts. Data logging systems can gather and display data as an event happens. The data
is usually collected over a period of time, either continuously or at regular intervals, in
order to observe particular trends. It involves recording data from one or more sensors
and the analysis usually requires special software. Data logging is commonly used in
scientific experiments, in monitoring systems where there is the need to collect
information faster than a human possibly could, in hazardous circumstances such as
volcanoes and nuclear reactors, and in cases where accuracy is essential. Examples of
the types of information a data logging system can collect include temperatures, sound
frequencies, light intensities, electrical currents, and pressure.

1.2.2 Indirect data sources

 Electoral register: Also known as Electoral rolls, it is a list of people that are allowed to
vote in a certain election. Sometimes there’s an open version from this roll that anyone
can purchase and use for any purpose. They contain information like names, addresses,
ages and other personal details.

 Third parties: It’s a method of collection of personal data, When you decide to deal with
certain business offering a service or a product, usually you accept their terms to sell
your personal details to other businesses, other organizations buy your data for their
own use and this data usually collected by dealing with businesses, social media or even
mobile activity.

Page | 3 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

1.3 Quality of Information


 The quality of information is determined by the attributes mentioned below:

Attribute Definition Examples of bad information quality


All information that is required  Giving an address without
C Completeness
must be provided. the building number.

 Ordering a cheese pizza


There needs to be the right amount without mentioning the
of information for it to be good size.
L Level of Detail
quality, not too little or not too  Searching among all the
much information IGCSE exams dates to find
your exam date

 The next bus arrival time


A Age Information must be up-to-date.
not up-dated.

Information must be relevant to its  Busses schedule and you


R Relevance
purpose need to catch a train

Information must be accurate to be  10.51 instead of 105.1


A Accuracy
considered as good quality.  Mess instead of miss

1.4 Accuracy of Data


 Validation: It is the process of checking if the data matches acceptable rules.

Types of validations:

o Length: Data is of a defined length or within a range of lengths.


 Example: The password is at least 8 characters.

o Range: Data is within a defined range.


 Example: The age of the IGCSE students is between 15 and 18.

o Limit: Same like the range check but only one boundary.
 Example: The minimum age for driving is 18.

o Presence: Ensures that data is entered.


 Example: When you see a mandatory field when filling forms.

o Type: Ensures that data matches the defined data type.


 Example: If a price is entered it must be numeric.

o Format: Ensures that data matches the defined format.


 Example: The date is in the format of DD/MM/YYYY

o Lookup: Checks if the entered data exists in a list.


 Example: Choosing only the grades A, B, C or D.

Page | 4 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

o Consistency: Checks and compares if the data entered in a field is consistent


with another field.
 Example: If you entered in the title field “Mr” then the gender field
must be Male and if you entered “Ms” then the gender field must be
Female.

o Check digit: It’s used to check if the entered identification number matches
an existing rule. It’s done by comparing the result of a calculation by a check
digit placed at the end of the identification number.
 Example: A barcode “2413-6”, the check digit “6” must be equal to the
sum of the even numbers in the barcode.

 Proof reading: It is the process of checking the information by making sure that it
does not contain any spelling mistakes, grammar mistakes or the formatting is
consistent and the document is accurate.

 Verification: It is the process of checking if the entered data matches the original
source.

o Visual checking: The user reads and compares the entered data to the
original source.

o Double data entry: Data is entered to the system twice and checked for
consistency, if they do not match then it is incorrect.

o Parity Check: This is check is done to make sure that data is transmitted
correctly between any devices by making sure that number of 1’s in every
byte is even.

Steps of Parity Check

1. The data sent is converted to bytes then bits. For example the word: “Hey”
a. H is converted to 72 then converted to 01001000
b. e is converted to 101 then converted to 01100101
c. y is converted to 121 then converted to 01111001
2. The data then is determined if it has even number of 1’s or odd number of
1’s
3. If it’s even we will add 0 to end of the number and if it’s odd we will add 1
to the end of the number.
4. So the data sent will be as follows:
a. H has two 1’s so it will be 010010000
b. e has four 1’s so it will be 011001010
c. y has five 1’s so it will be 011110011
5. The data is now ready to be sent, the receiver will now check if it has even
number of 1’s, if not then the receiver knows that the data is manipulated.

Page | 5 Eng. Hossam Badawy


Chapter 1 Data Processing and Information
Parity check won’t be effective if the error is transposed bits, for example:
011010101 became 101010011, no errors will be detected as it is still even
number of 1’s.

o Check Sum: It’s a calculated value named checksum, it can be calculated


using many algorithms ( many ways ). The checksum is calculated on the
whole file sent not on every byte like the parity check, after the checksum is
calculated it’s attached to the file sent. The receiver then recalculates the
checksum using the same algorithm and if there’s any difference then the file
has probably been corrupted.

o Hash Total: It’s done on fields in files by adding its values. For example:

 In this file you can see Student IDs that is stored in alphanumeric form

Student Exam
ID Mark
012 50
023 45
045 40

 We will use the Hash Total algorithm with Student ID field, the Student
ID field will be converted into a number form and added up, so it will
be as follows:
12 + 23 + 45 = 80

 The total 80 will be sent to the receiver along with the file sent and
then the receiver will recalculate the total on the same field and
compare if both Hash Totals are equal then it’s transmitted correctly.

Hash Totals are usually calculated on fields that there’s no purpose


of adding them up like the Student ID.

o Control Total: The same as the Hash Total but this time it will only calculate
the Control Total value on numeric fields and it produces meaningful values
that can be used for other purposes, for example:

 The teacher will use the data in the table above to calculate the
average exam marks in the class, this will produce a control total value
of 45.

 This value will be attached to the file and sent, the receiver will then
recalculate the average and make sure that they are the same, if any
difference happened then the file is probably changed during
transmission and it has errors.

Page | 6 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

1.5 Encryption
This is the process of converting readable and understandable data into unreadable data by
scrambling it and making it harder to understand and process. Encrypted data can be
intercepted but cannot be understood.

Symmetric encryption
Also known as ‘secret key encryption’. This is the oldest method of encryption. It requires both
the sender and recipient to possess the secret encryption and decryption key. The secret key
needs to be sent to the recipient.

Asymmetric encryption
It is also known as public-key cryptography. It overcomes the problem of symmetric encryption
keys being intercepted by using a pair of keys. This will include a public key which is available
to anybody wanting to send data, and a private key that is known only to recipient.

Page | 7 Eng. Hossam Badawy


Chapter 1 Data Processing and Information
Symmetric encryption requires much less processing time than Asymmetric encryption but in
the symmetric encryption if a hacker gained access to the secret he can now encrypt/decrypt
messages but in the Asymmetric encryption the private key cannot be deduced from the public
key hence better security.

Many security companies nowadays use the asymmetric encryption to trade the secret
encryption key ( used in the symmetric encryption ) and continue to use the symmetric
encryption to send and receive data.

Encryption protocols
An encryption protocol is the set of rules setting out how the algorithms should be used to
secure information. The most popular protocol used when accessing web pages securely is
transport layer security ( TLS ). TLS is an improved version of the secure sockets layer (SSL)
protocol and has now, more or less, taken over from it, although the term SSL/TLS is still
sometimes used to bracket the two protocols together.

Purposes of SSL/TLS:

 enable encryption in order to protect data


 make sure that the people/companies exchanging data are who they say they are
(authentication)
 ensure the integrity of the data to make sure it has not been corrupted or altered.
 ensure that a website meets PCI DSS rules. The Payment Card Industry Data Security
Standard (PCI DSS) was set up so that company websites could process bank card
payments securely and to help reduce card fraud. This is achieved by setting
standards for the storage, transmission and processing of bank card data that
businesses deal with
 improve customer trust. If customers know that a company is using the SSL/ TLS
protocol to protect its website, they are more inclined to do business with that
company.

SSL/TLS and digital certificates


Any website that uses HTTPS in their hyperlinks are secured webservers using the SSL/TLS
protocols. Any website needs to be verified before communicating with, the SSL/TLS uses the
digital certificate to verify it.

Digital certificates are issued by an entity called Certificate Authority ( CA ) and they contain
the domain name of the webserver ( the name of the website ), the CA’s digital signature and
the public key of the website.

Digital certificates prevents fraudsters from creating fake websites. Valid certificates can be
only obtained after running a number of checks from the CA. If hackers are able to break into
the CA system, they will be able to create fake certificates and will have a better opportunity to
crack encryptions.

Page | 8 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

SSL/TLS in Client – Server Communication


Transport layer security (TLS) is used for applications that require data to be securely
exchanged over a client–server network, such as web browsing sessions and file transfers.

In order to open an SSL/TLS connection, a client needs to obtain the public key. For our
purposes, we can consider the client to be a web user or a web browser and the server to be
the website. The public key is found in the server’s digital certificate.

When a browser (client) wants to access a website (server) that is secured by SSL/TLS, the
client and the server must carry out an SSL/TLS handshake. A handshake, in IT terms, happens
when two devices want to start communicating.

Handshake steps:

1. The client sends a message to the server telling it what version of SSL/TLS it uses
together with a list of types of encryption that the client can use.
2. Server responds with a message which contain the type of encryption that will be used.
3. Server shows the client digital certificate to prove authenticity.
4. Client runs a number of check to prove that the certificate is authentic.
5. Client sends a random string of bits ( 0’s and 1’s ) that is used by both client and server to
calculate the private key. The string is encrypted using the public key.
6. Client then sends an encrypted message to the server telling it the handshake is
complete

Uses of Encryption
Hard disk encryption
The principle of hard-disk encryption is fairly straightforward. When a file is written to the disk, it
is automatically encrypted by specialised software. When a file is read from the disk, the
software automatically decrypts it while leaving all other data on the disk encrypted. The
encryption and decryption processes are understood by the most frequently used application
software such as spreadsheets, databases and word processors. The whole disk is encrypted,
including data files, the OS and any other software on the disk. Full (or whole) disk encryption is
your protection should the disk be stolen, or just left unattended. So, even if the disk is still in
the original computer, or removed and put into another computer, the disk remains encrypted
and only the keyholder can make use of its contents.

There are, however, drawbacks to encrypting the whole disk. If an encrypted disk crashes or the
OS becomes corrupted, you can lose all your data permanently or, at the very least, disk data
recovery becomes problematic. It is also important to store encryption keys in a safe place,
because as soon as a disk is fully encrypted, no one can make use of any of the data or
software without the key. Another drawback can be that booting up the computer can be a
slower process.

Page | 9 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

Email
When sending emails, it is good practice to encrypt messages so that their content cannot be
read by anyone other than the person they are being sent to. Many people might think that
having a password to login to their email account is sufficient protection. Unfortunately, emails
tend to be susceptible to interception and, if they are not encrypted, sensitive information can
become readily available to hackers.

Email encryption parts:

1. The first is to encrypt the actual connection from the email provider, because this
prevents hackers intercepting and acquiring login details and reading any messages
sent (or received) as they leave (or arrive at) the email provider’s server
2. Then, messages should be encrypted before sending them so that even if a hacker
intercepts the message, they will not be able to understand it. They could still delete it
on interception, but this is unlikely
3. Finally, since hackers could bypass your computer’s security settings, it is important to
encrypt all your saved or archived messages.

Encryption in HTTPS websites


HTTP (Hypertext Transfer Protocol) is the basic protocol used by web browsers and web
servers. Unfortunately, it is not encrypted and so can cause internet traffic to be intercepted,
read and understood. Hackers could intercept any private information including bank details
and then use these to commit fraud. HTTPS (Hypertext Transfer Protocol Secure), however,
enables users to browse the world wide web securely. To do this, it uses the HTTP protocol but
with SSL/TSL encryption overlaid. HTTPS websites have a digital certificate issued by a trusted
CA, which means that users know the website is who it says it is.

Indicators that you are using a secure site are the inclusion of the HTTPS:// prefix as the
starting part of the URL. There should also be a padlock icon next to the URL.

Advantages and disadvantages of encryption


Pros:

 Personal data and credit card info remains safe


 Encrypted information can no longer be changed or used for theft purposes
 Encrypted information cannot be sold or used by hacker to rival companies

Drawbacks:

 Takes more time to load encrypted data as well as requiring additional processing
power.
 Takes more time to load webpages with encrypted data.
 It takes up some memory from the client and server sides
 Ransomwares can be used by hackers to encrypt the data of a user’s computer system
and ask for money to decrypt it back.

Page | 10 Eng. Hossam Badawy


Chapter 1 Data Processing and Information

1.6 Processing

Data must be processed so that it can become information. Data can include personal data,
transaction data, sensor data and much more. Data processing is when data is collected and
translated into usable information. Data processing starts with data in its raw form and translates
it into a more readable format such as diagrams, graphs, and reports. The processing is required
to give data the structure and context necessary so it can be understood by other computers
and then used by employees throughout an organisation.

Batch Processing
Input data is stored in a file called transaction file and at a scheduled time, the computer
processes the collected data in one go.

Examples:

 Producing utility bills


 Clearing of bank cheques
 Updating of a stock database

Online Processing
Here the user is in direct communication with the computer system and the data is processed
shortly.

Examples:

 Electronic fund transfer ( ATMs )


 Online stores
 Point of sales ( Cashiers )

Real Time Processing


It’s an example of online processing but in this case the data is transferred to the CPU and
processed immediately without any delays. This type of processing involves the use of sensors
and can be found in measuring and control systems.

Examples:

 Greenhouses
 Intensive care units
 Weather stations

Page | 11 Eng. Hossam Badawy


Chapter 2
Hardware and Software
Chapter 2 Hardware and software

2.1 System software


System software refers to the programs that run and control a computer’s hardware and
application software. Examples of system software are compilers, interpreters, linkers, device
drivers, operating systems and utilities.

2.1.1 Operating Systems


It manages the hardware and software within a computer system.

It manages hardware and software by carrying out tasks such as:

 Allocating memory to software


 Sending data and instructions to output devices
 Responding to input devices
 Opening and closing files on storage devices
 Giving each running task a fair share of processor time
 Sending error messages to applications users
 Dealing with user logons and security

2.1.2 Device drivers


The operating system is always in communication with the external hardware connected to the
computer system, sometimes hardware is manufactured to communicate with a language
which is unknown to the operating system. Device drivers acts as a translator between the
operating system and the hardware so they can communicate together and send and receive
instructions.

2.1.3 Compilers
It translates the program written in a high-level programming language into machine code
which a computer can understand. The file created with the machine code is known as an
executable file ( Object code file ) because it can be executed by the processor. When a
program is compiled, the whole source code is translated into the executable file at once and
can then be distributed to customers and individual computers, it can only run on operating
systems for which the compiler has translated it.

2.1.4 Interpreters
They also translate a program written in a high-level programming language into machine
code, but use a different method. The whole source program is translated one line at a time.
This can be less efficient than a compiler because it takes time to do the translating as the
program is being executed and analyzed each time around. The source program can be used
with any operating system.

Page |2 Eng. Hossam Badawy


Chapter 2 Hardware and software

Compiler Interpreter
Translates source code into object code all at Translates source code into object code one
once line at a time

Compiled object code will only work on the Source code can be translated into object
operating system it has been compiled for code for more than one operating system

Object code has to be generated every time


Object code is ready to be executed without
so additional time is added to the execution
delay
time

Interpreter stops whenever an error is found


Compiling can make error detection harder
and won’t proceed until the error is resolved
as it translates the program all at once and
so it makes the error finding process a lot
produce a list of errors.
easier.

Source code won’t be available to be seen


Source code needs to be available every
after execution as it will be converted to
time it’s going to be executed so this leads to
object code so no one can infringe the
a higher risk of copyrights infringement
copyrights of the program.

2.1.5 Linkers
Computer programs often consists of several parts of programming code. Each part carries out
a specific task (module) within the program. Each part will have been compiled into a separate
object file. The function of a linker is to combine the object files together to form a single
executable file.

Page |3 Eng. Hossam Badawy


Chapter 2 Hardware and software

2.2 Utility software


Software that performs maintenance on the computer system.

2.2.1 Anti-virus
It deals with threats such as adware and spyware as well as viruses. It has two main functions.
The first is an anti-virus monitor that is continually monitoring the system for viruses and
malware. The second function is to check for viruses or malware that may already be on a
system.

When a malware is found, the antivirus either deletes the file which the malware is attached to
or quarantine the file and tries to fix it.

There are 3 algorithms that the antivirus uses to find a malware in a file:

 Signature based algorithm: it compares the files to a known database of malware and
checks for any match. If the database is outdated, it will lead to a undetectable malware.

 Heuristic based algorithm: the source code of any program is compared to known
source code of malware, if any percentage of match found the antivirus will start acting
as if it’s a malware. It may lead to false positives.

 Behavioral based algorithm: the antivirus is waiting for any unusual activities from the
programs on the system, if it finds a malware-like actions, it will immediately stop the
program from running.

2.2.2 Backup
Back-up software is a program that is used to keep copies of files from a computer or copy the
content of a server’s backing storage. The back-up is an exact duplicate of the files. It can be
used for restoring the original files, should the original files become corrupted or deleted,
accidentally or deliberately. Backup software allows the user to select the time and type of
back-up they want and how regularly the back-up is to take place.

2.2.3 Data compression


It will reduce the original size of files so that they use up less storage space. It will be slower to
open the compressed file but it can be transferred from one location to another faster and
saves some of the storage space. It can be lossy or lossless.

 Lossy compression: permanently deletes data bits that are unnecessary, such as the
background in a frame of a video which might not change over several frames.
Commonly used with computer images with a low quality resolution.

 Lossless compression: after compression, the file is converted back into its original
state, without the loss of a single bit (binary digit) of data. When the lossless
compression software sees a repeated sequence of bits it replaces the repeated
sequences with a special character which indicates what is being repeated and how
many times.

Page |4 Eng. Hossam Badawy


Chapter 2 Hardware and software

2.2.4 Disc defragmentation


When a file of data is stored on a disk, it may consist of several blocks. There may not be
enough blank or empty sectors next to each other to store all the blocks together which means
they have to be spread out across the disk. The file is now said to be fragmented. When data is
no longer needed it is deleted from the disk, which leaves some empty sectors.

Defragmentation software is used to organise the data on the disk by moving the data blocks
around to bring all the parts of a file together so they are contiguous. As a result, data retrieval is
made easier and quicker. With fragmented files it takes longer for the read–write heads to
move over the surfaces to find all the different fragments of files than if the data is held in
sequence. In addition, the software provides additional areas of free space and more storage
capacity.

2.2.5 Formatting
Disk formatting is the configuring of a data storage medium such as a hard disk or SSD for initial
use. It can be performed on a disk that already has files on it, but all those files would be erased.

There are two types of disk formatting:

 Low level formatting: prepares the actual structure of the disk by dividing the disk into
cylinders and tracks and then dividing the tracks into sectors. This type of formatting is
usually carried out by manufacturers not individual users. If users were to attempt this,
there are at least two drawbacks: after erasing all the files, it would be almost impossible
to restore them and if done repeatedly, it would shorten the life of the medium.

 High level formatting: it does not permanently erase data files but deletes the pointers
on the disk that tell the OS where to find them. High-level formatting is typically done to
erase the hard disk and reinstall the OS back onto the disk drive. Unlike low-level
formatting, the files are retrievable. One benefit of disk formatting is that it can remove
viruses.

2.2.6 File copying


File copying is creating a duplicate copy of an existing file. The copy will have exactly the same
content as the original.

2.2.7 Deleting
The delete utility is a piece of software which deletes the pointers that tell the OS where to find
the file. The OS now considers these sectors to be available for the writing of fresh data. Until
new data is written to the space the file occupies, users can still retrieve the data. Data recovery
software is available which allows users to retrieve deleted data.

Page |5 Eng. Hossam Badawy


Chapter 2 Hardware and software

2.2.8 Structure of a hard disk

The hard disk is divided into several platters that contains the data written on it, the mechanical
arms keeps moving, without touching the surface, to read and write on the platters.

The platters are divided into tracks and the tracks are on every platter in the same place so it
forms a cylinder.

The tracks are divided into sectors.

The sectors are grouped in a power of 2’s ( 2, 4, 8, 16 … ) to form blocks.

When a cylinder is filled with data the arms move to another track to start writing data on it.

2.3 Custom-written versus off-the-shelf software


Custom-written software is a software made by a software development company for a specific
client with specific requirements while the off-the-shelf software is a software made by
commercial business to provide a certain service for a lot of clients and sold publicly.

Custom-written Off-the-shelf
The entire development cost is met by the The development cost is spread between all
client for whom it is written , which makes it the customers who purchased it at a specific
very expensive price which means the cost is much lower
Takes long time to develop Immediately available
The requirements of the client can be met Some tasks that the customer needs to carry
precisely out may not be possible
The developers of the software will make
The software may not be compatible with the
sure that it is compatible with hardware and
hardware and data used by the customer
data used by the client
It is likely that bugs will be found within the
Bugs will have been identified and fixed
software
The client will have access to support from Customers will be able to get support from a
the company wide range of sources

Page |6 Eng. Hossam Badawy


Chapter 2 Hardware and software

2.4 – User Interfaces


A user interface is how the interaction between the user and the computer system happens.

Command line interface


It allows the user to enter text commands to which the
computer system will response. It uses very little memory
adding to this it is also useful for technical users who need
to carry out complex operations. However, it can be
difficult to learn and use because users have to learn and
remember all the commands, and errors are easily made
when entering those commands.

Graphical user interface


It is the most common type of interface.

GUIs can include some or all of the elements shown:

 Windows
 Icons
 Menus
 Pointers
The acronym WIMP is commonly used to remember these
elements. Complex GUIs require a lot of memory to operate,
but simpler GUIs can be used where memory is limited. GUIs
are intuitive to use which means they are easy to learn.
However, they can be restrictive for some technical users who
need to carry out unusual tasks.

Dialogue interface
It refers to using the spoken word to communicate with a computer system. A big advantage of
dialogue interfaces is than no hands are required. There is no need for a physical interface with
dialogue interfaces. However, the main problem with it is the computer system’s ability to
recognize the spoken word because of the background sound, different voices and different
accents. Systems are not intelligent enough to simply understand requests in any format that
the user chooses.

Page |7 Eng. Hossam Badawy


Chapter 2 Hardware and software

Gesture-based interface
It will recognize human motion. This could include tracking eyes and lips, identifying hand
signals or monitoring whole body movement. Gestures can be an essential form of interaction
for some disabled users and an easy form of interface to learn and use. However, one of the
biggest problems with gesture is accuracy. This is why many virtual reality applications still use
sensors attached to various parts of the body in order to improve accuracy. It can also be very
difficult to control a pointer when a finger is in mid-air rather than when firmly fixed to a touch
screen.

2.5 Mainframe computers and supercomputers


Both are powerful computers that are used nowadays to fulfill duties that needs consistency
with minimal faults and very complex instructions and calculations.

2.5.1 Mainframe computers


Mainframes are characterized with a very special term called RAS.

 Reliability: Mainframes are the most reliable computers because their processors are
able to check themselves for errors and are able to recover without any undue effects
on the mainframe’s operation. The system’s software is also very reliable, as it is
thoroughly tested and updates are made quickly to overcome any errors.

 Availability: This refers to the fact that a mainframe is available at all times and for
extended periods. Mean time between failures (MTBF) is a common measure of
systems. It is the average period of time that exists between failures (or downtimes) of a
system during its normal operation. Mainframes give months or even years of system
availability between system downtimes. In addition to that, even if the mainframe
becomes unavailable due to failure, the length of time it is unavailable is very short. It is
possible for a mainframe to recover quickly, even if one of its components fails, by
automatically replacing failed components with spares. Spare CPUs are often included
in mainframes so that when errors are found with one, the mainframe is programmed to
switch to the other automatically. The operator is then alerted and the faulty CPU is
replaced, but all the time the system continues to work.

 Serviceability: This is the ability of a mainframe to discover why a failure occurred and
means that hardware and software components can be replaced without having too
great an effect on the mainframe’s operations.

Page |8 Eng. Hossam Badawy


Chapter 2 Hardware and software

2.5.2 Characteristics of mainframe computers and supercomputers

Longevity

 Mainframe: have great longevity, or lifespans. This is because they can run continuously
for very long periods of time and provide businesses with security in the shape of
extensive encryption in all aspects of their operation.

 Supercomputers: have a lifespan of about five years, institutions using supercomputers


tends to update their computers every now and then whenever a new faster version is
produced.

Security

Both have great security measures and also mainframes have many layers of security for the
data stored in it.

Ways of securing data:

 User id’s and authentication and multi factor authentications like passwords, physical
tokens and biometrics

 levels of access, which means that it depends on a user’s level of security as to which
sets of data they can access

 encryption of transmitted data and data within the system

 secure operating systems

 continual monitoring by the system for unauthorized access attempts.

Performance metrics

The performance metrics of a computer are basically the measures used to determine how
well, or how fast, the processor deals with data.

 Millions of Instructions Per Second (MIPS) : Unit of measuring how mainframes perform.

It is not always the best measure, because not all instructions are the same. Mainframes
use a very large number of different instructions, with some being straightforward and
easy to carry out, while others can be more complex and slower to process. An
application using five million simple instructions will take a lot less time than one using
five million complex ones. In addition, the number of available instructions is increasing
as time goes by and mainframes improve. It is important that the comparison between
the performance of one mainframe and another is made by measuring how fast the
CPUs are when carrying out the same task. This is referred to as a benchmark test.

 Floating Point Operations Per Second (FLOPS) : measurement unit of supercomputers


performance, they are used mainly with scientific calculations, their performance is
measured by how many Floating point Operations can be carried out Per Second, ,
speeds have increased incredibly and are now measured in petaflops.

Page |9 Eng. Hossam Badawy


Chapter 2 Hardware and software

Volume of input, output and throughput

Mainframes have specialized hardware, called peripheral processors, that deal specifically
with all input and output operations, leaving the CPU to concentrate on the processing of data.
This enables mainframes to deal with very large amounts of data being input and subsequently
very large volumes of output being produced. This large number of simultaneous transactions
and extremely large volumes of input and output in a given period of time is referred to as
throughput.

Supercomputer is designed for maximum processing power and speed, whereas throughput is
a distinct mainframe characteristic.

Fault tolerance

A computer with fault tolerance means that it can continue to operate even if one or more of its
components has failed.

 Mainframe computers have the characteristic of being fault-tolerant in terms of their


hardware. While in operation, if a processor fails to function, the system is able to switch
to another processor without disrupting the processing of data. The system is also able
to deal with software problems by having two different versions of the software. If the
first version produces errors, the other version is automatically run

 Supercomputers have far more components than a mainframe, with up to a thousand


times more processors alone. This means that statistically, a failure is more likely to
occur and consequently interrupt the operation of the system. The approaches to fault
tolerance are much the same as those for mainframe computers, but with millions of
components, the system can go down at any time, even though it tends to be up and
running again quite quickly.

Operating system

 Mainframe computers: usually runs more than one operating system at any given time.

Parallel processing is also utilized by dividing any task to subtasks and each subtask is
processed on a separate processor core and then recombined again to provide the
output.

 Supercomputers tend to have just one OS, but most supercomputers utilize massively
parallel processing in that they have many processor cores, each one with its own OS

Type of processor

 Mainframe computers: tends to have hundreds of processors.

 Supercomputers: tends to have hundreds of thousands of processors.

P a g e | 10 Eng. Hossam Badawy


Chapter 2 Hardware and software

Heat maintenance

Overheating usually happens because of the number of processors available in both


mainframes and supercomputers so heat maintenance must be applied. So liquid cooling
systems and air conditioning systems are applied.

2.5.3 Mainframe uses


 Census: is a term that, when used alone, normally refers to a population census. A
population census is an official survey of the people and households in a country that is
carried out in order to find out how many people live there. It is used to obtain details of
such things as people’s ages and types of employment. The amount of data that has to
be processed is enormous.

 Industry statistics: Industry statistics are statistics that are recorded regarding trends in
different industries, such as those that process raw materials, make goods in factories, or
provide services. They can include the number and names of businesses, the number of
employees and wages paid. Some businesses in certain sectors of industry need
mainframes to process the vast amount of data which helps to identify their major
competitors. It shows their competitors’ share of the market and the trends in their sales.
This helps to identify those products which could compete profitably with other
businesses. Where companies do not feel the need to process their own data, they can
obtain reports from organisations that collect the data for them and those companies
could use mainframes for this purpose.

 Consumer statistics: allow businesses to assess the demand for their product that is
how many people need or want that type of product. They can inform them about the
range of household incomes and employment status of those consumers who might be
interested in the product so that a price can be set. This data will also inform businesses
of where the consumers live for local sales or how inclined they are to use the internet
for shopping. It may also allow businesses to know how many similar products are
already available to consumers and what price they pay for them.

 Transaction processing: it’s when a transaction needs to be conducted between two


entities, like transferring money from a bank account to another, this process must not
fail otherwise it may leave traces in the system that are hard to be fixed. So a consistent
computer system is needed in this case.

P a g e | 11 Eng. Hossam Badawy


Chapter 2 Hardware and software

2.5.4 Supercomputers uses

 Quantum mechanics: is the study of the behavior of matter and light on the atomic and
subatomic scale. A very large number of calculations is conducted to study their
behavior.

 Weather forecasting: based on the use of very complex computer models. Data from
the sensors at weather stations around the world is input to the model and then many
calculations are performed. Records of previous weather conditions have also been
collected over a very long period. Using the past weather readings, the computer
examines similar patterns of weather to those being experienced at the moment and is
able to predict the resulting weather. Variables such as atmospheric pressure, humidity,
rainfall, temperature, wind speed and wind direction are recorded using computerised
weather stations around the world

 Climate research: This is an extension of the use of IT in weather monitoring. Climate is


measured over a much longer timescale. The data collected over several decades can
be used to show the trends of different variables over time. For example, the levels of
nitrogen dioxide, sulphur dioxide and ozone are monitored to determine air quality.
Rivers are monitored, measuring different variables such as temperature, pH, dissolved
oxygen, turbidity (the cloudiness of the water caused by minute particles being present),
and water level.

2.5.5 Advantages and disadvantages


Mainframe advantages Mainframe disadvantages
Reliable and rare downtimes Very high buying cost
Can deal with huge amounts of data and High cost to maintain and large rooms are
processing. needed to store it in.
Very strong security measures Cooling systems are expensive
- Cloud services are taking over mainframes

Supercomputer advantages Supercomputer disadvantages


Fastest data processing computers Very high buying cost and maintenance cost
One operating system Less fault tolerant than mainframes
Massive Parallel processing Cooling systems are expensive

P a g e | 12 Eng. Hossam Badawy


Chapter 3
Monitoring and Control
Chapter 3 Monitoring and Control

3.1 Monitoring technologies


Definition
➢ Monitoring, or measurement as it is sometimes called, involves the use of a computer
or microprocessor-based device to monitor or measure physical variables over a period
of time.
➢ Monitoring systems are different to control systems regarding their outputs. Control
systems process the data and then make decisions based on the data regarding which
actions to take. Monitoring systems only process and record data so that people can
see trends in the changes that are taking place in the environment being monitored.
➢ The output from the system is usually on a screen or printed out, but can be a
warning sound if the monitoring that is taking place is critical

Sensors
Sensors collect and send back data to the computer continuously. Usually, the data is sent in
analogue form which will need an Analogue-to-Digital converter (ADC) to be processed by
the computer. The table below describes the most commonly occurring sensors and their
usage:
Type of Sensor Description and use
Light/ultraviolet ❖ Light sensors convert light to electrical energy and based on the amount of
energy produced it gives a value for light.
❖ Used in weather stations to measure amount of sunlight
❖ UV sensors measure the amount of UV radiations which sometimes may
be harmful to humans and may cause cancer.
Temperature ❖ Electrical signals are generated which are converted into values to
represent temperature.
❖ Used to measure the ambient temperature in a weather station, the
temperature in a river or air quality
Pressure ❖ Converts the force applied to its surface to generate electrical energy
which is then converted into values to represent the applied pressure
❖ These sensors are used to measure atmospheric pressure in weather
stations
Humidity/moisture ❖ Humidity sensors are often a combination of a moisture sensor and a
temperature sensor in one unit, because humidity is measured based on
how much water in the atmosphere together with the temperature.
❖ Used to measure the air humidity in a weather station.
❖ Moisture sensor is a combination of a light sensor and a light emitter, as
the amount of light transmitted depends on the moisture content of the air.
❖ Used when monitoring soil quality.
Sound ❖ Converts sound waves into voltages or electrical signals which are
converted by the computer into values to represent sound
❖ Used in environmental monitoring systems to measure noise pollution.

Page |2 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

Infrared ❖ All bodies possess thermal energy and therefore emit infrared radiation.
This radiation is converted into electrical signals as a result.
❖ Used in environmental monitoring, for example the Earth’s surface
temperature can be monitored by satellites.
Oxygen, carbon ❖ These are sensors used in environmental monitoring and water pollution
dioxide, pH, turbidity monitoring.
❖ Oxygen (O2) sensors measure the level of oxygen in soil and water.
❖ Carbon dioxide (CO2) sensors measure the level of carbon dioxide in the air
or in water and are basically an adaptation of an infrared sensor.
❖ pH sensors measure the acidity of soil and acidity in rivers, lakes, etc.
❖ They generate electricity depending on the number of hydrogen ions in the
solution, which causes an electrode to generate a voltage.
❖ Turbidity sensors measure the cloudiness of water in a river that is
affected by pollution.
❖ Turbidity sensor is actually a light sensor usually placed at right angles to a
light emitter. The greater the number of particles in the water, the greater
the amount of light reflected off them on to the sensor.
Reed switch ❖ Strictly speaking, a reed switch is not a sensor, but it is used to help
measure rainfall
Electromagnetic field ❖ Measures the change in the Earth’s natural magnetic field caused by the
presence of a ferromagnetic object.
❖ For example, when a vehicle is above the sensor, the metal in the body of
the vehicle distorts the Earth’s magnetic field and so its presence is
detected.
❖ Installation and maintenance are easier and cheaper than an induction
loop
❖ Used in some automated car parking systems to help drivers park their car
Ultrasonic ❖ Made up of a device that sends out sound waves with a frequency
greater than human audible range and a sensor that receives the reflected
ones.
❖ It measures the amount of time taken for the sound to be sent and
received to calculate the distance from an object.
❖ It is used in automated car parking systems which let the driver know
when they are close to another vehicle or other object so they can park
their car without hitting that obstacle
Proximity ❖ A proximity sensor can be a mixture of sensors
❖ Usually made of a device that sends out a signal and a sensor which
receives the reflected signal back.
❖ This can be an infrared beam, ultrasound or a magnetic field.
❖ Used in smartphones to switch off the screen display when the phone is
held near to the ear.
Touch ❖ Measures the capacitance between two conductors separated by an
insulating plate. One of the conductors will be the fluid whose level is
being measured. When the fluid is touching the sensor, it detects that it is
at that level.
❖ Used to measure fluid levels such as the cooling water level in nuclear
power plants to ensure that there is sufficient water to cool the reactors

➢ Note: All the above sensors can be used in both monitoring systems and in control
systems; except the last 4 sensors, they are more likely to be found in control
systems than monitoring systems

Page |3 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

Uses of monitoring technologies


1. Weather stations
For a simple weather station found in a school for example, we will need to use the following
sensors:
➢ Temperature: measures ambient temperature
➢ Pressure: measures the atmospheric pressure, which helps to formulate weather
forecasts; high pressure → sunny weather, low pressure → wet and windy weather
➢ Humidity: measures absolute (moisture only without temperature) and relative
humidity. Used to predict the likelihood of rain and snow
➢ Light: measures the hours of sunlight
➢ Reed switch: measures rainfall
➢ Wind speed can also be measured using a sensor or multiple sensors

The processing might consist of calculating, for each day:


➢ The highest, lowest and mean temperature
➢ The level of UV radiation
➢ Total rainfall
➢ Hours of sunshine
➢ Highest and lowest value of atmospheric pressure
➢ Wind speed and direction.

Results can be output in the form of graphs, either to a monitor or printed out. This all happens
automatically without the need for human intervention.

2. Monitoring water pollution


There are basically two ways of carrying out the study.
➢ Compare the readings with those that would normally be expected. This requires the
lowering of one set of sensors into the river or lake.
➢ Measure pollution from a farmer’s field or a factory. This involves inserting two sets of
sensors, one upstream from the suspected site of pollution and the other downstream,
immediately after the site. Compare them to find if the site is polluted or not
The sensors involved are:
➢ Temperature
➢ pH
➢ Turbidity sensors
➢ O2
➢ CO2

Page |4 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

3. Environmental monitoring
Environmental monitoring is the collection of data relating to our environment. It includes:
➢ Monitoring sound in cities
➢ Monitoring pollution produced by motor vehicles
➢ Monitoring soil quality in outdoor gardens/ greenhouses/glasshouses, using pH,
moisture and temperature sensors, among others
➢ Detecting abnormally high temperatures using temperature sensors
➢ Monitoring the level of air pollution using O2, CO2 and pH sensors
➢ Monitoring ultraviolet levels; excessive amounts can cause skin cancer

Calibration
Calibration is making sure that when, for example, a temperature sensor is used to measure the
temperature of boiling water, it actually causes the computer to output a value of 100 ºC. It is
done by comparing the value a sensor produces to a known measurement.
Methods used to calibrate devices:
1. One-point calibration
To carry out a one-point calibration:
➢ A reading is taken from the sensor in the range being measured
➢ It is compared with either a pre-calibrated sensor or a known value.
➢ The sensor reading is subtracted from the known value which gives the ‘offset’.
➢ This offset is then added to every reading in the temperature range being measured.
This type of calibration is often needed for sensors which are constantly used at very high
temperatures and after some time lose accuracy.

2. Two-point calibration
Assume we need to calibrate a pH sensor:
➢ Use a pre-calibrated sensor against the one
under testing for a range of pH values
➢ An offset here cannot work since we have a +1
difference in some readings and a -5 in others
➢ Find the linear relationship between the two
lines, which in this case is multiply by 2 and
subtract 3
➢ Try to use a wide range that would cover all the
expected results, in our case, place the sensors in
pH 4 (acidic), 7 (neutral), 10 (alkaline)

Page |5 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

3. Multipoint calibration
➢ Same approach as two-point calibration
➢ This time the relationship is not linear
➢ You will need to use curve fitting in order to
find the relation between them
➢ Make sure to use at least 3 readings and to be
widely spread to cover your range (in our case
we could’ve used 0, 50, 100 ºC)

Advantages and disadvantages of monitoring technologies


Advantages of computer monitoring Disadvantages of computer monitoring
Computers can take readings at more frequent Computers can be expensive to buy and maintain
intervals and can read more than one variable
simultaneously.
The readings are always taken at regular intervals
unlike with a human who might forget to take them.
Computers can be left on to take readings at any
time, day or night.
It takes time for people to draw accurate graphs It is quite difficult to program computers to interpret
the results, but humans can interpret results and are
also needed to program the computers in the first
place
Results are produced automatically after the
readings are received by the computer; humans
would take much longer time
Readings taken by computers tend to be more Sensors can deteriorate after a period of time,
accurate than those by humans as computers are whereas humans will tend to be more consistent.
not subject to ‘human error’

3.2 Control technologies


Definition
➢ Control systems use real-time processing.
➢ Unlike in monitoring systems, in control systems the output affects the input.
➢ They make use of actuators to control devices.
➢ An actuator is a device that turns an electrical signal from a microprocessor into
movement, such as the valve which allows water to flow through heaters or sprinklers in
a greenhouse.

Page |6 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

Uses of control-technology systems


1. Greenhouses (glasshouses)
Greenhouses are used in countries with cooler weather so
that people can grow plants that are normally grown in
warmer countries. The sensors needed in a greenhouse
are:
➢ Temperature: measure the air temperature, based
on the reading the heater and window motor will
be turned on/off
➢ Moisture: measure the water content in the soil,
based on the reading the sprinkler will be truned on/off
➢ Light: measure the light level, based on the readings the light source will be turned
on/off
The microprocessor must be fed with pre-set values, to compare the sensor readings with and
based on the result send a message to the appropriate actuator.

Algorithm to maintain required temperature:

Algorithm to maintain required soil moisture:

Page |7 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

Algorithm to maintain required level of light:

2. Central-heating systems
Steps in natural language (not pseudocode):

Page |8 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

Flowchart:

➢ NOTE: In this flowchart, it is assumed that pre-set values are already inputted, and it also
does not consider whether the valve/pump are already on/off, this could be solved
using nested if

3. Air-conditioning systems
Steps in natural language (not pseudocode):

Page |9 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

4. Burglar alarms
The sensors needed in such a system are:
➢ Infrared sensors: to detect movement of human bodies, which emit heat
➢ Sound sensors: to detect the level of sound an intruder might make
➢ Pressure sensors: that are placed under a carpet or rug to detect an increase in weight
caused by a burglar treading on it.
In the event of detecting an intruder, the burglar alarm sounds an alarm and causes lights to
flash and probably also sends a signal to the police.

5. Control of traffic/pedestrian flow

➢ In many countries like the UK and Australia, they use a active traffic management to
create a smart freeway/motorway
➢ Based on the state of the road, speed limits vary, and the ability to drive in the hard
shoulder as well (the side of the road where the cars could stop if they broke)
➢ The state of the road can be detected using two techniques:
o Induction Loops: Several of these are placed beneath the road (500m apart),
they will be explained in the next section.
o Side-fire radar: Firing of a radar beam at an angle to the roadside, to measure
the speed of the vehicles.
o This has advantages over the induction loop system because it is not
susceptible to damage caused by potholes or erosion in the road.

P a g e | 10 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

6. Car-park barriers

➢ Uses induction loop buried under the surface; when a vehicle passes over the loop, the
metal causes a change in the magnetic field and leads to the car being detected
➢ This will send a message to the actuator (motor in this case) to move the barrier
upwards
➢ Such system also uses a light beam source and a light sensor
➢ If the beam did not reach the sensor, it means that the car has not passed yet hence the
barrier should stay up, when the beam reaches the sensor again it means the car has
passed and the barrier will go down
➢ This makes sure the barrier stays up until the vehicle has passed through the beam.

7. Traffic lights
There are two types of traffic lights:
➢ Fixed time: does not involve a computer, usually
annoys the drivers if they must stop and no other
cars are crossing the road
➢ Computer-based:
o Uses induction loops to detect traffic
o Based on the results they dynamically adjust
the traffic lights timing
o For example: The computer will decide to
keep the light on red for the road which has no traffic. When a sufficient number
of vehicles have stopped at the red light, the computer will cause the red light to
turn green and the other one red.

P a g e | 11 Eng. Hossam Badawy


Chapter 3 Monitoring and Control

Wireless sensor and actuator networks


A wireless sensor and actuator network (WSAN), as the name suggests, is a networked group
of sensors and actuators that communicate wirelessly. Because the actuators might be
grouped together to perform a collaborative action they are sometimes referred to as an
actor. A robot is an example of an actor.

Smart homes
A smart home is a home in which devices and appliances are connected so that they can
communicate with each other and can be controlled using commands by anyone living in
that home.
The most common devices controlled in this way are:
➢ Televisions
➢ Music centers
➢ Lights
➢ Burglar alarms
➢ Central heating and air-conditioning units
The ability to control such devices remotely is called the Internet of Things (IoT).
Its advantages:
➢ Making sure that the front door is locked remotely
➢ Making sure the burglar alarm is switched on remotely
➢ Turning on the AC before arriving home to cool the room
➢ Switching on the oven remotely to arrive to a ready-cooked meal
The main disadvantage here would be the being vulnerable to hackers
Advantages and disadvantages of using control technology
Advantages of control technology Disadvantages of control technology
Controlled burglar alarms gave people a great Increasing automation decreases job opportunities
sense of security which increased the rate of unemployment
Smart homes reduce the amount of energy used. Smart homes led people to become lazier
Computerized traffic lights led to fewer traffic jams It may cost a lot of money to buy a control system
Control systems and smart homes helped people Control systems will not work in case of a computer
with disabilities use their devices at home failure or power outage
They systems tend to process data much faster
than humans
Using such systems leave people free time to do
other things

P a g e | 12 Eng. Hossam Badawy


Chapter 4
Algorithms and
flowcharts
Chapter 4 Algorithms and flowcharts

4.1 Introduction

What is the meaning of Algorithm?


A set of instructions sequenced to solve a problem or to represent a calculation. In other
words, it is a list of precise steps; the order in which these steps are carried out is always crucial
to the way an algorithm works. Algorithms can be written in several ways, including everyday
natural language, pseudocode, flowcharts or programming languages.

To solve any problem using a computer program, you must go through the following steps:
1. Analysis
2. Design
3. Implementation
4. Testing

In this course we are interested in the first 2 steps which are analyzing the given problem and
designing an algorithm to solve it using both pseudocode and flowcharts. After that; the
implementation will be transforming your algorithm design into code using any programming
language and testing it; this is beyond the scope of our course.

4.2 Analysis

Given that we have the following problem:

Problem 1
Write an algorithm that reads two numbers from the user and print out their sum. In other
words, write an algorithm to solve the following equation:
Z=A+B

In the analysis phase we try to figure out what are the inputs of the program, the processing
that should happen and the outputs it shall produce.

In the above case we have:

• Inputs: A and B
• Processing: Z = A + B
• Output: Z

Page | 2 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.2.1 Operators

We have 3 different types of operators:

1. Arithmetic Operators; used for calculations


▪ Addition (+)
▪ Subtraction (-)
▪ Multiplication (*)
▪ Division (/)
▪ Power (^)

2. Logical Operators; used for comparisons


▪ Greater than (>)
▪ Less than (<)
▪ Equal (=)
▪ Greater than or Equal (>=)
▪ Less than or Equal (<=)
▪ Not Equal (<>)

3. Assignment Operator; used to assign a value or expression to a variable


▪ An arrow pointing to the left ()
▪ Examples:
o ZA+B
o A  13
o Sum  Num1 * Num2 / Num3

Page | 3 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.3 Design

After you finish your analysis, it is now time to design your algorithm. In this course we will learn
two common ways of designing an algorithm which are:

▪ Pseudocode
▪ Flowcharts

4.3.1 Pseudocode

It's simply an implementation of an algorithm in the form of annotations and informative text
written in plain English.

Pseudocode Keywords

1. Input Keywords: allow the user to enter a value


▪ INPUT
▪ READ

2. Output Keywords: show the user the value of a variable


▪ PRINT

Examples:

1. Write a statement that will output the words Hello World! on the user's screen

PRINT “Hello World!”

2. Design a program that displays on the screen the following:

Hello World!

Welcome to AS ICT

PRINT “Hello World!”


PRINT “Welcome to AS ICT”

Page | 4 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Variables

While thinking for variable names to write in your pseudocode, you must follow the following
rules:

• Variable names cannot contain symbols including spaces


• Variable names cannot start with numbers
• Variable name should not be a keyword of pseudocode
• Variable names should be meaningful to the value it stores
➢ (total, sum, price, num1, subtotal2, countStudents) are all examples of valid variable
names
➢ (count Students, 1num, OUTPUT, X+) are all examples of invalid variable names

If we would like to write a pseudocode to solve Problem 1, it would look like this:

INPUT A, B // inputs the two numbers from the user. It could be split into two separate input lines
each inputting only one variable

ZA+B // Add the two numbers and call the answer Z

PRINT Z // output the answer Z on the screen

Page | 5 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.3.2 Flowcharts

It is a diagrammatic way of representing an algorithm, it consists of symbols, connected to each


other by arrows which indicate the path to be followed when working through the flowchart.
Each different shape symbol represents a different stage in the process.

Below is the list of the more common shapes/symbols:

If we would like to draw a flowchart to solve Problem 1, it would look like this:

Page | 6 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.4 Conditional Branching

This is sometimes referred to as selection. Conditional branching means that certain statements
are carried out depending on the value stored within a particular variable name. There are
generally considered to be two types, which are IF…THEN…ELSE and CASE…ENDCASE.

4.4.1 IF … THEN … ELSE

Syntax of IF statements in pseudocode:

Sometimes, IF statements do not have an ELSE part, such as in this sequence of instructions:

➢ It is important to note that IF statements are always slightly indented

Page | 7 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Example 1:

Design an algorithm, using pseudo-code and flowchart, which takes a number as input and outputs
whether the number is zero or non-zero.

Pseudocode Solution:

PRINT “Enter a number”

INPUT num

IF num=0

THEN

PRINT “The number is zero”

ELSE

PRINT “The number is non-zero”

ENDIF

Flowchart Solution:

Page | 8 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Validation

Often, we need to check that the user has not entered unacceptable data, take the example of
dividing two numbers, you cannot divide by zero. So, we have to anticipate mistakes users might do,
this is called Validation.

Example 2:

Design an algorithm, using pseudo-code and flowchart, which reads two numbers from the user and
divide them by each other, then print out the answer.

Pseudocode Solution:

PRINT “Enter the two numbers”

INPUT Num1, Num2

IF Num2=0

THEN

PRINT “MATH ERROR”

ELSE

Result  Num1 / Num2

PRINT “The result of the division is: “, Result

ENDIF

Flowchart Solution:

Page | 9 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
If with multiple Conditions

Sometimes you might have to check for more than one condition before taking an action, here
we use the keywords AND, OR

Example 3:

Design an algorithm, using pseudo-code and flowchart, which takes a number and prints “In range” if
the number is between 1 and 10 inclusive, otherwise the program outputs “Outside range”.

Pseudocode Solution:

PRINT “Enter a number”

INPUT Num

IF Num >= 1 AND Num <= 10

THEN

PRINT “In range”

ELSE

PRINT “Outside range”

ENDIF

Flowchart Solution:

Page | 10 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Nested If

Example 4:

Design a program, using pseudocode and flowchart, which takes marks in an exam as input and
outputs the grade according to the following grade boundaries:

Pseudocode Solution:

PRINT “Enter the mark”


INPUT Mark
IF Mark > 100 OR Mark < 0
THEN
PRINT “Invalid Mark”
ELSE
IF Mark >= 90
THEN
PRINT “A”
ELSE
IF Mark >= 80
THEN
PRINT “B”
ELSE
IF Mark >= 70
THEN
PRINT “C”
ELSE
PRINT “F”
ENDIF
ENDIF
ENDIF
ENDIF

Page | 11 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Flowchart Solution:

Page | 12 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.4.2 CASE … ENDCASE

Syntax of CASE statements in pseudocode:

The OTHERWISE case must always be the last case statement.


Example 5:

Design an algorithm, using pseudo-code and flowchart, which takes a course number as input and
outputs the corresponding course name according to this table:

Pseudocode Solution:

PRINT “Enter the course number”

INPUT CourseNo

CASE CourseNo OF

1: PRINT “Computer Science”

2: PRINT “ICT”

3: PRINT “Math”

4: PRINT “Biology”

OTHERWISE: PRINT “Invalid Course Number”

ENDCASE

Page | 13 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Flowchart Solution:

Page | 14 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Example 6:

Write pseudocode that takes two numbers as input and performs any of the basic operation (+, -, *, /)
as per the user’s input.

Pseudocode Solution:

PRINT “Enter the two numbers”

INPUT Num1, Num2

PRINT “Enter the arithmetic operation”

INPUT Oper

CASE Oper OF

“+”: Result  Num1 + Num2

PRINT “The result of the addition is: ”, Result

“-“: Result  Num1 - Num2

PRINT “The result of the subtraction is: ”, Result

“*”: Result  Num1 * Num2

PRINT “The result of the multiplication is: ”, Result

“/”: IF Num2 = 0

THEN

PRINT “MATH ERROR; Division by zero”

ELSE

Result  Num1 / Num2

PRINT “The result of the division is: ”, Result

ENDIF

OTHERWISE: PRINT “Invalid Operation”

ENDCASE

Page | 15 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.5 Loops

A loop is a sequence of repeated statements that are carried out several times. Its purpose is to
avoid repetition and redundancy in the code and accordingly produces shorter and more
precise algorithms.

4.5.1 WHILE … ENDWHILE

A loop that iterates whilst a specified condition exists. Criteria is pre-tested (It has criteria
check at the start). It may never run

Syntax of WHILE…ENDWHILE statements in pseudocode:

Example 1:

Design an algorithm, using pseudo-code and flowchart, that will read the side length of a square
and displays its area.

Area = side * side

Display an error message if the side length is negative.

Pseudocode Solution:

PRINT “Enter the side length of the square”

INPUT side

WHILE side < 0

PRINT “Invalid side length, try again”

INPUT side

ENDWHILE

Area  side * side

PRINT “Area = “, Area

Page | 16 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Flowchart Solution:

Counting

If a loop is to be repeated a certain number of times, it is usual to set up a counter. This usually
involves the initializing of a variable (setting it to 0). The variable name used is often just ‘count’.
It is quite common for the first statement in any algorithm to be:

This count is then incremented (increased by 1) every time a sequence of statements is carried
out.

Page | 17 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Example 2:

Design an algorithm, using pseudo-code and flowchart, which takes a mark from the user and
validates that mark. Quiz is out of 100. Count and display how many times the user entered invalid
data

Pseudocode Solution:

countInvalid  0

PRINT “Enter the mark”

INPUT mark

WHILE mark < 0 OR mark > 100

PRINT “Invalid mark, try again”

countInvalid  countInvalid + 1

INPUT mark
ENDWHILE
PRINT “Number of Invalid Entries: “, countInvalid

Flowchart Solution:

Page | 18 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.5.2 REPEAT … UNTIL

A loop that iterates until a condition is met. Criteria is post-tested (It has criteria check at the
end). It iterates at least once

Syntax of REPEAT…UNTIL statements in pseudocode:

Example 3:

Design an algorithm, using pseudo-code and flowchart, which takes from the user a radius and the
program outputs the circumference

Circumference = 2 * π * Radius

Pseudocode Solution:

REPEAT

PRINT “Enter the radius”

INPUT radius

IF radius < 0
THEN
PRINT “Invalid radius, try again”
ENDIF
UNTIL radius > 0
Circ  2 * 3.14 * radius
PRINT “Circumference = “, Circ

Page | 19 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Flowchart Solution:

Differences between REPEAT ... UNTIL and WHILE ... ENDWHILE:

• In WHILE the criteria is pre-tested but in REPEAT the criteria is post-tested


• WHILE may never run while REPEAT runs at least once
• WHILE iterates whilst a condition is TRUE but REPEAT iterates till a condition is TRUE

Page | 20 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.5.3 Nested Loops

Example 4:

Design an algorithm, using pseudo-code and flowchart, that prints out the multiplication tables from
1 to 12, each table should go up to the multiplication by 6. The output should look like this:

Pseudocode Solution: Using WHILE … ENDWHILE

count1  1

count2  1

WHILE count1 <= 12

WHILE count2 <= 6

PRINT count1, “ x ”, count2, “ = “, count1*count2

count2  count2 + 1 // increment counter2 to have different multiples of the same table

ENDWHILE

count2  1 // reset counter2 to start the new table multiplying by 1 and to renter the second loop

count1  count1 + 1 // increment counter1 to start a new table

ENDWHILE

Page | 21 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Flowchart Solution:

Pseudocode Solution: Using REPEAT … UNTIL

count1  1

count2  1

REPEAT

REPEAT

PRINT count1, “ x ”, count2, “ = “, count1*count2

count2  count2 + 1 // increment counter2 to have different multiples of the same table

UNTIL count2 > 6

count2  1 // reset counter2 to start the new table multiplying by 1 and to renter the second loop

count1  count1 + 1 // increment counter1 to start a new table

UNTIL count1 > 12

Note: Don’t forget the ENDWHILE for each WHILE statement while writing your nested loop,
and make sure they are correctly indented

Page | 22 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.6 Procedures/Subroutines

When writing algorithms, it is often good practice to use subroutines, which are sometimes
called procedures. A subroutine is a sequence of algorithm statements that perform a specific
task. This subroutine can then be called in other algorithms when needed.

Syntax of Procedures in pseudocode:

Example:

Design an algorithm, using pseudo-code and flowchart, which calculates and prints the average of 3
numbers inputted by the user; use a subroutine called avg

Pseudocode Solution:

PROCEDURE avg(n1, n2, n3)

average  (n1 + n2 + n3) / 3

PRINT average

ENDPROCEDURE

INPUT num1, num2, num3

CALL avg(num1, num2, num3)

Notes:

➢ Don’t forget to write the “CALL” keyword before calling your function
➢ Variable names used in the procedure declaration should not always be the
same as the ones used when calling the procedure
➢ A procedure can be called anywhere in your algorithm (inside an if statement, a
loop, … etc.)
➢ You could call a procedure by sending values not variables; in our example we
could call the procedure like this: CALL avg(45, 78, 56)

Page | 23 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Flowchart Solution:

Page | 24 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts

4.7 File Handling

Master and Transaction files

A master file would be used together with a transaction file in most batch processing
applications, including a computerized customer orders system. Before these two files can be
processed together to produce a payroll, the transaction file needs to be sorted in the same
order as the master file and will also need to be checked for errors using validation checks.

Example of updating a master file using a transaction file:

The three types of transaction involved in updating a master file in this scenario

➢ C: change or ammend an existing record


➢ D: delete a record
➢ A: add a new record

Transaction File

Old Master File

New Master File

Page | 25 Eng. Hossam Badawy


Chapter 4 Algorithms and flowcharts
Algorithm used to process the files:

Note: This is not the exact way of how to write file handling algorithms using pseudocode, they
are outside the scope of this course. What you need to understand is the idea of how file
handling works.

Page | 26 Eng. Hossam Badawy


Chapter 5
e-Security
Chapter 5 e-Security

5.1 Personal Data


Any data that can be used to identify or recognize somebody is classed as personal data. Not
only that, any data which can be reconstructed so that it does enable an individual to be
identified can also be classed as personal data. So, even if personal data has been de-identified,
encrypted or pseudonymised, it is still classed as personal data.

• De-Identification: is a common strategy when trying to prevent a person’s identity from


being revealed. Items of personal data might be removed from a record, such as the
individual’s name. But if the person could still be recognised from the remaining data it
would be possible to re-identify the data and add the removed data back which would
be the name in that case.

• Encryption: Covered in Chapter 1; it is used to make data unidentifiable. However, the


problem with encryption is that data can be decrypted and so become personal data
again.

• Pseudonymised Data: Is when, instead of removing the personal items of data, they are
replaced with a temporary ID. The problem is that if, similar to de-identification,
somebody can recognise that individual from the rest of the record, they can replace the
ID with the individual’s name.

Examples of Personal Data:

o a name and surname


o a home address
o an email address
o an identification card number
o location data (for example from the location data function on a mobile phone)
o an IP address
o a cookie ID
o the advertising identifier of your phone
o data held by a hospital or doctor, which could be a symbol that uniquely
identifies a person.

5.1.1 Keeping personal data confidential


Why do we need to keep data confidential?

• Identity Theft: is when a fraudster pretends to be another individual online by using that
individual’s personal information.
o The Fraudster can access the individual’s bank account to withdraw/transfer
money to their own accounts
o They could also commit other types of fraud/crime under the individual’s name

• If burglars obtain personal data such as addresses and information about when a person
is at work, then they can burgle that person’s house. Therefore, people should not post
information about their holiday or vacation plans on social media.

Page | 2 Eng. Hossam Badawy


Chapter 5 e-Security
How to keep data confidential?

• Not putting too much personal data on social media.


• Disable the geotag feature from their photos and videos which indicates the address
from which they were taken
• Ensuring that you share your information only with trusted and reliable organizations
• When organizations pass on information they should:
o Ask for the user’s authorization
o Anonymise information. In its simplest form, by simply not mentioning a person
by name
o Aggregated information. This is where the personal details of several people are
combined to provide information without individually identifying anybody.

5.1.2 Keeping personal data secure


There are several different precautions that can be taken in order to keep personal data secure.
Some of these are described below.

• Firewalls: Are designed to prevent unauthorised network access by examining data


coming into the network to see if it is allowable. It checks for the IP (internet protocol)
address of the sender and if it is not allowed, it blocks that traffic. It does not always work
as a hacker could physically steal a computer that is permitted to access the network.
Or they can use software which can change the IP address of their computer to one
which is acceptable to the firewall.

• Penetration testing: It’s when companies employ somebody to deliberately attack their
computer network. They do this so that the authorised ‘hacker’ will identify the
weaknesses in their system’s security and the company can then take measures to
improve it if necessary.

• Authentication techniques: When users are required to log on in order to identify


themselves to the system. It includes:

o Typing in a User ID and Password


o Inserting or swiping a Smart Card which belongs to the user
o Using Biometric Data which uniquely identifies a physical characteristic of a user;
this is considered to be the most secure method however it is quite expensive to
implement

In some cases, more than one authentication method is required to increase the data’s
security; in an ATM you require both a password and a card, and in online banking it
sometimes requires a password and other security questions. This is called twin-or two-
factor authentication

• Levels of access: Different groups of users can be granted different levels of access to
the data on the network. Allocating different access levels to different groups limits the
information that the different groups can see and the actions they are allowed to take.

• Network policies: are sets of rules that allow companies to choose who is allowed to
access their computer network and control their use of the network once they have
gained access. While this does not necessarily prevent hackers from outside the

Page | 3 Eng. Hossam Badawy


Chapter 5 e-Security
organisation attacking the network, it does help to limit what employees might be
tempted to do with personal data.

• Software updates: As soon as any major software company is made aware of


vulnerabilities (security weaknesses), they produce updates which eliminate that risk. So,
it is important for users to install updates as soon as possible in order to limit the amount
of time hackers have to find and exploit these weaknesses.

• Other Methods:
o Encryption
o Digital Certificates
o Remote Deletion: being able to delete the data remotely in case the device had
been physically stolen.

5.1.3 Preventing misuse of personal data


Pharming
Begins with a user downloading malicious software (malware) without realising they have done
so. This software then corrupts the hosts file (a basic text file which contains the name and the
IP address of several URLs) by changing the IP address of the bank’s URL for example to a fake
bank website of the hacker’s creation. The user then proceeds to type their bank details into this
fake website, giving the fraudster all the information he or she needs to access that user’s bank
account by logging on to the real bank.
Ways to avoid Pharming:
• Using up-to-date anti-virus software to prevent the downloading of software which
changes the hosts file.
• An up-to-date browser can cause an alert to be raised that a fake website has been
loaded.
• It is sensible to use a trusted, legitimate internet service provider (ISP).
• Digital certificates can be checked to make sure that the site is legitimate.
• Any site that requires the entry of personal data should begin with HTTPS.
• Check that the URL is indeed correct for that site.
• The actual fake website may have tell-tale signs such as poor grammar or spelling and
this should alert a user that it may be a fake site.

Phishing
Is when fraudsters try to obtain personal details such as usernames, passwords, and credit or
debit card details using email. The email often includes a link to a URL of a fake website inviting
the receiver to enter their personal data there. Such emails usually contain something that
instantly grabs the recipient’s attention and requires them to take immediate action. For
example, telling them they have won the lottery but need to send personal information in order
to claim the prize.
Ways to avoid Phishing:
• Use anti-phishing software; it identifies any content which could be interpreted as
phishing contained in websites or emails.
• Always have anti-virus and anti-spyware software running on a computer, and to
update it at regular intervals.
• Look for grammatical and/or spelling mistakes in such emails
• Users should never trust emails that come from people whose names they do not
recognise.

Page | 4 Eng. Hossam Badawy


Chapter 5 e-Security
• Delete any suspicious emails
• Remember that Reputable companies or organisations will never ask for personal
information to be sent by email
• If an email starts ‘Dear customer’ rather than using the receiver’s name, it should also be
treated with caution
• If the email contains a message that you won a great prize, it is probably fake
• Never click on the URLs attached in suspicious emails

Smishing
Is a variation of phishing. The major difference is that it uses SMS (text messages) rather than
email to send the message. The number of smishing attempts have increased since the
introduction of smartphones, as it is so easy to activate a link within a text message. Just as with
phishing, the main intention is to get the recipient to reveal their personal details.
Ways to avoid Smishing:
• Run mobile protection software on the smartphones
• Lookout for signs same as phishing; grammar or spelling mistakes, requiring immediate
action, offering a huge prize…etc.
• Check sender’s phone number against the company’s actual phone number
• Never type in banking or personal information unless using an organization’s official
website
• Do not click any links sent in such messages and do not phone call the number as well

Vishing
The word ‘vishing’ is a combination of the words ‘voice’ and ‘phishing’. As its name implies, it is
the practice of making a phone call in order to get someone to reveal their personal or banking
details. The fraudster may be calling claiming that he is from your bank and needs your details
for a check-up or that you won a certain prize and certain data is required to be able to receive
it.
Ways to avoid Vishing:
• Call the bank and ask if they sent out someone to collect such information
• Never give personal/bank information through the phone
• Remember that banks will never ask for pins/passwords
• Hang-up and block such callers
• Use a software that blocks such callers and keeps a file of all the blocked contacts for
all phone owners using the app; for example: TrueCaller

5.2 Malware
5.2.1 Types of malware
• Virus
o Attaches itself to another computer program
o Can replicate themselves, just like the real-life viruses
o Some types of viruses delete, corrupt or change the data on disk
o The computer affected with a virus may frequently crash and will have a slower
processing speed

Page | 5 Eng. Hossam Badawy


Chapter 5 e-Security
• Trojan Horse
o It enables the person who created it to take control of the computer it has
infected and retrieve the user’s personal information.
o Users are deceived by downloading a software which has the Trojan horse
attached to it
o Unlike computer viruses and worms, Trojans generally do not attempt to infect
other files or replicate themselves.

• Worm
o Are similar to viruses in that they replicate themselves
o Their main purpose is to occupy more and more disk space until the disk is full
and can no longer function.
o Standalone programs: they do not attach themselves to other programs or files
o They result in slowing down the traffic in a network

• Spyware
o Designed to collect information about a computer user’s activities without their
knowledge.
o A keylogger is often used, a type of spyware which works by collecting a record
of the user’s keystrokes
o Data such as web browsing habits, email messages, usernames and passwords,
and credit card information are passed to the hacker without the user having any
idea what is happening.

• Adware
o Its main purpose is to generate income for the originator or creator of the
software.
o It automatically generates unrequested advertisements
o It is regarded to be more annoying than dangerous
o There has been a tendency in recent times for the adware to be linked to
spyware.

• Rootkit
o Is designed to install a set of tools in a computer which allows the attacker to
have full administrative access to that computer continuously.
o These tools enable the attacker to discover the user’s personal details, such as
passwords.
o It is also capable of removing/manipulating the anti-virus software.

• Malicious Bots
o Like a worm, a malicious bot can replicate itself
o It is designed to gather information and feed back to a server; this is called a
botnet
o They are extremely difficult to detect on a computer

• Ransomware
o Blocks access to the user’s data until a ransom is paid.
o It encrypts the user’s files, and a payment is needed to provide the decryption
key

• Fileless
o Does not rely on files and leaves no evidence once it has been executed.
o It only resides in the main memory (RAM).

Page | 6 Eng. Hossam Badawy


Chapter 5 e-Security
• Scareware
o Tricks the computer user into thinking that their computer has been infected with
a virus.
o The user pays the fake provider and at the end it is a scam

5.2.2 How malware is used


There are several ways that malware can be used to carry out illegal activities.

• Fraud: to take or alter electronic data, or to gain unlawful use of a computer or system to
illegally benefit financially.
• Industrial Espionage: spying directed towards discovering the secrets of a rival
manufacturer or other industrial company
• Sabotage: when businesses, education establishments and other organisations are
attacked in order to disrupt their normal operations.

5.2.3 Consequences for organisations and individuals


• Impact on Organizations:
o Loss of data: As we’ve seen, many types of malware tend to corrupt or delete
existing files on the drive
o High costs: keeping an organisation safe from viruses is often very expensive, as
well as, hiring expertise to cope with such attacks on your system
o Loss of time: if a malware was able to a sabotage the system; to clean up the
computers from that malware takes a lot of time and hence cost
• Impact on Individuals:
o Hackers gain valuable information such as bank details, date of birth, email
address and passwords, which can then lead to identity fraud.
o Users can be losing money in scams such as scareware or ransomware
o Computer system is slowed down which may be inconvenient at times

5.2.4 Prevention of malware


• Use of up-to-date anti-virus software
• Ensure the presence of a firewall
• Companies should educate their employees on how to avoid malware in their day-to-
day engagement with the system
• Dedicated stand-alone virus-checking computers should be provided
• Old unneeded software is better to be removed

Page | 7 Eng. Hossam Badawy


Chapter 6
The Digital Divide
Chapter 6 The digital divide

6.1 What is the digital divide?


The term digital divide relates to the gap between those people who are able to access
modern technology and information and those with restricted or no access.

6.2 Causes and effects of the digital divide


 Geography

o Less economically developed countries cannot afford to build effective


infrastructure.

o People within the same country are wealthier than others so wealthier people
have greater access to IT technologies.

o Some locations are very difficult to provide internet connections to them like
people living in the mountains or deserts.

o Rural areas tend to have poor infrastructure because internet provides always
seek higher density regions to serve.

 Fear of IT

o Lack of education and knowledge can lead to fear of using technology as it


becomes sophisticated by days.

o Older people are less likely to be familiar with technology.

 Economics

o Technology keeps updating by time and every update is more expensive than its
predecessor. People who are better paid can have the new technology easily and
on the other hand poorer people will get basic level of technology which are less
likely to increase their IT skill and widening the divide.

 Disability

o Technology are usually made without or with a little consideration for disabled
people leading to a large number of people cannot use technology normally.

Page |2 Eng. Hossam Badawy


Chapter 6 The digital divide

6.3 Groups affected by the digital divide

 People in cities and people in rural areas

o Low populations of rural areas leads to fewer distant houses that needs
infrastructure installation, unlike urban areas all the houses are close to each
other, so longer cables have to be used, which means slower speeds.

o Challenging geographical features leads to a poor internet connection, because


there are people living in the mountains, deserts or forests and high internet
speeds needs a high end infrastructure, which will be hard to be built as it will
cost too much. Broadband companies won’t invest such cost for very few
customers.

o Limited commercial potential for broadband companies because rural areas


have low potential customers because of their low population so they tend to
invest more in higher density areas like cities.

o Alternatives for rural areas like satellite connections, radio communications and
mobile networks can be used to access internet connections but weather and
radio towers availability can affect their qualities and speeds.

 More and less industrially developed or technologically aware nations

o Investments in more important aspects like health, education and job


opportunities rather than investing in better technology because they cannot
afford to invest in technology beside these aspects.

o Online shopping gets few to no opportunities for suppliers and customers in less
industrially developed countries as some of the countries does not have names
for their streets making it difficult to deliver parcels. Also, a big part of the
population does not have bank accounts to use online payments. Moreover,
some countries does not implicate consumer-protection laws over online
purchased goods.

o Trading between countries can be affected when no internet connections are


available.

Page |3 Eng. Hossam Badawy


Chapter 6 The digital divide

 The educated and the uneducated

o Uneducated people tend to work in a low-paying job making it less likely for
them to afford high tech.

o Schools that have better technologies in IT equipment and internet speeds and
use of IT in the curriculum leads to differences between schools.

 The old and the young

o Older generations were not exposed to the technology like young people so fear
is developed.

o Older generations tends to focus on friendships and be emotionally healthy


rather than using the latest technologies.

o Technology companies tend to make new updates to their technology


concentrating on young people rather than older people.

o Older people are slower at accepting new technologies and tend to use older
technologies.

 Socioeconomic groups ( rich and poor people )

o Technology companies tend to sell high end technologies with high prices to
maximize their profits, this will serve rich people only leaving poor people with
old and basic technologies and they will not get a chance to get better IT skills.

o As household income increase the better the broadband connection it is and the
technologies used in home unlike poorer homes which will prefer to pay for their
everyday essentials first.

 People with disabilities

o Technologies that serve disabled people may be expensive to buy.

o Technologies nowadays relies on touchscreens, mouse and keyboards which are


hard to use.

o Hearing and visual impairments lack the access to personal devices and internet.

Page |4 Eng. Hossam Badawy


Chapter 6 The digital divide

6.4 Effects of the digital divide

 Health

o There are now websites that have medicine and treatment information, booking a
doctor appointment and hospitals can have their records online for the patients to
see but some people cannot afford to buy equipment like PCs or Laptops or
broadband connection to benefit from these or hospitals cannot afford to install
this tech or even doctors living in rural areas with no broadband connection won’t
be able to access the patients online records.

 Education

o Students nowadays need to be aware of accessing web based courses, use


online resources, download notes and presentations and upload assignments.
Students who are unable to perform these tasks will find their progress severely
limited.

 Job opportunities

o Jobs nowadays require IT skills as a necessity so people without such skills won’t
find a job.

o Companies now can offer jobs and recruit employees online and people without
internet connection won’t hear anything about it.

 Social interaction

o Online social interaction increased nowadays because of social networking


websites but this can create social divide because some people lack the
knowledge or the equipment to use such websites.

 Other uses of the internet

o Online booking systems for holidays or even trips by any mean of transportation
became normalized so if someone can’t access technology for any reason will
end up paying a lot more than booking in advance or even not finding the options
needed.

o Online banking is usually used through smart phones, people who cannot afford
to buy smart phones will be disadvantaged as many banks are relying only on
online banking in some regions.

o Online shopping made it difficult for physical stores to make profit as more
people are buying online and online shopping is more convenient as people can
shop at any time and any place and the prices tend to be cheaper.

o Access to news is restricted to people who have access to the internet as


newspapers are shifting to online.

Page |5 Eng. Hossam Badawy


Chapter 6 The digital divide

o Government websites can ease the governmental processes for its population,
people with no access to internet may need to travel big distances or waste a lot
of time finishing these processes physically.

6.5 Reducing the effects of digital divide

 Enable faster and cheaper access to internet.

 Developing digital skills courses

 Partnership between governments, education providers, private sector and IT experts to


provide better technologies for rural areas and schools.

 PLC cables ( Power Line Communication ) which enables internet to travel through
electricity cables.

 Technologies suited more for disabled people.

 Teaching programs for older people.

 Release cheap PCs to school-age children.

 Cyber cafes in rural areas.

Page |6 Eng. Hossam Badawy


Chapter 7
Expert Systems
Chapter 7 Expert systems

7.1 What is an Expert System


Expert systems are computer-based systems used to solve problems, such as providing a
diagnosis of something. They make use of the knowledge of several human experts within a
specific field.

➢ Expert systems are not like most problem-solving programs.


• In expert systems, they use reasoning to produce possible solutions.
• For expert systems, all the knowledge of the experts is collected in the
knowledge base and they have a shell that interacts with it. If you need the
expert system to solve a different problem, you can only update the knowledge
base without adjusting the shell itself.
• Unlike problem-solving programs which are designed in a way to solve only one
specific problem

➢ The knowledge base which is often constructed by a knowledge engineer consists of


two components:
• Database of facts: Information and facts collected from the experts about the
required subject
• Rules base: A set of IF…THEN rules that are used by the inference engine to be
able to perform the reasoning part of the system

Page |2 Eng. Hossam Badawy


Chapter 7 Expert systems

➢ The shell consists of 4 components:


• Inference engine: It performs the reasoning of an expert system. It uses a series
of IF…THEN statements within the rules base and interrogates the database of
facts in the knowledge base. In other words, it produces a set of possible
solutions comparing the inputs with the facts, using the rules contained in the
knowledge base.
• Explanation system: This is the part of the system which explains the logical
reasoning that the expert system has used to come to its conclusions. A good
expert system must be able to explain its reasoning and justify its
recommendations.
• Knowledge base editor: A software that allows the knowledge engineer to edit
the rules and facts within the knowledge base to bring them up to date.
• User Interface: this is the component that allows the user to interact with the
computer which stores the expert system.

7.2 Different scenarios where expert systems are used


Mineral prospecting
Helps in making decisions on where to drill for a specific mineral.
• Knowledge Base: Models of successful drilling sites and their associated minerals
• Input:
o Data about the types of rocks and geological structure
o The minerals to be found at the site under consideration
• Output: Probabilities of minerals being found in particular locations.

Investment analysis
Acts as assistants to financial advisors at many banks. The advisor has the final say, but they
often use such systems to help them in their decision.
• Knowledge base: Information the bank gathered about the performance /stability of
different companies.
• Input:
o The amount the investors wish to invest
o What level of risk they are willing to take
o The desired rate of return
o How long they are willing to make the investment for.
• Output: Recommendations for purchasing stocks or shares in a company

Page |3 Eng. Hossam Badawy


Chapter 7 Expert systems

Financial planning
Personal financial planning has become so complex that it is extremely difficult for one human
expert to deal with it. Computerized expert systems come to assist in the process.
• Knowledge base:
o Results of books and articles relating to personal financial planning
o Information from interviews with experts, such as professional financial advisors
• Input: User fills a questionnaire about their personal and economic situation including:
o Income
o Taxes paid or due
o Investments
o Employee benefits
o Marital status / number of dependents
o Future obligations such as retirement plans or funding their children’s university
education
• Output: The systems may recommend one or more of the following:
o How to manage debts
o How to reduce the amount of income tax they pay
o Ways to organize investments
o Recommend the amount of insurance individuals should have
o How they should plan for their retirement
o Suggest short-term personal saving targets

Medical diagnosis
Helps medical practitioners diagnose illness
• Knowledge base: Interviews with expert doctors
• Input: Symptoms
• Output: A list of possible diagnoses of illness/diseases

Plant and animal identification


Identification has proven to be difficult especially with rare species, additional tools are needed.
• Knowledge base: Data regarding all knowledge about as many species as possible
• Input: Characteristics of the plant/animal under investigation
• Output: A list of possible species

Page |4 Eng. Hossam Badawy


Chapter 7 Expert systems

Route scheduling for delivery vehicles


For most manufacturing companies, the cost of transport is a major part of their outgoings. It
could be difficult to develop an expert system to solve such problem since companies may
have:
o Several vehicles of different sizes, each of them available at different times
o Several distribution points
o Different ways to load the packages on the vehicle to avoid unnecessary unloading
upon arrival
• Knowledge base:
o Locations of each distribution point
o Type and speed of the vehicle being used
o The total available time
o Other constraints such as the topology or terrain of each road, whether it is
mountainous or flat for example.
• Input: The orders of the day in details
• Output: Suggest an allocation of orders to each vehicle and suggest a list of machines in
reverse order so that each vehicle had the first order loaded on to the vehicle last.

Car engine fault diagnosis


Modern-day mechanics use expert systems to help them diagnose the fault in a car.
• Knowledge base: Knowledge and rules from expert mechanics
• Input: The problem in the car and its symptoms
• Output: A list of possible causes of the problem, and it’s up to the mechanic to decide
which is the most likely cause

Insurance planning
Expert systems are frequently used to assess the risk of insurances
• Knowledge base: Insurance experts would be interviewed and all the policies that the
underwriter currently offers would be examined. The results would then be used to
create the knowledge base
• Input: Depending on the type of insurance, if life insurance for example it would input
data about the client such as age, medical health status, gender, …etc.
• Output: a recommendation for the cost of the individual’s premium. It may, of course,
recommend that the application be rejected.

Page |5 Eng. Hossam Badawy


Chapter 7 Expert systems

7.3 Chaining
7.3.1 Backward chaining
Backward chaining is often referred to as goal-driven. This is because it starts with a goal or set
of goals that basically establish which rules are to be followed. When an inference engine uses
backward chaining, it explores the rules the system has been given until it finds one which has a
THEN part that matches a required goal. If the IF part of that rule is known to be true, then it is
added to the list of goals.

➢ Step 1: ‘Edwina’ replaces X in Rule 3 to see if its conclusion matches the goal, so Rule 3
becomes: IF Edwina is a zebra, THEN Edwina has a striped coat.
➢ We now need to see if the premise – Edwina is a zebra – can be proved.
➢ Step 2: Again, replacing X with ‘Edwina’, in Rule 1, the rule becomes: IF Edwina has
hooves and can run fast, THEN Edwina is a zebra.
➢ The inference engine now needs to see if the premise – Edwina has hooves and
can run fast – can be proved; these two facts were already given at the start of the
problem
➢ It follows that the premise of Rule 3 is true, and the conclusion must be true: Edwina has
a striped coat.

Page |6 Eng. Hossam Badawy


Chapter 7 Expert systems

7.3.2 Forward chaining


Forward chaining is often referred to as data-driven because the data entered into the system
determines which rules are selected and used. When an inference engine uses forward
chaining, it explores the rules the system has been given until it finds one which has an IF part
that is true. It takes the THEN part to add new facts. This process is repeated until a goal is
achieved.

➢ Step 1: Since the facts we are given show that Edwina has hooves and Edwina can run
fast, the premise of Rule 1 is matched by replacing X with ‘Edwina’ (IF Edwina has hooves
and can run fast). The inference engine concludes: Edwina is a zebra.
➢ Step 2: We can now use Rule 3 by replacing X with ‘Edwina’ (IF Edwina is a zebra). The
inference engine concludes: Edwina has a striped coat.
➢ NOTE: The difference in approaches is that backward chaining starts with us having a
goal to achieve or an assertion we are trying to prove. We think Edwina has a striped
coat, but we need to prove it. With forward chaining we do not know what type of coat
Edwina has but we want to find out.

7.3.3 Applications of forward and backward chaining


➢ Diagnosis
o If you have clear hypotheses, backward chaining is likely to be a better solution.
o Forward chaining would be preferred if you have no clear hypothesis and want
to see what can be concluded from the current situation.

Page |7 Eng. Hossam Badawy


Chapter 7 Expert systems

➢ Gaming
o A good example of backward chaining in computer games is found in the game
of chess. In chess, there are a fixed number of moves to reach a winning position.
To compute all the possible ways of reaching a winning position, the system
chains backwards and builds up a list of possible ways to get to the winning
position.
o Selecting a weapon for non-player characters (NPCs) in a game is an example of
forward chaining. Data is inputted about the distance to the target, their strength,
and the range of the weapon for example. Then outputs which weapon should be
used.
➢ Artificial Intelligence (AI)
o An AI might use forward chaining to look at the available information, answer a
question or solve a problem
o Self-driving cars is a good example of backward chaining, its goal is to get from
A to B without crashing.

Page |8 Eng. Hossam Badawy

You might also like