Unit - III FIT Notes (Data Science)
Unit - III FIT Notes (Data Science)
Chapter -I
Computer Networks
1.1 Introduction
A computer Network , simply referred to as a network, is a collection of computers and devices
interconnected to facilitate sharing resources such as printer, information and electronic documents.
1.2 Types of Network :
Networks are broadly classified into three types. These Networks are categorized on the
geographical area that they cover .
1. Local Area Network (LAN) or Simply LAN
2. Metropolitan Area Network (MAN) or Simply MAN
3. Wide Area Network (WAN) or Simply WAN
➢ Whenever a computer wants a send data to another computer , it places the data in its NIC.
It also specifies where the data is to be delivered. The NIC informs the CPU of the arrival of
the data and data is moved to the computer’s memory and later CPU attends to the data
received from its NIC.
1
➢ NICs of Every Computers are connected to another specialized computer , called a switch.
Modern Switches can interconnect large number of computers.
➢ Using More Switches we can Interconnect tens of thousands of computers in the same LAN .
2
1.2.3 Wide Area Network
As indicated by the name , When the geographical area to be spanned by the network is a whole
country, then it is called Wide Area Network (WAN). Worldwide connection of computers may also
be called a Wide Area Network.
3
Private WANs are maintained by some big banks such as State Bank of India . Railways also maintain
their own Wide area network for reservation system.
When an organization’s network is connected to a public network, a filter is placed between the
organization’s LAN and a device called a router which connects it to the public switched network,
this filter is called a firewall.
Firewall can prevent unauthorized persons from accessing the data of the company. Firewall can
block access to certain undesirable sites such as pornography, games, etc by employees.
1.3 Applications of LAN
The major reasons for connecting computers to a LAN are :
a) Sharing of files :
The key benefit of a computer network is users can share files, and to access files that are stored
in remote computer. The users can sit at their computer and easily access files stored on other
computer that are connected to the same network.
b) Sharing of resources :
Computer Networks facilitate the users to share limited and otherwise expensive resources
among a number of computing devices.
For example, in computer Lab, there may be 50 computers only one or two printers. In order to
allow every computer to use the printer, Connect all the computers and printers in the lab via a
network, so that every computer has access to the printer.
c) Increased Storage capacity :
Attaching a number of computers to the network enables sharing of files. Files stored on one
computer can easily be accessed by another computer.
4
d) Exchanging messages between users :
Using a Network ,users can communicate efficiently and easily through electronic mail (e-mail)
and instant messaging. Users connected to LAN send messages to a smaller group of users ( is
called Multicasting)
e) Sharing expensive software :
The software packages available in the market are costly and take time for installation. Software
to be stored or installed on one computer, which can be shared among other computers
connected on the same network.
Example 1:
The colour laser printer is connected to the server . A PC user who wants to print a file using the
colour print is called a client.
A Client can send the file to the server (Print Server ) and give a command to print. The server may
have received many such requests. It Queues up all the requests and attend to them one by one
and prints the files.
5
Example 2:
Many departments have an email server. All emails received by the users of the departments are
stored in the email server.
One advantage of a server is that it can be provided special software to scan all emails for viruses
and remove them and filter out unwanted emails called spam.
Example 3:
Banks use a server to store all data of their account holders such as their unique account number ,
name(s) of holder(s), addresses, credits, debits, current balance, etc.
Each client PC is given access privileges depending on their legitimate requirements.
Example 4:
Rail/bus booking is another example of client-server computing. The large number of terminals with
reservation clerks at the counters are all connected to a server.
Clerk accept the request from passengers and will check the booking details in system that is
connected to server.
1.3.2 Peer-to-Peer Computing
In client-server computing the relationship between a client and server is asymmetric, in which
some computers have higher capabilities (called server ) than others (clients).
Peer-to-Peer or P2P network is a type of network in which each computer has the same capabilities
and responsibilities. In this network there is no distinction between computers connected to a LAN
as a server or as a client.
6
Example 1: File Sharing
An interesting example is sharing MP3 music files. Each user connected to a LAN who is willing to
share music files can keep a directory of these files in his / her computer.
Any other computer in the LAN can examine all these directories and download music files they
want to their own disk from any of the computers. Such a method was popularized by a service
called Napster.
Technically this method works well but there are legal issues of copyright of music , confidential
files, etc.
Example 2: Sharing CPU resources
Users of a LAN can cooperate and allow a user to send and run a job requiring lot of CPU time. All
computers are peers, anyone can initiate compute-intensive job and distribute it.
1.3.3 Link Technologies used to build Networks
There are two major methods of connecting computers as a LAN. They are called Ethernet and
token ring.
Ethernet :
• Ethernet , invented in the 1970s , was designed as a shared bus connecting computers.
• Each computer or device on an Ethernet has an Ethernet NIC and is connected to a common
shared medium.
• Ethernet is an example of a broadcast medium. In such media can transmit at the same time
will encounter a collision and neither-transmission will be received successfully by the
intended receivers.
7
16 Computers C1, C2,…….., C16 are connected as a LAN using a switch. If C1 wants to send data to
C4, it will attach the data to some other fields, the most important ones being the sender’s address
and receiver’s address, we will call this a message.
A SWITCH can send and receive data from an NIC at the same time this is called full duplex
communication.
A SWITCH can send and receive data from NIC at the different times this is called half duplex
communication.
Token Ring :
In a token ring, computers are inter-connected to form a ring . A small pocket called a token (a
small bit string with specified unique format) is circulated in the ring.
For example, Computer C3 wants to send a message to another computer C12 . The NIC of C3 ( NIC3)
waits for the token. When it gets the token, it attaches the message to it with address C12 and puts
it back on the ring.
Each NIC examines the token to see if it is free token or has a message addressed to it. If it is a
message addressed to it, it detaches the message from the token and puts back the token in the ring
with an acknowledgement of safe receipt to the sender. One message can be circulated in the ring
at a time.
WI-FI :
The term Wi-Fi is a contraction of "wireless fidelity" and commonly used to refer to wireless
networking technology. Wi-Fi is used to connect laptops, tablets, smartphones and other devices to
the internet. Wi-Fi allows high-speed Internet connections without the use of cables.
8
Laptops, tablets, smartphones incorporates in their motherboards a WNIC (Wireless Network
Interface Card) which is similar to NIC of desktop computers with added wireless transmitter and
receiver.
There are several standards for wireless communication IEEE 802.11 b/g is popular as it provides
communication speed up to 54 Mbps.
The range of the Wi-Fi is depended upon the environment, indoor or outdoor ranges. The Wi-Fi cards
will read the signals and create an internet connection between the user and the network. The speed
of the device using Wi-Fi connection increases as the computer gets closer to the main source and
the speed is decreased the computer gets further away.
An area with an accessible wireless network is called a Wi-Fi hotspot. Wi-Fi hot spots are now
common place in airports ,hotels , cafes and other public areas in several cities, allowing mobile
computers to connect to the internet.
1.4 Internet
• The Internet is a global network that connects billions of computers all over the world. It is
network of networks.
• The Internet links different organizations, academic institutions , government offices, and
home users to share information among a large group of users. Each computer on the internet
is called a host.
• To Connect to the Internet, the user must gain access through a commercial Internet Service
Provider (ISP) . The common set of rules is called a protocol. TCP/IP (Transmission Control
Protocol / Internet Protocol ) is the protocol used by the Internet.
1.4.1 IP Address
• IP Stands for Internet Protocol, IP is an important role in the internet. Every Computer /
Device in the Computer network is identified with the help of IP Address.
9
• The Network Interface Card (NIC) of every computer / Device (including routers) that wants
to send or receive messages on the internet must have at least one address, this address is
called an IP address.
• IP address is 32 bits long (4 bytes) .It is expressed in a dotted decimal form such as
209.212.145.102, where each number separated by a dot in the decimal equivalent a byte
( range from 0 to 255).
• A String of text (names ) that maps/associates to numeric IP address on the Internet, these
names are called Domain Names.
• IP addresses are assigned dynamically by an International agency called Internet Assigned
Numbers Authority (IANA).
1.4.2 Connecting PCs/ LANs to Telephone Lines
• Home computers are normally connected to ISPs using telephone lines or cables. As telephone
lines are intended for voice communication and computer process bit strings.
• A pair of devices called modems ( modulator / demodulator) are used to connect a home PC
to a telephone line and the telephone line to the server of ISP.
• Modulator converts 1s and 0s to two different audio tones and demodulator converts audio
tones back to 1s and 0s.
10
1.4.2 IP Packet
• Data transmission on the Internet is done as a sequence of packets. A message to be
transmitted from computer to the ISP’s Server, message is divided into chunks of bits called
datagrams or IP packets. IP Software breaks up application data into IP Packets.
• Files of data to be transmitted via the Internet are broken into packet with around 1000 bytes
of data in each packet.
• Each packet has a serial number ,IP addresses of sender and receiver and error control bits to
detect errors in transmission (if any) and most importantly a chunk of data to be sent by the
application called the payload
.
• The Essentials of the IP Packet Format are
12
1.4.5 Difference between TCP and UDP protocols / TCP Vs UDP
TCP UDP
It is Connection-Oriented Protocol It is connectionless protocol
It is reliable protocol ,as it guarantees delivery It is unreliable protocol ,as it does not
of all packets from source to destination guarantee delivery of all packets from source
to destination
The Speed of TCP is slower The speed of UDP is faster
TCP does error checking and also makes error UDP performs error checking, but it discards
recovery erroneous packets.
TCP has acknowledgment segments UDP does not have any acknowledgment
segment.
TCP uses handshake protocol ( so UDP uses no handshake protocols ( so
connection oriented protocol) connectionless protocol)
13
1.4.6 Future of Internet Technology
• The Internet is growing so fast that the32 bits provided for address in the current version
of Internet Protocol IPv4 will be insufficient soon. Thus, a new protocol IPv6 has been
standardized.
• IPv6 provides 128 bits for addresses; it has packet lengths up to 64 KB, provides facilities
for transmitting multimedia data. And has built in security features.
14
Chapter -II
Input Output Devices
2. Display Devices :-
• Display devices are used for the visual presentation of information. Display systems are
mostly called a Video monitor or Video display unit (VDU).
• The Monitor is a output device used to display video and graphics information generated by
the computer through the video card.
• Computer monitors are similar to television screens but they display information in high
quality.
• The most common display units were Cathode Ray Tube (CRT) displays. They are now
hardly used as they are bulky and consume too much power.
• Currently the most popular display unit is a Liquid Crystal Display (LCD), also known as a flat
panel display.
2.1 Liquid Crystal Display : -
• An LCD Monitor is a thin, flat , electronic visual display unit.
• LCD Screens are used in a wide range of applications ranging from computer monitors,
televisions, instrument panels, telephones, gaming devices, clocks ,etc.
• LCD technology is based on the principle of blocking light.
• LCD uses the light-modulating properties of liquid crystals combined with polarizers.
• An LCD Monitors consisting of two polarizing filters( Vertical polarized filter & Horizontal
polarized filter) that contain a liquid crystal material between them.
• Liquid crystals do not emit light directly, instead using a backlight or reflector to produce
images in color or monochrome.
• An LCD has backlight that provides light to individual pixels arranged in a rectangular grid.
Each pixel has a red, green, and blue RGB sub-pixel that can be turned on or off. When all
the sub-pixels are turned off, it appears black. When all the sub-pixels are turned on 100%,
it appears white. By adjusting the individual levels of red, green, and blue light, millions of
color combinations are possible.
• LCD can be made up of two categories : active matrix technology & Passive matrix
technology.
Advantages:
• LCD monitors are very compact and lightweight.
• They consume less power and they are more reliable than CRTs
Disadvantages :
• They are more expensive than CRTs
• Required additional light source
• Images are not very clear when tried to view from an angle .
15
2.2 Touch Screen Display
• A mouse is used to point an icon on the screen and click to invoke a program
• Handheld computers ( tablet computers) are now becoming popular, they do not
have a separate keyboard.
• The keyboard is displayed on the screen of the display and by touching with a finger,
appropriate virtual keys data can be input, these are called touch screen displays.
• The position of an icon or a letter / digit touched on the screen should be sensed to send
the correct input to the processor. Position is sensed by printing on a liquid crystal display
a set of transparent electrodes parallel to the X-axis.
• An insulator is stuck over this grid. A grid of transparent electrodes parallel to Y-axis is
printed over this. Thus a grid of capacitors is created on the screen. The value of the
capacitance changes when the screen is touched because human body is a conductor.
The X-Y coordinator is used to identify the icon or the virtual key.
• The system will not work if a stylus used instead of a finger or if one wears gloves as these
will not conduct electricity and the capacitor value will not change.
• There is another technology used in touch screen called a resistive screen, in this case, a
conductor is printed over the screen. When it is touched with a stylus , the resistance
changes and this is used to detect the position where it is touched . It is not very accurate
and is used in cheaper devices.
• One advantage of resistive touch screen is touched with a stylus or a gloved finger.
2.3 E-INK Display
• E-Ink display is primarily used to display e-books. This display’s main advantage is that it
does not consume any power while it displays a page. Only when a new page is displayed
(i.e., when a page is flipped to a new page). Another advantage is easy readability. Its
reading comfort is almost like that of printed paper.
• An E Ink display works with the help of microcapsules, which are almost the width of a
human hair, packing positively charged white particles and negatively charged black
particles. These are suspended in a liquid inside a film layer. So when the negative current
is passed through, the white particles rise to the display, and when the positive current
passes, the black particles rise. This controlled passage of current creates a monochrome
display, which is energy-efficient and easy on the eyes. This is because this panel replicates
a paper by reflecting ambient light instead of using a backlight.
• Currently three popular e-book readers are Kindle marketed by Amazon, Nook Marketed
by Barnes and Noble and Kobo Reader.
16
• Typical e-book readers are light (around 300 g), easy to hold in the hand (19cm X 13.5 cm)
and with (600 X 800) pixel display.
• Books are downloaded using either wi-fi or mobile telecommunication system. They can
also be connected to PC.
2. 4 Printers :-
A printer is basically an output device which prints a hard copy of the electronic data that is stored
in the computer or any other devices. The electronic data may include documents, text, images or
even the combination of all three.
Printers can be broadly classified into two groups : impact and non-impact printers
Impact Printers : Dot Matrix and Line printers
Non-impact Printers : Inkjet printers and Laser Printers.
2.4.1 Inkjet Printers :-
• An Inkjet printer consists of a print head which has a number of small holes or nozzles .
Ink wells hold ink near the nozzles.
• Individual wells can be heated in few microseconds by an integrated circuit resistor. When
the resistor heats up, the ink near it is ejected through the nozzle and makes dots on
paper placed near the head.
• A high resolution inkjet printer has around 50 nozzles within height of 7mm and can print
with resolution of 300 dots per inch.
• Colour inkjet printers use three separate inkjets, colour names red, green, and blue. By
mixing appropriate combinations of these colours, all colours are created.
• The printing speed of inkjet printers is around 120 characters per second.
• Inkjet printers are inexpensive but the print cartridges are expensive. They may cost
almost half the prince of the printer.
17
2.4.2 Laser Printers :-
• A laser printer is non-impact printer that works at very high speeds and produces high-quality
text and graphics.
• Laser printer print one page at a time. The main component of a laser printer are a laser beam
source, a multi-sided mirror, a photoconductive drum and toner .
• Laser printers have a resolution of 600 dots/inch to 1200 dots/inch, depending on the cost of
the printer.
• The printer prints dots based on 0s and 1s in the bit mapped image to be printed.
• Laser printers produce very high quality output, because they form characters by very tiny ink
particles.
• Low speed laser printers can print 4 to 8 pages per minute. Very high speed laser printers can
print 500 to 1000 pages per minute. Because of their better print quality and printing speed
laser printers are more expensive than other printers.
• Colour laser printers are also available but cost per page is double of black and white.
2.4.3 Dot Matrix Printers :-
• Dot matrix printers are contact printers.
• Dot Matrix printer , prints characters and images of all types as a pattern of dots.
• A dot-matrix printer has a print head, which can move horizontally (left to right and right to
left )across the paper.
• The print head of a dot matrix printer consists of set of pins arranged vertically.
• To print a character ,the printer activities the appropriate set of pins as the print head moves
horizontally.
• Dot matrix printers normally slow and the speed of dot matrix printers varies in the range
of 50-50cps(characters per second).
• Dot-matrix printer use continuous paper rather than individual sheets.
• Dot matrix printer can only print lower resolution graphics , with limited quality.
2.4.4 Line Printers :-
• Line printer print an entire line at a time.
• Line printer can print 2500 lines per minute and these are used for heavy print jobs,
particularly by large computer called mainframe computers..
• Because of their high speed , line printer are widely used in data centers and in industrial
environments.
• Line printers are available to print many different scripts, for example, Devanagari, Arabic,
Urdu, and Japanese.
• Line printers are very expensive and shared by many computers in an organization.
18
2.5 Audio Output :
• Audio data stored as bits in computer, This data is reconverted into continuously varying
voltage by Digital to Analog converter (D/A converter or DAC).
• The loudspeaker outputs these voltages in the form of sound waves that we hear.
The sequence of steps followed to convert bits stored in memory to audio signal.
Step 1 : If bits are stored in compressed form (such as MP3), use appropriate software to expand it
to uncompressed that is original form.
Step 2: Convert each bit string to equivalent voltages using sampling technique , the output this
step we get a sequence of voltage 𝑣(0) , 𝑣(𝑡1 ), 𝑣(2𝑡1 ) , 𝑣(3𝑡1 ), 𝑣(4𝑡1 ) ………. 𝑣(𝑛𝑡1 ) ,
when 𝑡1 is the sampling interval.
19
Step 3: The sequence of discrete voltages is converted to a continuous voltage waveform 𝑣(𝑡) by
an electronic circuit called a filter.
Step 4: The continuous voltage waveform 𝑣(𝑡) is fed to a loudspeaker which emits sound waves.
Steps 2, 3, and 4 are performed by soundcard plugged into a PC’s mother board. The output of
the soundcard is fed to loudspeakers.
• Many companies introduced add-on cards to PC, which have necessary hardware and
software to accept a string of ASCII coded characters (i.e. a text file) and convert them into
spoken sentences.
• These circuits take sequence of letters in a text and find a phoneme equivalent to it.
• Group of phonemes are combined to produce “near natural “ speech which is fed to
speakers attached to PC.
• Text to speech units can be used as reading machines for the visually handicapped.
• Using speech unit can be read out data that is stored in pen drive.
20
2.5.3 Music Generation:
• A variety of music synthesizers are available in the market. Synthesizers have a keyboard
similar to a harmonium keyboard.
• When keys are pressed ,musical tones are generated by an electronic circuit.
• A Computer can be used to create music using an output unit called a music synthesizer.
• A Synthesizer accepts digital data in a form known as MIDI (Musical Instrument Digital
Interface) and synthesizes music.to MIDI file format, and fed to a synthesizer.
21
Chapter -III
Computer Software
Introduction
• A detailed step-by-step procedure to solve a problem using a computer is called n
algorithm.
• Sequence of instructions are written in a language , which can be understood by a
computer is called a computer program.
• Programs are essential to use computers. The set of computer programs are called a
software.
• Computer System consist of two parts, Hardware and Software. Hardware is a physical
component of a computer, software tells the hardware what to do and how to do it.
• In order to produce useful output ,computer hardware and software must work together.
Hardware and software are complementary to each other.
22
• Some of the major facilities provided by an operating system are:
1. Starting the operation of a computer when the power is first turned on.
2. Storing user’s programs in memory and scheduling them for execution in an
orderly fashion.
3. Invoking programming language translator programs when necessary.
4. Controlling input and output operations.
5. Managing the use of main memory.
6. Managing and manipulating ( i.e., editing) of user’s files.
7. Easy interaction between users and computers.
8. Providing security to user’s jobs and files.
9. Keeping accounts of resource usage.
As new files are added to the disk, clusters are progressively occupied .If adjacent clusters are
available to store the file, storing as well as retrieval is fast. When new files are added
neighboring clusters may be fully occupied, leaving clusters far a part.
Disk defragmenters are used to detect computer files whose contents are broken across
several locations on the hard disk and move the fragments to one location in order to increase
efficiency.
Disk Scanner :
When a disk is manufactured ,there may be defects in some parts, there by making some
sectors unusable. A disk scanner utility is run to detect such sectors and if a part of a file is
stored in such a sector , it is retrieved and stored in a good sector.
24
3.2.3 Types of Operating Systems
A variety of Operating systems are available in the market and they are designed for different
types of users and systems.
Classification of Operating systems based on type of computer :-
1. The smallest OS is used by embedded computers such as the ones used in washing machines
and medical instruments. These have limited functions are small and can be stored in ROM.
2. The OS used in hand-held computers and smart phones also have built in OS stored in ROM.
They are also similar to BIOS but provide a better graphical user interface. An OS distributed
by Google for smartphones and tablets is called Android and provides a good graphical user
interface. Apple iPads and iPhones use an OS called iOS.
4. Multiuser Operating system allows many users to simultaneously use a single computer. Such
a computer used by several persons is also called a Server.
Two popular multiuser OS are Microsoft Windows Server 2016 and UNIX.
5. The most complex OS is the one used with large mainframe computers, It is highly secure ,
very reliable and efficient. It is multi-programmed operating system and has time sharing
operating system.
Mainframes are also used as batch systems. In batch system, Data and programs that need
to be processed are bundled and collected as a ‘batch’ and executed together.
25
3.2.4 Programming Languages
A language is a means of communication. we use natural language such as English , to communicate
our ideas and emotions to others. Similarly , a computer language is used by a programmer to instruct
a computer what programmer wants to do.
Classification of Programming Languages :
All computer languages can be broadly classified into following two categories :
1. Low-level Language
2. High-level Language
Two Common types of low-level programming languages are Machine Language and Assembly
Language .
Machine Language :-
• Machine language is the lowest level of programming language and is the only language
that computer understands.
• All the commands and data values are expressed using 0s and 1s.
26
Assembly Language :-
• Assembly Languages are symbolic programming languages that use symbolic notation to
represent machine language instructions.
• Symbolic codes, also known as mnemonic codes, which are easy-to-remember
abbreviations, rather than numbers.
• Example these codes includes ADD for add, CMP for compare, and MUL for multiply.
• Assembler is a special program, Assembler converts assembly language instructions into
a single machine language instructions.
27
➢ Java uses the Special Program Called Interpreter to convert programs in high-level
language to low-level language. Interpreter translates line by line and reports the error
once it encountered during the translation process.
28
Unit-III Questions
29