Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

BDO IN SEM LAB QUESTIONS

Record/ Observation 5M
Writeup 10M
Inference and Analysis 15M
Execution and Results 10M
Viva-voce/MCQ’s 10M

1. A) Write a R program to find factorial of a number


B) Create list for student data with the field’s Regdno, name and year.
- Modify student name for the created list.
- Add DOB field to the student list.
- Delete DOB field from the student list.
C) Create a user-defined function that prints the output 1 3 5 7 9

i. How would you join multiple strings together?


ii. How to convert given string into uppercase in R and find out its length
iii. How do you list the preloaded datasets in R?

2. A) Create data frame for the following data.


Name Language Age
1 Amiya R 22
2 Raj Python 25
3 Asish Java 45
Write a R program to extract 1st and 3rd rows with 1st and 3rd columns for
the above data. 

B) Draw histogram for the following data: weights= 9, 13, 21, 8, 36, 22, 12, 41, 31,
33, 19.
a. Without using xlim and ylim parameters.
b. Using xlim and ylim parameters.

C) Draw scatterplots for the following data : x = (5,7,8,7,2,2,9,4,11,12,9,6)


y = (99,86,87,88,111,103,87,94,78,77,85,86)

i. What is the difference between sort() and rev() function in R?


ii. Give examples of while and for loop in R.
iii. What is the difference between a bar-chart and a histogram? Where would you
use a bar-chart and where would you use a histogram?
3. Write a blind search algorithm such that it works for (1000) ^5 space solutions for a

bag prices task.

i. Define Informed & Heuristic Searchstrategies.


ii. State True or False. Breadth-first search is not optimal when all step costs are equal,
because it always expands the shallowest unexpandednode.
iii. The search strategy that always expands the deepest node in the current fringe of
the search tree.

4. The bag prices is an integer optimization task , that mimics the decision of setting prices
for items produced in a bag factory. The factory produces up to five different bags, with a
unit cost of u. Where ui is the cost for manufacturing product i. The manager at the factory
needs to decide the selling prices for each bag (xi, in $), within the range $1 to $1,000, in
order to maximize the expected profit related with the next production cycle.
Where,
𝑖=1 ∑𝑑 𝑥𝑖 ∗ 𝑠𝑎𝑙𝑒𝑠 (𝑥𝑖) −𝑐𝑜𝑠𝑡(𝑥 𝑖)
F(x)=

Write an R program for bag prices problem implementing Grid search.

i. What is the grid search technique?


ii. What is grid search cross validation?
iii. What does Hyper parameter mean?

5. Write an R program to find the minimum value (i.e. The origin point) in Sphere and
Rastrigin using Monte Carlo search technique.
Where,
F(x)=∑𝑑 𝑖=1 x2(for Sphere)

F(x) = ∑𝑑𝑖=1 𝑥2 − 10𝑐𝑜𝑠2𝜋𝑥𝑖 + 10 (for Rastrigin)


i. Why is Monte Carlo search used?
ii. What are the advantages of Monte Carlo search?
iii. What are the disadvantages of Monte Carlo search?

6. Implement hill climbing search with 8 dimensions and 10 iterations in R by using a


change function which gives the next state, best function which returns the best of
current and next state and a hill climbing function which iterates with the given
number of dimensions and iterations.
i. Brief the process of Hill Climbing Search.
ii. What is meant by heuristic search?
iii. What is Stochastic Hill Climbing?
7. Implement Tabu Search in R by taking control parameters as maximum number of
iterations, length of Tabu list, the number of neighborhood solutions searched at each
iteration, and finally find the best among the neighboring states and the goal state. Take
maximum number of iterations value as 2, length of Tabu list value as 4 and dimensions
value as 8.
i. What is Tabu search?
ii. What is the sequence of stages in three memory scheme in tabu search?
iii. Compare between simulated annealing and Tabu search?

8. Implement an R code for simulated annealing which includes three search parameters –
the maximum number of iterations, initial temperature and the number of evaluations at
each temperature. Also generate new search points. Take 8 dimensions, and control list
which contains maximum number of iterations value as 10 and the initial temperature
value as which performs minimization and gives the optimal value.

Write an algorithm for Simulated Annealing.


i. Where we use Local search Algorithms?
ii. Mention any application of Simulated Annealing Search?
iii. State the differences between the Hill Climbing Search and Simulated Annealing
search?

You might also like