Class
IX ANSWER KEY
Part-B: Subject specific skills Artificial Intelligence
1. Introduction to AI
Task (Page 148)
Accept all relevant answers.
Task (Page 149)
Accept all relevant answers.
Reboot (Page 151)
a. Yes b. No c. No d. Yes e. Yes
Task (Page 153)
Accept all relevant answers.
Reboot (Page 160)
Google Image Search – Computer Vision
Akinator – Data
Face-Recognition System in Mobile – Computer Vision
Cortana – Natural Language Processing
Video Session (Page 161)
Accept all relevant answers.
Task (Page 161)
Accept all relevant answers.
Video Session (Page 163)
Accept all relevant answers.
Task (Page 164)
Accept all relevant answers.
Task (Page 165)
Accept all relevant answers.
Video Session (Page 166)
Accept all relevant answers.
Touchpad Artificial Intelligence-IX (Answer Key) 1
IMPRINT 1
Reboot (Page 169)
1. Climate Action 2. Partnership for the Goals 3. No Poverty
4. Quality Education 5. Sustainable Cities and Communities
6. Responsible Consumption and Production 7. Life on Land
8. Clean Water and Sanitation 9. Decent Work and Economic Growth
Task (Page 170)
Accept all relevant answers.
Task (Page 176)
Accept all relevant answers.
Reboot (Page 179)
1. Nirmai Health Analytix 2. [Link] 3. [Link]
Task (Page 179)
Accept all relevant answers.
Task (Page 181)
Accept all relevant answers.
Task (Page 183)
Accept all relevant answers.
Task (Page 184)
Accept all relevant answers.
Unsolved Questions
Exercise
Unsolved Questions
A. 1. Precision 2. Affordable, skilled engineers 3. Hanson Robotics
4. Analysis, Prediction 5. Surveillance 6. Justice
7. Coding 8. Design, Construction 9. Data Science
10. Erica 11. Big Data 12. and efficient
B. 1. True 2. False 3. True 4. True 5. True 6. True
7. False 8. False 9. True 10. False 11. False 12. True
C. 1.
Some applications of CV in AI are facial lock in smartphones, unusual behaviour detection,
object classification, etc.
2. Areas where AI has made a remarkable impact are:
a. Security surveillance b. Education c. Space exploration
2 Touchpad Artificial Intelligence-IX (Answer Key)
3. The main focus of AI would be to replace humans in hazardous jobs. Fields like medicine,
industry, environment, defence, wherever humans are vulnerable, it will be replaced with
machines with human-like intelligence.
4. Data is a domain of AI that is related to input to the AI machine. AI requires large amounts
of data to find the latest trends and patterns. More the data, the better will be the analysis
and more accurate would be the prediction.
5. The main goal of smart cities is to optimise the economic growth of the city and improve
quality of life for people with the use of technology and data analysis.
6. Smart Homes are homes that use internet connected devices to empower remote monitoring
and management of appliances and devices such as for lighting and heating.
7. The goal of this SDG is to end hunger, achieve food security, improve nutrition and promote
sustainable agriculture. It also aims to seek sustainable solutions to end hunger in all its
forms by 2030 and to achieve food security.
8. A smart sustainable city is an innovative city that uses ICTs and other means to improve
quality of life, efficiency of urban operation and services, and competitiveness, while ensuring
that it meets the needs of present and future generations with respect to economic, social,
environmental as well as cultural aspects.
9. LaMDA is the latest breakthrough in natural language understanding. It's a language model
for dialogue applications and its open domain, which means its design to converse on any
open-end topic.
10. Astronomers used AI to sift through years of data obtained by the Kepler telescope to
identify a distant eight-planet solar system. AI is also being used for NASA's next mission
to Mars, the AEGIS— a Mars based AI robot, already on the planet is responsible to handle
autonomous targeting of cameras in order to perform investigations in Mars.
11. With rapid development of AI, the fear of unemployment is constant. Jobs in manufacturing,
agriculture, food service, retail, transportation and logistics, and hospitality are some of the
industries likely to be affected. The majority of the repetitive tasks would be taken over by AI.
12. One of the benefits of AI for business is that it handles repetitive tasks across an organization so
that employees can focus on creative solutions, complex problem solving, and impactful work.
D. 1. General AI: It is also termed as General AI. Machines with the following characteristics will
fall in this category. Machines that would perform a wider range of different tasks with the
intelligence like that of humans. It is a step ahead of Weak AI by including problem-solving,
learning and development.
Strong AI: At present, we have not developed any such machines.
Worldwide research is now focused on developing machines with strong AI. Asthesesystems
are in their research stage, it may take a lot of time and effort to develop these.
An example of Strong AI could be a machine hearing "good morning" and deciding to turn
on the coffee maker.
Touchpad Artificial Intelligence-IX (Answer Key) 3
2. a. Big Data Engineer: The role of a Big Data Engineer is to create an ecosystem for the
business systems to interact efficiently. Their primary task is to build and effectively
administer big data of an organization. They also have to carry out the function of
obtaining outcomes from big data in a robust manner.
b. Machine Learning Engineer: Machine learning engineers are involved in building and
maintaining self-running software that facilitates machine learning initiatives. They are
in continuous demand by the companies and their position rarely remains vacant. They
work with huge chunks of data and possess extraordinary data management traits.
c. Robotics Scientist: A reduction in jobs will indeed take place due to the emergence
of robotics in the field of AI. Conversely, jobs will also rise as robotics scientists are in
incessant demands by major industries for programming their machines.
3. a. Managing all of your home devices from one place. The convenience factor here is
enormous. Being able to keep all of the technology in your home connected through
one interface is a massive step forward for technology and home management.
b. Flexibility for new devices and appliances. Smart home systems tend to be wonderfully
flexible when it comes to the accommodation of new devices and appliances and other
technology. No matter how state-of-the-art your appliances seem today, there will be
newer, more impressive models developed as time goes on.
c. Maximizing home security. When you incorporate security and surveillance features in
your smart home network, your home security can skyrocket. There are tons of options
here – only a few dozen of which are currently being explored.
4. Computer vision is a field of artificial intelligence (AI) that enables computers and systems
to derive meaningful information from digital images, videos and other visual inputs — and
take actions or make recommendations based on that information.
Computer Vision Benefits
Faster and simpler process - Computer vision systems can carry out repetitive and monotonous
tasks at a faster rate, which simplifies the work for humans.
Better products and services - Computer vision systems that have been trained very well will
commit zero mistakes.
5. Smart Cities are cities that uses technology to provide services and better citizen welfare.
It uses Information and Communication Technology (ICT) to communicate, deliver
welfare schemes, improve operational efficiency and better quality of government services.
The main goal of smart cities is to optimise the economic growth of the city and improve
quality of life for people with the use of technology and data analysis. Lights that adapt to
daylight make smart street lights. Parking sensors to intimate about available parking lots,
automated garbage collection are few examples of a smart city. The main characteristic of
smart cities is to create an inclusive and sustainable environment that is centred around
people's wellbeing.
4 Touchpad Artificial Intelligence-IX (Answer Key)
6. A smart school is a technology-based teaching-learning environment for both teachers and
students. ICT is used to achieve smart schools' educational objectives, prepare child friendly
curriculum, assessment and teaching-learning mechanism. Children are prepared to be part
of the Information Age.
7. Goal 14: Life Below Water
Conserve and sustainably use the oceans, seas and marine resources for sustainable
development. It aims to reduce water pollution, protect and restore ecosystems, sustainable
fishing, conserve coastal and marine areas, reduce ocean acidification, end subsidies aiming
to reduce overfishing and increase the economic benefits from sustainable use of marine
resources.
Goal 15: Life On Land
Protect, restore and promote sustainable use of terrestrial ecosystems, sustainably manage
forests, and combat desertification. It aims to conserve ecosystems, end deforestation, protect
biodiversity and natural habitats, eliminating poaching and trafficking of endangered species.
8. The development of autonomous vehicles will revolutionaries the transportation system.
Waymo, after many test drives, launched their first public riding services. Waymo's AI software
crunches data from vehicles lidar, camera, GPS and cloud services to produce control signals
that operate the driver-less vehicle.
9. a. Healthcare for Assisting Doctors: For saving human lives the medical industry is
relying on AI on many fronts. Healthcare organisations are using IBM Watson for medical
diagnosis. Google's DeepMind has successfully developed a system that can analyse
retinal scans and spot symptoms of sight-threatening eye diseases.
b. AI in Education for Automated Grading System: AI in the assessment process provides
real-time learning feedback to teachers and students. Through Machine Learning and
data analysis using AI, human patterns of data are studied. This helps in a quick and fair
grading system without human interventions.
c. AI in Agriculture: The world will need to produce 50 percent more food by 2050 as we
are exhausting our resources. The only way this can be possible is when we are using
it more wisely. AI can help farmers to get more from the land, and use resources more
sustainably.
10. Email Spam Filters: Email categorization and spam filters are one of the powering features
of AI that affect our inbox. Simple rule-based filters are used to mark spam or put email into
various categories as Primary, Social, Promotion or Important.
11. a. Manufacturing and pharmaceutical work
b. Doctors
c. Soldiers
12. Some of the sources of AI Bias are: Data: AI systems are the result of the data that is fed
into them. The data used to train the AI system is the first step to check for biasness. The
Touchpad Artificial Intelligence-IX (Answer Key) 5
dataset for AI systems should be realistic and need to be of a sufficient size. However, the
largest data collected from the real world may also reflect human subjectivity and underlying
social biases. The Amazon AI recruitment system is a good example. It was found that their
recruitment system was not selecting candidates in a gender neutral way. The machine
learning algorithm was based on the number of resumes submitted over a period of 10
years, that most of them were men, so it favoured men over women.
Algorithms: The algorithms in itself do not add biasness to an AI model, but it amplifies
the biasness. Let's see an example of an image classifier model. Its trained on images in the
public domain— pictures of people's kitchens. It so happens that most of the images are of
women rather than men. AI algorithms are designed to maximise the accuracy. Therefore,
an AI algorithm may decide that the people in the kitchen are women despite the fact some
of the images are of men.
In Life
Accept all relevant answers.
Deep Thinking
Accept all relevant answers.
Lab
Accept all relevant answers.
Ready ..........1
Accept all relevant answers.
2. AI Project Cycle
Reboot (Page 202)
1. Problem Scoping 2. Data Acquisition 3. Data Exploration
4. Modelling 5. Evaluation
Task (Page 202)
Accept all relevant answers.
Reboot (Page 211)
1. Surveys 2. Web scraping 3. Sensors
4. Cameras 5. Observations
Task (Page 225)
Accept all relevant answers.
6 Touchpad Artificial Intelligence-IX (Answer Key)
Task (Page 226)
Accept all relevant answers.
Video Session (Page 228)
Accept all relevant answers.
Unsolved Questions
A. 1. AI project cycle 2. Evaluation 3. Data visualisation
4. Solution 5. Testing data
6. elements, interconnections 7. Cameras 8. System maps
9. Data visualisation 10. Unstructured data 11. Pie
12. Decision tree 13. Rule-based 14. Accuracy
15. Pixel
B. 1. False 2. True 3. False 4. False 5. True 6. True
7. False 8. True 9. False 10. False 11. True 12. False
13. True 14. True 15. False
C. 1. AI project cycle is the life cycle of an AI project defining each and every step that every
organization should follow to derive the business value from Artificial Intelligence.
2. Modelling or data modelling is defined as the process of designing decision-making
algorithms that has to be trained on a set of data (which was acquired at the data acquisition
stage for the problem you scoped in the problem scoping stage) and apply that learning to
ecognize certain types of patterns.
3. AI Project Cycle has 5 stages:
a. Problem Scoping b. Data Acquisition c. Data Exploration
d. Modelling e. Evaluation
4. There are two types of data:
Training Data: It is data on which we train our AI project model. It is basically to fit the
parameters of the project for the model. In training data, the output is available to the model.
Testing Data: It is used to check the performance of an AI model. In testing data, the data
is not seen for which the predictions have to be made.
5. Data can also be collected from various sensors like collecting environmental data and stored
in some data storage solutions. Sensors are connected through gateways which enable them
to collect live data in the offline mode.
6. There are times using the internet, we acquire unauthentic data from websites for our AI
project. Extracting private data can be an offence.
So, keeping this in mind we should ensure the data is collected from open-sourced websites
hosted by the government. They are one of the most reliable and authentic sources of
information.
Touchpad Artificial Intelligence-IX (Answer Key) 7
7. Data is the base for any AI project to be built. When the data is acquired, it's important to
check if it's from a reliable and authentic source for the accuracy of the project.
8. It is a data visualisation tool provided by Microsoft. It is freely available to download and
use.
9. It is a combination of a bubble chart, data visualization and a map. It is used to visualize
location and proportion using circles over geographical regions with the area of the circle
being proportional to its value in the dataset.
10. Pixel It is an example of a machine learning approach which is used in computer vision
applications. The graphics or images created in computers are pixel-based images. It shows
how the computer classifies the images and reads them.
11. Learning based approach refers to the model where the relationship or patterns in the data
are not defined by the developer. Random data is fed into the machine and the machine
develops its own pattern or trends based on data outputs.
12. Machine learning aims at making a machine that can learn through data and solve complex
problems. Deep learning aims at building neural network that can help in discovering patterns
or trends.
D. 1. AI project cycle is the process of converting the real-life problem into an AI based model.
The project cycle framework is designed to help project managers guide their projects
successfully from start to end. The purpose of the project life cycle is to create an easy-to-
follow framework to guide projects. The AI project cycle provides us with an appropriate
framework which can lead us towards our goal.
a. Problem Scoping: The first stage of an AI project cycle is problem scoping to identify
the problem and have a vision to solve it. Problem scoping means selecting a problem
and finding a solution for it using AI technology. The project identifies the area in which
AI can be used to provide a solution.
Many times we are unable to observe any problem in our surroundings. In that case, we
can take a look at the Sustainable Development Goals. 17 goals have been announced
by the United Nations which are termed as the Sustainable Development Goals. The aim
is to achieve these goals by the end of 2030.
b. Modelling: It is the design phase of the project cycle. In this, we select the best way to
reach the solution. It requires the process of selecting the right algorithm to develop a
working model for the project. In this step, the algorithm is converted into a model.
c. Data Acquisition: The term data acquisition means collecting raw data for the purpose of
reference or analysis for the project. The data can be in the form of text, numbers, images,
videos or audio. The data acquisition system allows us to obtain valuable information
about reality to improve the performance of the project.
8 Touchpad Artificial Intelligence-IX (Answer Key)
2. Our MIIT officials Who?
Have a problem of Conducting an examination What?
While No unfair means should be used in the Where?
examination or no unauthorized person should
enter the examination center
An ideal solution would A system which can check who all are entering Why?
the center, and the system should raise an alert
if it finds any unauthorized person entering
3.
Our IT company Who?
Have a problem of Categorising support tickets What?
While That they are not able to classify support tickets Where?
properly which leads to delay in response
An ideal solution would A classification system which can categorise Why?
the support tickets correctly and in less time
4. A system map is a diagrammatic representation of a set of things working together. It focuses
on the components and boundaries of a system. System map helps us to find relationships
between different elements of the problem which we have scoped. It helps to find a solution
to achieve the goal of our project.
5. We use system maps to understand the complex issues that have inter connected factors
affecting each other. A system comprises of:
a. Elements: These are different, discrete elements within the system.
b. Interconnections: These are the relationships that connect the elements.
Rules for system maps are:
a. The circles represent elements.
b. Arrows are used to represent relationships/interconnections.
c. The '+' and '-' signs are indicators of the nature of a relationship. The arrowhead depicts
the direction of the effect and the sign (+ or -) shows their relationship.
d. If the arrow goes from X to Y with a + sign, it means that both are directly related to each
other. That means if X increases, Y also increases and vice versa.
e. If the arrow goes from X to Y with a -sign, it means that both the elements are inversely
related to each other. That means if X increases, Y would decrease and vice versa.
Touchpad Artificial Intelligence-IX (Answer Key) 9
6. There are various sources to collect relevant data for our project:
a. Surveys: Data can be collected from online surveys, telephonic surveys or in person surveys
and collect responses. Surveys are a way of collecting data from a group of people in
order to gain information and insights into various topics of interest. The process involves
asking people for information through questionnaires which can be online or offline.
It can be considered as a data source.
b. Web Scraping: Data or information can also be extracted from a website.
Web scraping or Data scraping is the method of downloading information from the
World Wide Web (WWW) and storing it onto your computer for later reference. The data
collected in this way is an online data.
c. Sensors: Data can also be collected from various sensors like collecting environmental
data and stored in some data storage solutions. Sensors are connected through gateways
which enable them to collect live data in the offline mode.
d. Cameras: Data can be seen, written down or recorded onto the computer. Cameras are
used to collect data in the form of images. CCTV, web cameras, surveillance cameras are
big sources of visual data that can be acquired from various places.
e. Observations: It is a method of collecting data by watching facts as they occur. Using
the observation technique data can be analysed and used for testing the model.
f. Application Programming Interface (APIs): APIs are a set of functions and procedures
that allow one application to connect to another. So, one of the ways of collecting
data is through APIs that can be used to collect data from social media services for
analysis.
7. Data exploration refers to the initial step in data analysis in which data analysts use data
visualization and statistical techniques to describe dataset characterizations, such as size,
quantity, and accuracy, in order to better understand the nature of the data.
Data exploration techniques include both manual analysis and automated data exploration
software solutions that visually explore and identify relationships between different data
variables, the structure of the dataset, the presence of outliers, and the distribution of data
values in order to reveal patterns and points of interest, enabling data analysts to gain greater
insight into the raw data.
8. Here are 10 elements of good data visualization that can help you present information that
readers can process quickly and easily.
• Clear Headings and Keys.
• Obvious Trends.
• Simple Analysis.
• Relevant Comparisons.
• Lots of Data/Evidence.
• Summaries of Key Points.
• Add design elements.
• Consolidated Information.
10 Touchpad Artificial Intelligence-IX (Answer Key)
9.
Artificial Intelligence Machine Learning
AI aims at making a machine Aims at making a machine that can
that mimics human intelligence. learn through data and solve complex
problems.
It is a subset of data science. It is a subset of AI.
It is the simulation of intelligence It is the training of machines to take
in machines. decisions with experience.
10. Following are some of the important points to consider while designing a decision tree:
• There can be a possibility of multiple decision trees which lead to correct prediction for
a single dataset. The simplest one should be chosen.
• The dataset might contain redundant data at times, which does not have any reference
while creating a decision tree. Therefore, it is necessary that only those parameters that
affect the output directly should be included.
• While making Decision Trees, one should take a look at the dataset given to them and
try to figure out what pattern does the output leaf follow. Try selecting any one output
and on its basis, find out the common links which all the similar outputs have.
11. Decision trees are tools that follow a rule based approach that uses a tree-like model of
decisions and their possible consequences. It is a kind of flow chart, where the flow starts at
the root node and ends with a decision made at the leaves. It is used to depict conditions
and their outcomes. It is one of the most widely used and practical methods for supervised
learning.
12. Machine Learning: Machines need to learn the ways of humans by learning the techniques
and processes. So machine learning is a subset of artificial intelligence that uses statistical
methods that enable machines to improve with experiences. So machines learn from their
mistakes and take them into consideration in the next iteration, this way they keep improving
with experience. For example, Snapchat filters and Netflix recommendations.
In Life
Accept all relevant answers.
Deep Thinking
Accept all relevant answers.
Lab
Accept all relevant answers.
Ready ..........2
Accept all relevant answers.
Touchpad Artificial Intelligence-IX (Answer Key) 11
3. Neural Networks
Video Session (Page 246)
Accept all relevant answers.
Unsolved Questions
A. 1. Deep learning 2. Sensory 3. Datasets 4. Neurons 5. Electrical
B. 1. False 2. True 3. True 4. False 5. True
C. 1. d 2. b 3. f 4. a 5. c,e
D. 1. The three advantages of neural networks are:
• Parallel processing capability
• Data is stored on the entire network
• Capable of learning from non-linear and complex data
2. ANN is made up of three basic layers— Input, Hidden and Output. The input layer accepts
the inputs, the hidden layer processes the inputs, and the output layer produces the result
where each layer tries to learn from the computed weights.
3. Neural networks are made up of layers of neurons, just like the human brain that consists
of millions of neurons. These neurons are the core processing units of the network.
E. 1.
Just like the human brain where all neurons are interconnected to one another, artificial neural
networks also have a large number of artificial neurons(nodes) that are interconnected to
one another in a sequence of layers of the networks.
Dendrites in the human brain receive the impulse and pass on to the cell body of the neuron.
From the cell body the impulse travels to the axon and passes to another neuron attached
through a joint called synapses. This process goes on through a complex network of neurons
to get the desired stimulus of the impulse.
Similarly, the artificial neurons(nodes) take input data and perform simple operations on the
data. The result of these operations is passed to other artificial neurons(nodes) which are
arranged in a sequence of layers.
2. There are three types of neurons in our body:
a. Sensory neuron: It carries the sensory signals from sensory organs to the brain. It gets
activated when you touch, smell, hear, see or feel something.
b. Motor Neuron: It carries the signal from the brain or spinal cord to the organs, glands
or muscles to carry out voluntary or involuntary movement.
c. Interneuron: They connect the sensory and motor neurons to help in the transmission
of signals and form a complex internal neuron network.
3. Following are the two AI models:
• Regression is an example of rule-based AI models. This is a type of Rule Based AI model.
12 Touchpad Artificial Intelligence-IX (Answer Key)
In regression, the algorithm generates a mapping function from the given data, as shown
by the solid line in the given graph. The blue dots shown in the graph are the data values
and the solid line here represents the mapping done for them. With the help of this
mapping function, we can predict the future data. It works with continuous data.
• lustering is a machine learning approach where the machine partitions the dataset into
C
different clusters or categories based on machine generated algorithms. The data fed to such
a model is usually unlabeled or random and thus the developer feeds in the data directly into
the machine and instructs it to build its own algorithm. The machine then forms a pattern
or cluster based on training data and groups those that follow the same pattern. The best
clustering is the one that minimizes the error. Clustering works on discrete dataset.
In Life
Accept all relevant answers.
Deep Thinking
Accept all relevant answers.
Lab
Accept all relevant answers.
Ready ..........3
Accept all relevant answers.
4. Introduction to Python
Task (Page 262)
Accept all relevant answers.
Task (Page 265)
START
INPUT PRINCIPAL, RATE
OF INTEREST,TIME
SI = P*R*T/100
DISPLAY AREA
STOP
Touchpad Artificial Intelligence-IX (Answer Key) 13
Task (Page 266)
START
COUNT=1
IF COUNT%2==0
&& STOP
COUNT<=20
Task (Page 278)
Accept all relevant answers.
Reboot (Page 286)
1. This operator is used to represent and calculate exponents.
2. Relational operators or comparison operators compare the values given on both the side of
the operators and returns the Boolean value either True or False.
3. X = 2
Y = 5
X**= Y
Output: 32
Task (Page 287)
1. 8.0
2. 80
Task (Page 292)
Accept all relevant answers.
Task (Page 293)
r = int(input("Enter the radius of the circle: "))
Area = 3.14*r*r
Perimeter = 2*3.14*r
print("The area of the circle is: ", Area)
print("The perimeter of the circle is:", Perimeter)
Task (Page 311)
1. ['N', 'I', 'A', 'U']
2. ['N']
3. ['E', 'D', 'U', 'C', 'A', 'T', 'I', 'O']
14 Touchpad Artificial Intelligence-IX (Answer Key)
Unsolved Questions
A. 1. Algorithm 2. Algorithm, flowchart 3. Flowchart
4. Flowchart 5. Guido van Rossum 6. ==, +=
7. ASCII 8. None 9. Python
10. condition 11. else 12. Traversing
13. List 14. mutable 15. clear()
B. 1. True 2. False 3. True 4. True 5. True 6. False
7. True 8. True 9. True 10. False
C. 1. x=y=10
a=int(input("enter number"))
print("number entered is",a)
a+=5
b=10
a=a+10
print(a)
2. y=int(input("Enter y:"))
if y<10:
print("smaller")
else:
print(y)
3. M=int(input("Enter M: "))
while M<10:
if M==5:
print("Middle Value")
else:
print(M)
M=+1
4. str="book"
i=0
while i<=1:
print(str, sep="%")
i+=1
Touchpad Artificial Intelligence-IX (Answer Key) 15
D. 1. Program:
i = 1
while i < 5:
print(i)
i += 2
print("Python")
2. Program:
sum = 0
i = 20
for j in range(9,0,-2):
sum += i
print(sum)
E. 1. 1022*1024*1026*1028*
2. 50
3. a
F. 1. There are two coding programs:
CodeCombat: It is the company's original coding game recommended for parents, individuals,
educators and students.
Ozaria: It is an adventure game, fantasy story, and Computer Science program recommended
for educators and students.
2. Flowcharts are easier to understand than algorithms as they are represented in pictorial
forms. One can easily write the code by looking at the flowchart.
3. Many different algorithms might be acceptable for each problem. Due to the flexibility of
the English language, the same algorithm can often be expressed in more than one way. In
addition, there is almost always more than one way to solve a problem.
4. The selection control structure allows one set of statements to be executed if a condition is
true and another set of actions to be executed if a condition is false.
5. You will need to enclose it with a pair of Triple quotes, one at the start and second in the
end. Anything inside the enclosing Triple quotes will become part of one multiline string.
6. The print() function prints the specified message to the screen, or other standard output
device.
7. Variables are used to store information to be referenced and manipulated in a computer
program. They also provide a way of labeling data with a descriptive name, so our programs
can be understood more clearly by the reader and ourselves.
16 Touchpad Artificial Intelligence-IX (Answer Key)
8. Floor division divides the first number with the second number and returns the whole number
adjusted left to the number line whereas normal division just divides the two values.
9. A sequential programming is when the algorithm to be solved consists of operations
one after the other, where there are no sentences that are repeated or you do not have
to do alternative operations. For example: The alarm sounds. You wake up. You brush
your teeth.
10. A nested if statement is an if statement placed inside another if statement. Nested if
statements are often used when you must test a combination of conditions before deciding
on the proper action.
11. Step value is the value by which the counter variable is incremented or decremented every
time the loop body is executed. It can be a positive or a negative value, but it cannot be
zero. The step value is optional. In case it is omitted, the counter variable is increased by
one every time the loop is executed.
12. This loop is also called an entry-controlled loop as it checks for the condition in the beginning
only. If the condition is true then the body of the loop will be executed. If the condition is
false then it will not be allowed to enter within the loop and it stops.
13. This function sorts the list in ascending or descending order. This is done "in the list itself"
and works for the list with values of the same data types.
14. The remove( ) function removes the first occurrence of the element with the specified value.
The pop( ) function removes an element from the list based on the index number specified
in the function and returns the deleted value.
15. False
G. 1.
Algorithm Flowchart
It is a step-by-step textual approach to It is step-by-step visual/graphical
solve a problem. approach to solve a problem.
It is a Pseudocode (false code) of a It is a graphical representation of a
program. program.
Difficult to represent branching and Easily represents branching and looping
looping. through symbols.
Easy to find errors. Difficult to find errors.
Can be used for simple, complex or long Advisable to use only for simple processes.
processes.
Touchpad Artificial Intelligence-IX (Answer Key) 17
2.
SYMBOL NAMES SYMBOLS PURPOSE
Used to start and stop a
Oval
flowchart.
Used to take input and display
Parallelogram
output.
Used to perform assignment,
Rectangle mathematical and processing
operations.
Used for decision making in
Diamond
case of branching or looping.
Used to show the direction
Arrow in any direction of flow of information in a
flowchart.
3. To solve this problem of writing a program we follow some steps as given below:
a. Understanding the Problem: This is a very important and difficult step where we need to
understand the main objective of a problem. Give more time to this step as the better
you understand the problem, the easier it will be to solve it.
b. Analyzing the Problem: In this step, we analyse what kind of data can be given as an
input, what formula or tool to use to do the processing and in which format the output
will be displayed.
4. There are three different types of control structures Sequential flow, Selection flow and
Repetition flow.
Sequential Flow
In sequential flow, the statements are placed one after the other and the flow of execution
occurs starting from line1, line2 and so on with a top-down approach. It is the default flow
followed in any programming language. For example, steps for calculating percentage of
any student are:
18 Touchpad Artificial Intelligence-IX (Answer Key)
a. Input marks of English Hindi and Math
b. Total the marks
c. Calculate the percentage
d. Display the percentage
Selection Flow
Selection flow is also known as branching control as the flow of control branches based on
a condition. A condition evaluates to either TRUE or FALSE. In the case of TRUE, the flow of
control follows the set of instructions written for True. In case it is FALSE then it follows the
other route. For example, if we consider the above example where we have a condition-award
to be given if the percentage is more than 90 only.
a. Input marks of English Hindi and Math
b. Total the marks
c. Calculate the percentage
d. Display the percentage
If percentage is more than 90 then
Display "Award given"
Otherwise
Display "No award"
Repetition Flow
Repetition flow is also known as a loop as it repeats a set of instructions a number of times
based on a condition. For example, if we wish to repeat the above steps of calculating
percentage for 10 students then we follow the concept of repetition.
a. Repeat for 10 people
• Input marks of English Hindi and Math
• Total the marks
• Calculate the percentage
• Display the percentage
• If percentage is more than 90 then
Display "Award given"
Otherwise
Display "No award"
b. Go up again till number of repeats is less than or equal to 10
Touchpad Artificial Intelligence-IX (Answer Key) 19
5.
Name Symbol Purpose Example Output
2+4 6
Addition + Adds two values. 2.0 + 4 6.0
"hi" + "all" "hiall"
Subtracts second value form 6–2 3
Subtraction –
the first value. 6.0 – 2 4.0
2*3 6
Multiplication * Multiplies two values. 1.5 * 2 3.0
"Hi" * 3 HiHiHi
4/2 2.0
6.0 / 2 3.0
Division / Divides two values.
6 / 2.0 3.0
11 / 2 5.5
Returns the remainder of a 5%2 1
Remainder %
division. 16 % 11 5
Second number raised to the 5 ** 2 25
Exponential **
power of first number. 1.5 ** 2 2.25
Divides the first number with 11 // 2 5
the second number and returns –11 // 2 –6
Floor division //
the whole number adjusted 13 // 4 3
left to the number line. –13 // 4 –4
6. Following are some number types:
• Integer: Integers are whole numbers (+ve, -ve or 0) with no fractions or decimal value. Its
length is dependent on the available memory. For example, 10, 124, 4567, 7812568751.
• Float: It is a real number with floating point representation. For example, 15.5 and 12.0.
It can also be represented using the exponent notation E. For example, 1E5 is 100000.
• Complex: It is made up of a real number and an imaginary number. For example, 3+2i
where 3 is a real number and 2i is an imaginary number.
7. There are three kind of errors which a programmer encounters in Python— syntax error,
logical error and runtime error.
Syntax Error
Syntax means writing the code following the rules of Python language. Syntax error is occurred
when we violating the rules of Python language.
20 Touchpad Artificial Intelligence-IX (Answer Key)
This is the most common type of an error made by a programmer. If there is typing error,
incorrect indentation, or incorrect arguments given in a function then Python will not be
able to interpret the instruction and will raise a syntax error.
Logical Error
This kind of error is difficult to find since the program will run correctly but the desired
output is not achieved. This happens if we give a wrong formula for the calculation to be
done, write wrong logic for the problem to be solved through the code.
Runtime Error
Runtime error occurs during the execution of a program like wrong input or output errors,
undefined object errors, division by zero errors. This type of error will halt the program
execution unexpectedly.
8. The three programming constructs are:
Sequential Statements
A step-by-step process of execution of code is called sequential flow of control. This is the
default flow of execution of a program. It means that the computer will run the code one
line at a time starting from line 1, followed by line 2 and so on till it reaches the last line of
the program.
Selection Statements
In Python, Selection flow of control is achieved through conditional statements. In the
conditional/selection statements, flow of control is changed based on a condition. We specify
the condition in the program which evaluates to either True or False.
If condition is True then the block of statement written for True will be executed and in case
the condition is False then the block of statements for False will be executed.
Iterative Statements
In Python, the process of repeating a set of instructions based on a condition is called loop.
There are two types of loops in Python— for loop and while loop.
9. The for Loop
The for loop is used to repeat a set of instructions for a fixed number of times. It means
the number of iterations are known/definite before we start with the execution of a loop.
Therefore, the for loop is also known as definite loop. Indentation of statements is must to
specify the block of statements to be repeated using the for loop.
The while loop
The while loop is used to repeat a set of instructions as long as the condition is true. It means
when the number of iterations are not fixed/indefinite before we start with the execution of
a loop. It is therefore known as indefinite loop. Indentation of statements is must to specify
the block of statements to be repeated using while loop.
Touchpad Artificial Intelligence-IX (Answer Key) 21
10. Using the range() Function: The range( ) function is an inbuilt function that is used to generate
a set of values between the specified range.
for <Var> in range(<Start>, <End+1>, <Step>):
Statements
Where,
for, in and range are keywords.
Start, End and Step are parameters of range() function and will
always be integers.
Start is a starting value of loop and End is an ending value+1 of loop,
Step is the number of steps taken to reach the end value.
If only two parameters are used then Step value becomes 1 by default.
If only one parameter is used the Start becomes 0 and Step becomes 1
by default.
If Start > End then Step is a -ve integer should be given.
If Start < End then Step is a +ve integer.
If Start >= End and Step value is not specified then it assumes as +ve
which is an invalid condition to run a loop so the loop will not execute at
all.
11. In Python, the process of repeating a set of instructions based on a condition is called loop.
There are two types of loops in Python— for loop and while loop.
The for Loop
The for loop is used to repeat a set of instructions for a fixed number of times. It means
the number of iterations are known/definite before we start with the execution of a loop.
Therefore, the for loop is also known as definite loop. Indentation of statements is must to
specify the block of statements to be repeated using the for loop.
The while loop
The while loop is used to repeat a set of instructions as long as the condition is true. It means
when the number of iterations are not fixed/indefinite before we start with the execution of
a loop. It is therefore known as indefinite loop. Indentation of statements is must to specify
the block of statements to be repeated using while loop.
12. The list has the following important features:
• It is mutable data type.
• It is an ordered sequence of values.
• Each element is separated by comma and enclosed in square brackets [ ].
• Each value/element is accessed by an index number.
The values can be added, modified or deleted by the user throughout the program.
It stores the values of different data types.
22 Touchpad Artificial Intelligence-IX (Answer Key)
13. There are two different functions used to remove elements in an existing list remove( )
and pop( ).
The remove( ) Function
The remove( ) function removes the first occurrence of the element with the specified
value. It means only one value can be removed at a time even if there are duplicate values
in the list. If you wish to remove multiple values then this function can be used within a loop
where it repeats itself a specific number of times.
The pop( ) Function
The pop( ) function removes an element from the list based on the index number specified
in the function and returns the deleted value. In case no index number is given then by
default it removes the last element from the list. If we try to remove an index number which
does not exist then it gives an IndexError.
14. The * operator is used to replicate a list specific number of times. With * operator, one
operand has to be a list and the other should only be an integer, otherwise it will give an
error.
15. The elements of a list can be accessed by using its index number starts with 0 (zero). There
are two different ways of using the index number:
Forward Indexing: The index number begins with 0 till length-1 and we refer the elements
from left to right.
Negative/Backward Indexing: The index number begins with -1 till -length and we refer
the elements from right to left.
H. 1. Program:
A=int(input("Enter the 1st angle= "))
B=int(input("Enter the 2nd angle= "))
C=int(input("Enter the 3rd angle= "))
S=A+B+C
if S==180:
print("The angles form a triangle")
else:
print("The angles do not form a triangle")
2. Program:
F = int(input("Enter the temperature in fahrenheit: "))
C = ((F / 5) * 5) - 32
print(F, "degree fahrenheit is equal to ", C, "celcius")
3. Program:
s=float(input("Enter the time in seconds: "))
Touchpad Artificial Intelligence-IX (Answer Key) 23
m=s/60
print("The time in minutes is: ", m)
4. Program:
x = int(input("Enter the length: "))
y = int(input("Enter the breadth: "))
if(x==y):
print("It's a square")
else:
print("It's not a square")
5. Program:
weekday = int(input("Enter weekday day number (1-7) : "))
if weekday == 1 :
print("\nMonday");
elif weekday == 2 :
print("\nTuesday")
elif(weekday == 3) :
print("\nWednesday")
elif(weekday == 4) :
print("\nThursday")
elif(weekday == 5) :
print("\nFriday")
elif(weekday == 6) :
print("\nSaturday")
elif (weekday == 7) :
print("\nSunday")
else :
print("\nPlease enter weekday number between 1-7.")
6. Program:
Salary = int(input("Enter the salary of the employee: "))
Years_of_Service = int(input("Enter the number of service years: "))
Bonus = (Salary * 0.15)
Net_Salary = 0
if Years_of_Service > 5:
Net_Salary = Salary + Bonus
print(Net_Salary)
24 Touchpad Artificial Intelligence-IX (Answer Key)
7. Program:
Bill_Amount = int(input("Enter the billing amount: "))
Discount = Bill_Amount * 0.1
if Bill_Amount > 5000:
Net_Amount = Bill_Amount - Discount
print("The net billing amount is: ", Net_Amount)
else:
print("The net billing amount is: ", Bill_Amount)
8. Program:
Y = int(input("Enter the year: "))
if (Y % 4) ==0:
if(Y % 400) == 0:
print("The year entered is a leap year")
else:
print("The year entered is not a leap year")
Lab
1. Start
Input Basic, Allowances, Deductions
Net Salary = (Basic + Allowances - Deductions)
Display Net Salary
Stop
2. Start
Input marks1, marks 2
if marks1 > marks2
Display marks1 is larger
else
Display marks 2 is larger
Stop
3. a. Program:
C = int(input("Enter the temperature in celcius: "))
F = (C * 1.8) + 32
print(C, "degree celcius is equal to ", F, "fahrenheit")
b. Program:
for names in["Rahul", "Kohli", "Rohit", "Dhawan", "Dhoni"]:
print(names)
Touchpad Artificial Intelligence-IX (Answer Key) 25
c. Program:
x = 22
y = 14
temp = x
x = y
y = temp
print('The value of x after swapping: ', x)
print('The value of y after swapping: ', y)
d. Program:
K = float(input("Enter the distance in kilometres: "))
M = K * 1000
print("The distance in metres is: ", M)
e. Program:
for names in["Rahul", "Kohli", "Rohit", "Dhawan", "Dhoni"]:
print(names)
f. Program:
a = float(input("Enter the side of the square: "))
print("The area of the square is: ", a * a)
g. Program:
Same as c
h. Program:
data = [10, 20, 30, 40]
print("List before swap:", data)
i = 0
while i < data.__len__() - 1:
t = data[i]
data[i] = data[i + 1]
data[i + 1] = t
i = i + 2
print("List after swap:", data)
i. Program:
L1 = ["Delhi", "Mumbai", "Kolkata", "Chennai", "Bangalore"]
City = input("Enter the city you wish to search: ")
if City in L1:
26 Touchpad Artificial Intelligence-IX (Answer Key)
print("The city name you entered is in the list")
else:
print("The city name you entered is not in the list")
j. Program:
marks = [40, 45, 50, 46, 42]
for i in range(5):
print((marks[i] / 50) * 100)
k. Program:
test_list = ['gfg', 1, 2, 'is', 'best']
print("The original list : " + str(test_list))
res_str = [ele for ele in test_list if isinstance(ele, str)]
res_int = [ele for ele in test_list if isinstance(ele, int)]
print("Integer list : " + str(res_int))
print("String list : " + str(res_str))
l. Program:
marks = [45, 75, 90, 50, 88]
for i in range(5):
if marks[i] > 50:
print(marks[i])
4. 1. 15
2. ['G', 'R', 'A', 'M']
['M', 'R', 'O', 'P']
3. 2
1
4. [1, 2, 3, 1, 2, 3, 1, 2, 3]
5. [10, 20, 25]
[10, 20, 25, 30, 40]
Touchpad Artificial Intelligence-IX (Answer Key) 27