0% found this document useful (0 votes)
4 views8 pages

AI Tools Solution Scheme

The document outlines the syllabus for the B.Tech. III Semester Supplementary Examinations in AI Tools, Techniques & Applications at MVGR College of Engineering. It includes various programming tasks in Python, concepts of AI such as uncertainty and probabilistic reasoning, machine learning types, image processing applications, and object detection techniques. Each question in the exam carries specific marks, and examples are provided for clarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views8 pages

AI Tools Solution Scheme

The document outlines the syllabus for the B.Tech. III Semester Supplementary Examinations in AI Tools, Techniques & Applications at MVGR College of Engineering. It includes various programming tasks in Python, concepts of AI such as uncertainty and probabilistic reasoning, machine learning types, image processing applications, and object detection techniques. Each question in the exam carries specific marks, and examples are provided for clarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Code : A3CHT201 A3

B.Tech. III Semester Supplementary Examinations, April/May, 2025


MVGR College of Engineering (Autonomous)
AI Tools, Techniques & Applications
(CHE)
Time: 3 Hours Max. Marks:
70
Answer any ONE of the TWO questions from Each Unit.
Each Question carries 14 marks

Scheme of Valuation

Q1a: Define Function and write program to find max of two numbers(8M)
A function in Python is a block of code that performs a specific task and is reusable. It is
defined using the 'def' keyword.
Example:
```python
def max_of_two(a, b):
if a > b:
return a
else:
return b

print("Max is:", max_of_two(10, 20))


```

Q1b: Recursive function and factorial program[4M]


A recursive function is a function that calls itself to solve smaller sub-problems.
Example:
```python
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)

print(factorial(5)) # Output: 120


```

Q1c: Built-in Python modules[2M]


Some common built-in modules in Python:
- math: mathematical functions
- sys: system-specific parameters
- os: operating system interaction
- random: random number generation
- datetime: date and time operations

Q2a: Write/read text file example(8M)


To write text:
```python
with open("file.txt", "w") as file:
file.write("Hello")
```
To read text:
```python
with open("file.txt", "r") as file:
print(file.read())
```

Q2b: Return multiple values[4M]


Python allows returning multiple values using tuples.
Example:
```python
def compute(a, b):
return a + b, a - b, a * b

x, y, z = compute(4, 2)
print(x, y, z)
```

Q2c: Usage of 'type' keyword[2M]


The 'type()' function returns the type of an object.
Example:
```python
x=5
print(type(x)) # <class 'int'>
```

Q3a: Inheritance types(8M)


Single Inheritance: One base and one derived class.
Multilevel: Derived class inherits from another derived class.
Multiple: Derived class inherits from multiple base classes.
Example:
```python
class A: pass
class B(A): pass
class C(A, B): pass
```

Q3b: Inheritance example[4M]


Example:
```python
class Animal:
def speak(self): print("Animal speaks")

class Dog(Animal):
def bark(self): print("Dog barks")

d = Dog()
d.speak()
d.bark()
```

Q3c: Immutable structures[2M]


Immutable data types in Python include:
- int
- float
- bool
- string (str)
- tuple
- frozenset

Q4a: List creation and slicing(8M)


List creation:
```python
lst = [1, 2, 3, 4, 5]
print(lst[0]) # 1
print(lst[1:4]) # [2, 3, 4]
```

Q4b: In-built list functions[4M]


- append(): Add to end
- insert(): Add at position
- pop(): Remove last
- remove(): Remove by value
- sort(): Ascending order
- reverse(): Reverse order
Q4c: '+' on tuples[2M]
Tuples can be concatenated using '+':
```python
t1 = (1, 2)
t2 = (3, 4)
print(t1 + t2) # (1, 2, 3, 4)
```

Q5 a) Discuss briefly about Uncertainty and Probabilistic Reasoning in AI. [8M]

Uncertainty in AI refers to situations where information is incomplete, noisy, or


ambiguous. AI systems often have to make decisions under such uncertain conditions.

Probabilistic Reasoning:

 It uses probability theory to model uncertainty.


 Based on Bayesian Networks and probability distributions.
 Helps in estimating likelihood of events.

Example Applications:

 Medical diagnosis
 Natural language understanding
 Robot localization

Q5 b) Define the terms: [4M]

(i) Prior Probability:


