Class Notes
Class Notes
INFORMATION TECHNOLOGY
2ND SEMESTER 2023/2024 SESSION
Introduction to AI
In today's world, technology is growing very fast, and we are getting in touch with different new
technologies day by day. One of the booming technologies of computer science is Artificial
Intelligence which is ready to create a new revolution in the world by making intelligent
machines. The term Artificial Intelligence was first coined in the year 1956 by John McCarthy.
Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial
defines "man-made," and intelligence defines "thinking power", hence AI means "a man-made
thinking power." Hence, we can define AI as:
"It is a branch of computer science by which we can create intelligent machines which can
behave like a human, think like humans, and be able to make decisions."
Artificial Intelligence exists when a machine can have human based skills such as learning,
reasoning, and solving problems.
With the help of AI, you can create such software or devices which can solve real-world
problems very easily and with accuracy such as health issues, marketing, traffic issues, etc
1
● To share our load.
● To perform in our absence and without our guidance.
● To perceive things and try to realize them.
Sub areas of AI
Applications of AI
AI algorithms have attracted close attention of researchers and have also been applied
successfully to solve problems in engineering. Nevertheless, for large and complex problems, AI
algorithms consume considerable computation time due to stochastic feature of the search
approaches
2) Engineering: check design, offer suggestions to create new product, expert systems for all
engineering problems
5) Education: in teaching
6) Fraud detection
2
7) Object identification
8) Information retrieval
Machine Learning
One of the main motivations why we develop (computer) programs is to automate various kinds
of (often tedious) processes. Originally, machine learning was developed as a subfield of
Artificial Intelligence (AI), and one of the goals behind machine learning was to replace the need
for developing computer programs “manually.” Considering that programs are being developed
to automate processes, we can think of machine learning as the process of “automating
automation.” In other words, machine learning lets computers “create” programs (often, the
intent for developing these programs is making predictions) themselves. Machine learning is a
growing technology which enables computers to learn automatically from past data. Machine
learning uses various algorithms for building mathematical models and making predictions using
historical data or information. Currently, it is being used for various tasks such as image
recognition, speech recognition, email filtering, Facebook auto-tagging, recommender system,
and many more.In the machine learning community, it is broadly accepted that the term machine
learning was first coined by Arthur Lee Samuel, a pioneer in the AI field, in 1959 . One
3
quotation that almost every introductory machine learning resource cites is the following, which
summarizes the concept behind machine learning nicely and concisely:
"Machine learning is the field of study that gives computers the ability to learn without being
explicitly programmed."
The Machine Learning process begins with gathering data (numbers, text, photos, comments,
letters, and so on). These data, often called “training data,” are used in training the Machine
Learning algorithm. Training essentially "teaches" the algorithm how to learn by using tons of
data.
Following the end of the “training”, new input data is then fed into the algorithm and the
algorithm uses the previously developed model to make predictions.
The algorithm is trained several times until it reaches a desired outcome. This enables the
Machine Learning algorithms to continually learn on their own. This produces optimal answers
and increasing accuracy and predictions over time.
4
Machine learning can be broadly categorized into three (3):
❖ Supervised Learning
❖ Unsupervised Learning
❖ Reinforced Learning
As its name suggests, supervised machine learning is based on supervision. It means in the
supervised learning technique, we train the machines using the "labeled" dataset, and based on
the training, the machine predicts the output. The main goal of the supervised learning technique
is to map the input variable(x) with the output variable(y). Some real-world applications of
supervised learning are Risk Assessment, Fraud Detection, Spam filtering, etc.
Supervised machine learning can be classified into two types of problems, which are given
below:
Classification
Regression
Classification
Classification algorithms are used to solve the classification problems in which the output
variable is categorical, such as "Yes" or No, Male or Female, Red or Blue, etc. • The
classification algorithms predict the categories present in the dataset.
Some real-world examples of application of classification algorithms are Spam Detection, Email
filtering, etc. Some popular classification algorithms include:
5
● Support Vector Machine Algorithm
Regression
Regression algorithms are used to solve regression problems in which there is a linear
relationship between input and output variables. These are used to predict continuous output
variables, such as market trends, weather prediction, etc. Some popular Regression algorithms
are given below:
1. Since supervised learning works with the labeled dataset so we can have an exact idea
about the classes of objects.
2. These algorithms are helpful in predicting the output on the basis of prior experience.
Unsupervised learning is different from the supervised learning technique; as its name suggests,
there is no need for supervision. It means, in unsupervised machine learning, the machine is
trained using the unlabeled dataset, and the machine predicts the output w. The main aim of the
unsupervised learning algorithm is to group or categorize the unsorted dataset according to the
similarities, patterns, and differences. Machines are instructed to find the hidden patterns from
the input dataset
6
Categories of Unsupervised Machine Learning
Unsupervised Learning can be further classified into two types, which are given below:
● Clustering
● Association
Clustering
The clustering technique is used when we want to find the inherent groups from the data. It is a
way to group the objects into a cluster such that the objects with the most similarities remain in
one group and have fewer or no similarities with the objects of other groups. An example of the
clustering algorithm is grouping the customers by their purchasing behavior. Some of the popular
clustering algorithms are given below:
Mean-shift algorithm
DBSCAN Algorithm
Association
Association rule learning is an unsupervised learning technique, which finds interesting relations
among variables within a large dataset. The main aim of this learning algorithm is to find the
dependency of one data item on another data item and map those variables accordingly so that it
can generate maximum profit. Some popular algorithms of Association rule learning are Apriori
Algorithm, Eclat, FP-growth algorithm.
7
Advantages of Unsupervised Learning
1. These algorithms can be used for complicated tasks compared to the supervised ones
because these algorithms work on the unlabeled dataset.
2. Unsupervised algorithms are preferable for various tasks as getting the unlabeled dataset
is easier as compared to the labeled dataset.
1. The output of an unsupervised algorithm can be less accurate as the dataset is not labeled,
and algorithms are not trained with the exact output in prior.
2. Working with Unsupervised learning is more difficult as it works with the unlabeled
dataset that does not map with the output.
Reinforcement Learning
The reinforcement learning process is similar to a human being; for example, a child learns
various things by experiences in his day-to-day life. An example of reinforcement learning is to
play a game, where the game is the environment, moves of an agent at each step define states,
and the goal of the agent is to get a high score. Agent receives feedback in terms of punishment
and rewards. Due to its way of working, reinforcement learning is employed in different fields
such as Game theory, Operation Research, Information theory, multi-agent systems.
8
Categories of Reinforcement Learning
After the field of machine learning was “founded” more than a half a century ago, we can now
find applications of machine learning in almost every aspect of our life. Popular applications of
machine learning include the following:
9
● Sports predictions
● Post office (e.g., sorting letters by zip codes)
● ATMs (e.g., reading checks)
● Credit card fraud
● Stock predictions
● Smart assistants (Apple Siri, Amazon Alexa, . . . )
● Product recommendations (e.g., Walmart, Netflix, Amazon)
● Self-driving cars (e.g., Uber, Tesla)
● Language translation (Google translate)
● Sentiment analysis
● Drug design
● Medical diagnoses
● Ride sharing Applications (Uber)
● Social networking (Facebook, Instagram, Pintrest)
10
INTERNET OF THINGS
Internet of things (IoT) The Internet of things (IoT) is the inter-networking of physical devices,
vehicles (also referred to as “connected devices” and “smart devices”), buildings, and other items
embedded with electronics, software, sensors, actuators, and network connectivity which enable
these objects to collect and exchange data.
Characteristics:
11
Application areas of IoT:
1. Smart Homes: The smart home is one of the most popular applications of IoT. The cost
of owning a house is the biggest expense in a homeowner’s life. Smart homes are
promised to save time, money and energy.
2. Smart cities: The smart city is another powerful application of IoT. It includes smart
surveillance, environment monitoring, automated transformation, urban security, smart
traffic management, water distribution, smart healthcare etc.
3. Wearables: Wearables are devices that have sensors and software installed which can
collect data about the user which can be later used to get the insights about the user. They
must be energy efficient and small sized.
4. Connected cars: A connected car is able to optimize its own operation, maintenance as
well as passenger’s comfort using sensors and internet connectivity.
5. Smart retail: Retailers can enhance the in-store experience of the customers using IoT.
The shopkeeper can also know which items are frequently bought together using IoT
devices. Smart healthcare: People can wear the IoT devices which will collect data about
the user's health. This will help users to analyze themselves and follow tailor-made
techniques to combat illness. The doctor also doesn't have to visit the patients in order to
treat them.
IoT Categories
1. Consumer IoT(CIOT): The Consumer IoT refers to the billions of physical personal
devices, such as smartphones, wearables, fashion items and the growing number of smart
home appliances, that are now connected to the internet, collecting and sharing data. A
Consumer IoT network typically entails few consumer devices, each of which has a
limited lifetime of several years. The common connectivity used in this kind of solutions
are Bluetooth, WiFi, and ZigBee. These technologies offer short-range communication,
suitable for applications deployed in limited spaces such as houses, or small offices.
12
2. Industrial internet of things (IIoT): It refers to interconnected sensors, instruments, and
other devices networked together with computers' industrial applications, including
manufacturing and energy management. This connectivity allows for data collection,
exchange, and analysis, potentially facilitating improvements in productivity and
efficiency as well as another economic ben.
Baseline Technologies
There are various baseline technologies that are very closely related to IOT, They include:
Machine-to-Machine (M2M), Cyber-Physical Systems (CPS), Web Of Things (WOT)
13
scales, exhibit multiple and distinct behavioral modalities, and interact with each other in
ways that change with context.
c) Web of Things: web of things is a term used to describe approaches, software
architectural style of programming patterns that allow real world objects to be part of
WWW. The major portion of the WoT specification is the Thing Description. Thing is an
abstract representation of a physical or virtual entity. A Thing Description includes the
metadata and interfaces of a Thing in a standardized way, with the aim to make the Thing
able to communicate with other Things in a heterogeneous world.
Sensors
A sensor is a device used for the conversion of physical events or characteristics into electrical
signals. This is a hardware device that takes the input from the environment and gives it to the
system by converting it. For example, a thermometer takes the temperature as a physical
characteristic and then converts it into electrical signals for the system.
Characteristics of Sensors
Range: It is the minimum and maximum value of a physical variable that the sensor can sense or
measure. For example, a Resistance Temperature Detector (RTD) for the measurement of
temperature has a range of -200 to 800oC.
Span: It is the difference between the maximum and minimum values of input. In the above
example, the span of RTD is 800 – (-200) = 1000oC.
Precision: It is defined as the closeness among a set of values. It is different from accuracy.
Linearity: Linearity is the maximum deviation between the measured values of a sensor from an
ideal curve.
14
Hysteresis: It is the difference in output when input is varied in two ways- increasing and
decreasing.
Resolution: It is the minimum change in input that can be sensed by the sensor.
Reproducibility: It is defined as the ability of a sensor to produce the same output when the
same input is applied.
Repeatability: It is defined as the ability of a sensor to produce the same output every time when
the same input is applied and all the physical and measurement conditions kept the same
including the operator, instrument, ambient conditions etc.
Response Time: It is generally expressed as the time at which the output reaches a certain
percentage (for instance, 95%) of its final value, in response to a step change of the input.
Classification of sensors
Sensors based on the power requirement sensor is classified into two types:
i) Active Sensors
Active Sensors: Does not need any external energy source but directly generates an electric
signal in response to the external. Example: Thermocouple, Photodiode, Piezoelectric sensor.
Passive Sensors: The sensors require external power called excitation signals. Sensors modify
the excitation signal to provide output. Example: Strain gauge. Sensors based on output sensors
are classified into two types: Analog Sensors, Digital Sensors.
Analog Sensors: Analog Sensors produces a continuous output signal or voltage which is
generally proportional to the quantity being measured. Physical quantities such as Temperature,
speed, Pressure, Displacement, Strain etc. are all analog quantities as they tend to be continuous
in nature. For example, the temperature of a liquid can be measured using a thermometer or
15
thermocouple (e.g. in geysers) which continuously responds to temperature changes as the liquid
is heated up or cooled down.
Digital Sensor: Digital Sensors produce discrete output voltages that are a digital representation
of the quantity being measured. Digital sensors produce a binary output signal in the form of a
logic "1" or a logic "0" , ("ON" or "OFF"). Digital signal only produces discrete
(non-continuous) values, which may be output as a signal "bit" (serial transmission), or by
combining the bits to produce a signal "byte" output (parallel transmission).
Based on the type of data measured sensor is classified into two types: Scalar Sensors and Vector
Sensors.
Scalar Sensors: Scalar Sensors produce output signals or voltage which are generally
proportional to the magnitude of the quantity being measured. Physical quantities such as
temperature, color, pressure, strain, etc. are all scalar quantities as only their magnitude is
sufficient to convey an information. For example, the temperature of a room can be measured
using a thermometer or thermocouple, which responds to temperature changes irrespective of the
orientation of the sensor or its direction.
Vector Sensors: Vector Sensors produce output signal or voltage which is generally proportional
to the magnitude, direction, as well as the orientation of the quantity being measured. Physical
quantities such as sound, image, velocity, acceleration, orientation, etc. are all vector quantities,
as only their magnitude is not sufficient to convey the complete information. For example, the
acceleration of a body can be measured using an accelerometer, which gives the components of
acceleration of the body with respect to the x,y,z coordinate axes.
Actuators
An actuator is a device that converts the electrical signals into physical events or characteristics.
It takes the input from the system and gives output to the environment. For example, motors and
heaters are some of the commonly used actuators.
16
Types of Actuators
17
6. Soft Actuators: Soft actuators (e.g., polymer based) are designed to handle fragile
objects like fruit harvesting in agriculture or manipulating the internal organs in
biomedicine. They typically address challenging tasks in robotics. Soft actuators produce
flexible motion due to the integration of microscopic changes at the molecular level into a
macroscopic deformation of the actuator materials.
IOT Components
Four fundamental components of the IoT system, which tells us how IoT works.
1. Sensors/Devices: Sensors or devices help in collecting very minute data from the
surrounding environment. All of this collected data can have various degrees of
complexities ranging from a simple temperature monitoring sensor or a complex full
video feed. A device can have multiple sensors that can bundle together to do more than
just sense things. For example, our phone is a device that has multiple sensors such as
GPS, accelerometer, camera but our phone does not simply sense things.
2. Connectivity: Collected data is sent to a cloud infrastructure but it needs a medium for
transport. The sensors can be connected to the cloud through various mediums of
communication and transports such as cellular networks, satellite networks, Wi-Fi,
Bluetooth, wide-area networks (WAN), low power wide area network and many more.
3. Data Processing: Once the data is collected and it gets to the cloud, the software
performs processing on the acquired data. This can range from something very simple,
such as checking that the temperature reading on devices such as AC or heaters is within
an acceptable range. It can sometimes also be very complex, such as identifying objects
(such as intruders in your house) using computer vision on video.
4. User Interface: Information has to be made available to the end-user in some way. This
can be achieved by triggering alarms on their phones or notifying them through texts or
emails. Also, a user sometimes might also have an interface through which they can
actively check in on their IOT system. For example, if a user has a camera installed in his
house, he might want to check the video recordings and all the feeds through a web
server.
18
Service Oriented Architecture of IoT
SOA can also be used to support IoT as a main contributing technology in devices or
heterogeneous systems.
1. Sensing Layer: IoT can be defined as a worldwide interconnected network, where things
or devices are controlled remotely. Interconnected things or devices are becoming easier,
as more and more things are furnished with sensors and RFID technologies.
2. Networking Layer: Networking Layer is responsible to connect all devices or things
together so that they are able to share the information with each other over the Internet.
Moreover, the network layer also collects data and information from the present IT
19
infrastructure for example ICT systems, power grids, business systems, healthcare
systems, and transportation systems.
3. Service Layer: This layer depends upon the technology used on the middleware layer
which is responsible for functionalities incorporated between applications and services in
IoT. This middleware technology also provides a cost-effective and efficient platform for
IoT and this platform includes software and hardware components which can be reused
when needed.
4. Interface Layer: The core responsibility of the interface layer has also simplified the
interconnection and management of things. Interface specific profile can be defined as
the subset of services that support interaction with the application used in a network.
1. Security: Security is the most significant challenge for the IoT. Increasing the number of
connected devices increases the opportunity to exploit security vulnerabilities, as do
poorly designed devices, which can expose user data to theft by leaving data streams
inadequately protected and in some cases people’s health and safety can be put at risk.
2. Privacy: IoT creates unique challenges to privacy, many that go beyond the data privacy
issues that currently exist. Much of this stems from integrating devices into our
environments without us consciously using them. This is becoming more prevalent in
consumer devices, such as tracking devices for phones and cars as well as smart
televisions.
3. Scalability: Billions of internet-enabled devices get connected in a huge network, large
volumes of data are needed to be processed. The system that stores, analyzes the data
from these IoT devices needs to be scalable.
4. Interoperability: Technological standards in most areas are still fragmented. These
technologies need to be converged. Which would help us in establishing a common
framework and the standard for the IoT devices. As the standardization process is still
lacking, interoperability of IoT with legacy devices should be considered critical. This
20
lack of interoperability is preventing us from moving towards the vision of truly
connected everyday interoperable smart objects.
5. Bandwidth: Connectivity is a bigger challenge to the IoT than you might expect. As the
size of the IoT market grows exponentially, some experts are concerned that bandwidth
intensive IoT applications such as video streaming will soon struggle for space on the
IoT’s current server-client model.
6. Standards: Lack of standards and documented best practices have a greater impact than
just limiting the potential of IoT devices. Without standards to guide manufacturers,
developers sometimes design products that operate in disruptive ways on the Internet
without much regard to their impact. If poorly designed and configured, such devices can
have negative consequences for the networking resources they connect to and the broader
Internet.
7. Regulation: The lack of strong IoT regulations is a big part of why the IoT remains a
severe security risk, and the problem is likely to get worse as the potential attack surface
expands to include ever more crucial devices. When medical devices, cars and children’s
toys are all connected to the Internet, it’s not hard to imagine many potential disaster
scenarios unfolding in the absence of sufficient regulation.
21
BLOCKCHAIN TECHNOLOGIES
Introduction to Blockchain
Blockchain technology has emerged as one of the most revolutionary technologies in recent
times. Initially developed to support digital currencies like Bitcoin, it has grown to have
far-reaching applications in finance, healthcare, supply chain management, and more. In this
lecture, we will introduce the basic concepts of blockchain and how it works.
Satoshi Nakamoto materialized the principle of distributed blockchains in 2008. He improved the
architecture by adding blocks to the initial chain without requiring the blocks to be signed by
trustworthy parties. A secure history of data transfers also called transactions is stored among
multiple nodes. Participant timestamps and verifies each transaction via a peer-to-peer network.
This is managed without the need for a central authority.Blockchains have become the backbone
of cryptocurrencies because of these advancements. Today, the design acts as the public record
for all cryptocurrency transactions. In the next section, we discuss centralized and decentralized
concepts to explain blockchain technology.
What is Blockchain?
Definitions: Blockchain is a distributed ledger technology that enables secure, transparent, and
tamper-proof recording of transactions across multiple computers in a network.
A blockchain is also a continuously growing list of records, called blocks, which are linked and
secured using cryptography. Cryptography also ensures that users’ identity and transactions are
done safely with a hash function.
A blockchain is a distributed database that allows direct transactions among two parties without
the need for a central authority. This simple yet powerful concept has far-reaching implications
for a wide range of institutions, including banks, governments, and marketplaces, to mention a
22
few. Blockchain technology has the potential to disrupt any business or organization that depends
on a centralized database as a competitive advantage.
A centralized system, as the name implies, has a single point of control over all administrative
tasks. Figure 1.1 shows an example of a centralized system. Several clients are connected to a
centralized server. Such systems are simple to design, manage, establish trust, and govern, yet
they have several intrinsic flaws, including the following:
1. A centralized system has a single point of failure, so are less stable. Notice Figure 1.1, if the
server is down, all clients get disconnected from the server.
2. Centralized systems are more vulnerable to attack and hence less secured.
23
3. All authorities are provided to the server. This centralization of power can make the server do
unethical operations.
4. Limited numbers of clients can be connected to a server for providing better performances.
Therefore, scalability of such systems is difficult most of the time.
A decentralized system, as the name implies, has no centralized control, and each node has equal
authority. It is difficult to build, manage, govern, or impose trust in such systems. They do not,
however, suffer from the drawbacks of traditional centralized systems. The following are some
of the benefits of decentralized systems: Figure 1.2 depicts an example of a decentralized system.
1. They are more stable and fault resistant since they do not have a single point of failure. If a
client becomes detached from the server, it doesn’t have any effect on other clients of the server.
2. Each client manages their own transaction copy, and they are responsible for their own
security. So, there is no single point to attack, the system is more secure.
24
3. Symmetrical system with equal authority for everybody, limits the scope of unethical behavior
and is typically democratic in nature.
Components of a Blockchain
1. Block:
○ Each block is a digital record of a transaction. It contains:
■ Transaction data (e.g., sender, receiver, and amount for financial
transactions).
■ A timestamp.
■ A cryptographic hash of the previous block (linking blocks together).
2. Chain:
○ A series of connected blocks. The chain aspect comes from how each block is
linked to the previous one through cryptographic hashes, forming a continuous
chain of data.
3. Nodes:
○ Independent computers (nodes) that participate in the blockchain network. Each
node stores a copy of the entire blockchain and helps verify transactions.
25
4. Consensus Mechanism:
○ The process through which all nodes agree on the current state of the blockchain.
Common consensus mechanisms include:
■ Proof of Work (PoW): Miners solve complex mathematical problems to
validate transactions (used by Bitcoin).
■ Proof of Stake (PoS): Validators are chosen based on how many coins
they hold and are willing to "stake" in the network.
26
Advantages of Blockchain
27
2. Transparency: All participants can see the same data, making it easy to verify
transactions.
3. Decentralization: Since there is no central authority, blockchain eliminates the need for
intermediaries.
4. Efficiency: Transactions can be faster and cheaper, especially in cross-border payments,
due to the removal of intermediaries.
Applications of Blockchain
1. Cryptocurrencies:
○ Blockchain’s first application was in the development of Bitcoin and other
cryptocurrencies.
○ It allows peer-to-peer transactions without a central authority (e.g., a bank).
2. Supply Chain Management:
○ Blockchain can track products from manufacturing to end-users, ensuring
transparency and reducing fraud.
3. Healthcare:
○ Patient records can be securely stored and shared across different healthcare
providers, maintaining privacy and accuracy.
4. Smart Contracts:
○ Self-executing contracts where the terms of the agreement are written into code.
They automatically enforce the contract when conditions are met (used on
Ethereum).
5. Voting Systems:
○ Blockchain can be used to develop transparent and secure voting systems,
ensuring election integrity.
Limitations of Blockchain
1. Scalability: Blockchain networks like Bitcoin can process only a limited number of
transactions per second, making them slower compared to traditional systems like Visa.
28
2. Energy Consumption: Proof of Work (PoW) consensus mechanisms require large
amounts of energy.
3. Regulatory Uncertainty: Many governments are still developing regulations around
blockchain, especially cryptocurrencies.
● Users store Bitcoin in a digital wallet and can send it to others via the blockchain.
● Miners validate transactions using the Proof of Work consensus mechanism.
● Once transactions are confirmed, they are added to the blockchain.
Conclusion
29