The initial degree of belief in a hypothesis before seeing any evidence.
E.g., P(Disease) before a test result.

(ii) Posterior Probability:


Updated belief after considering evidence, using Bayes’ Theorem.

P(H∣E)=P(E∣H)⋅P(H)P(E)P(H|E) = \frac{P(E|H) \cdot P(H)}{P(E)}

(iii) Joint Probability Distribution:


Probability of two or more events occurring simultaneously.
E.g., P(A and B)
Q5 c) What is a knowledge-based agent? [2M]

A knowledge-based agent is an intelligent system that:

 Stores facts in a knowledge base.


 Uses inference to derive conclusions.
 Can make logical decisions based on rules.

Q6 a) Explain Supervised, Unsupervised, and Reinforcement Learning. [8M]

Supervised Learning:

 Uses labeled data.


 Learns a function mapping inputs to outputs.
 E.g., classification, regression.

Unsupervised Learning:

 No labeled data.
 Finds patterns or groups.
 E.g., clustering, dimensionality reduction.

Reinforcement Learning:

 Learns via trial and error.


 Uses rewards and punishments.
 E.g., game-playing AI, robotics.

Q6 b) What is Machine Learning? Explain with an example. [4M]

Machine Learning is a subfield of AI where machines learn patterns from data to make
decisions.

Example:

 Predicting house prices based on features like location, area, etc.

Q6 c) List the main components of the biological neuron. [2M]

 Dendrites: Receive input signals.


 Soma (Cell body): Processes the input.
 Axon: Sends output signals to other neurons.

Q7 a) Explain image processing applications in various fields. [8M]

1. Medical: X-ray, MRI enhancement.


2. Agriculture: Crop monitoring using drones.
3. Surveillance: Face and motion detection.
4. Automotive: Lane detection in self-driving cars.
5. Industrial: Quality control in manufacturing.

Q7 b) Python program to perform threshold operation (OpenCV). [4M]


import cv2
img = cv2.imread("input.jpg", 0) # Read in grayscale
_, thresh = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY)
cv2.imshow("Threshold Image", thresh)
cv2.waitKey(0)
cv2.destroyAllWindows()

Q7 c) List various types of images. [2M]

 Binary Image: Only 0 and 1 values (black and white).


 Grayscale Image: Intensity from 0 to 255.
 Color Image (RGB): Three channels (Red, Green, Blue).
 Indexed Image: Uses a colormap.

Q8 a) Stages in Face Detection using Haar Cascades. [8M]

1. Load pre-trained Haar classifier (e.g., frontalface.xml)


2. Read the input image or video frame.
3. Convert the image to grayscale.
4. Use detectMultiScale() to detect faces.
5. Draw bounding boxes around faces.
6. Display output.

Q8 b) Image processing libraries in Python. [4M]

 OpenCV: Real-time computer vision.


 Pillow (PIL): Image loading, editing.
 scikit-image: Advanced image processing.
 imageio: For reading/writing images.

Q8 c) Write syntax to read an image. [2M]


img = cv2.imread("filename.jpg")

Q9 a) Object Detection vs Object Recognition. [8M]


Feature Object Detection Object Recognition

Definition Locating object in image Identifying object’s class/label

Output Bounding box + location Label of the object

Example Draw a box around a car Recognize it's a “Honda Civic”

Q9 b) When does frame differencing fail? [4M]

 If the object moves slowly (small pixel changes).


 Background changes slightly (e.g., moving curtains).
 Lighting changes rapidly.
 Object and background colors are similar.

Q9 c) Disadvantage of frame differencing in object tracking. [2M]

 Cannot recognize stationary objects.


 Only detects change, not identity.
 Prone to noise and false positives.

Q10 a) Techniques for Object Tracking. [8M]

1. Background Subtraction: Removes background, tracks foreground.


2. Optical Flow: Calculates motion vectors for pixels.
3. Kalman Filter: Predicts future location based on motion.
4. Mean Shift & CAMShift: Tracks the densest region in frame.
Q10 b) Color Space-based Tracking. [4M]

 Convert RGB to HSV or YCrCb.


 Use hue and saturation for object color filtering.
 Apply mask and find contours or bounding box.

Q10 c) What is Mean Shift Tracking? [2M]

 A statistical approach that iteratively moves a window toward the region with
highest density (most similar features).
 Widely used for real-time object tracking.

You might also like