Computer Science

Question 11 1 pts Consider two admissible heuristics, h1 and h2. If heuristic h2 is dominated by h1, then you would prefer to use h2 in your A* search. O True O False Question 12 1 pts You did not need to use an evaluation function in Programming Assignment #2 because you could search all the way to the terminal nodes of the 4×4 Othello game tree. O True False Question 13 1 pts Random restarts improve the hill-climbing algorithm by allowing it to explore more of the state space. True O False u Question 14 1 pts Simulated annealing decreases the probability of selecting an uphill move as the algorithm proceeds. O True O False

EXPERT ANSWER Question 11 Consider two admissible heuristics,h1 and h2. If heuristic h2 is dominated by h1, then you would prefer h2 in your A* search. ANS: True An admissible heuristic (like h2) dominates another admissible heuristic (like h1) if, for all states, it gives a higher value. So, if we consider the above two heuristics, …

Question 11 1 pts Consider two admissible heuristics, h1 and h2. If heuristic h2 is dominated by h1, then you would prefer to use h2 in your A* search. O True O False Question 12 1 pts You did not need to use an evaluation function in Programming Assignment #2 because you could search all the way to the terminal nodes of the 4×4 Othello game tree. O True False Question 13 1 pts Random restarts improve the hill-climbing algorithm by allowing it to explore more of the state space. True O False u Question 14 1 pts Simulated annealing decreases the probability of selecting an uphill move as the algorithm proceeds. O True O False Read More »

Create a Vehicle super class and create two subclasses Car and Truck. Extend the two subclasses to the super class to inherit the member variables and methods. Create a Create Vehicle class with the main method to create objects of the two sub classes. Create a class ‘Vehicle’ with states and actions that are common to all vehicles Member variables String color; int noOfCylinders Member methods setColor(); getColor(); set noOfCylinders(); get noOfCylinders(); toString(); Extends Extends Car Class(sub class) Truck Class(sub class) Member variables int noOfSeats; Member variables int towingCapacity Member methods setColor();[Inherits from super class] getColor();[Inherits from super class] set noOfCylinders();[Inherits from super class] get noOfCylinders();[Inherits from super class] setnoOfSeats(); toString(); Member methods setColor();[Inherits from super class] getColor();[Inherits from super class] set noOfCylinders();[Inherits from super class] get noOfCylinders();[Inherits from super class] toString();

EXPERT ANSWER Description: In this program Vehicle class is super class(parent class) of Car and Truck classes. Car and Truck classes are subclasses(child classes) of Vehicle class. ************** PROGRAM ************** Vehicle.java public class Vehicle {// instance variablesprivate String color;private int noOfCylinders; /*** @return the color*/public String getColor() {return color;} /*** @param color the color to set*/public …

Create a Vehicle super class and create two subclasses Car and Truck. Extend the two subclasses to the super class to inherit the member variables and methods. Create a Create Vehicle class with the main method to create objects of the two sub classes. Create a class ‘Vehicle’ with states and actions that are common to all vehicles Member variables String color; int noOfCylinders Member methods setColor(); getColor(); set noOfCylinders(); get noOfCylinders(); toString(); Extends Extends Car Class(sub class) Truck Class(sub class) Member variables int noOfSeats; Member variables int towingCapacity Member methods setColor();[Inherits from super class] getColor();[Inherits from super class] set noOfCylinders();[Inherits from super class] get noOfCylinders();[Inherits from super class] setnoOfSeats(); toString(); Member methods setColor();[Inherits from super class] getColor();[Inherits from super class] set noOfCylinders();[Inherits from super class] get noOfCylinders();[Inherits from super class] toString(); Read More »

Create your own example of a super class with two sub classes inheriting from the super class. Your example must include some common abstract method that allow the use of polymorphism in the test program. Note that all classes must have variables, constructors, accessors, mutators, toString and abstract methods. You example must have a test program that use the created classes and demonstrate polymorphism as well as the implicit and explicit calling of the toString method.

EXPERT ANSWER Summary: I have provided an example of Employee application where the super class Employee holds the basic details of Employee and an abstract method to calculate the paycheck() and sub classes are Hourly Employee and Salaried Employee with the implementation of paycheck() method. I have implemented the above classes in java as per …

Create your own example of a super class with two sub classes inheriting from the super class. Your example must include some common abstract method that allow the use of polymorphism in the test program. Note that all classes must have variables, constructors, accessors, mutators, toString and abstract methods. You example must have a test program that use the created classes and demonstrate polymorphism as well as the implicit and explicit calling of the toString method. Read More »

Assignment: () = using a) In an m-file, write code to find the below feedback system transfer function feedback command; then, plot its unit step response. b) Also do the same symbolically by the method of Laplace transform. First, define symbols: syms s t. Use laplace command to find Laplace transform of unit step: heaviside (t). After finding c(t) by ilaplace command, use fplot to plot the response c(t) for the same length of time as in the plot of part a. Note 1: To force MATLAB to provide a solution for c(t), use this command to force numerical computations: ct – vpa (ct). Put it after finding c(t) by ilaplace command. Note 2: After plotting by fplot use this command: axis auto to get a better view. Controller Plant R(5) # R(S)- O S + 3 S + 2 32+25+ >CC) > C(s) 52 + 25 + 1 2 Sensor c) In your opinion, which method, a orb, is better?

EXPERT ANSWER Answer for Question a: MATLAB code: clc;clear all;Controller_num = [1 3];Controller_den = [1 2];Controller = tf(Controller_num,Controller_den)Plant_num = [1];Plant_den = [1 2 1];Plant = tf(Plant_num,Plant_den)Controller_and_Plant = series(Controller,Plant)Closed_loop_Transfer_function = feedback(Controller_and_Plant,2) step(Closed_loop_Transfer_function)stepinfo(Closed_loop_Transfer_function) MATLAB result: Controller = s + 3—–s + 2 Continuous-time transfer function. Plant = 1————-s^2 + 2 s + 1 Continuous-time transfer function. Controller_and_Plant …

Assignment: () = using a) In an m-file, write code to find the below feedback system transfer function feedback command; then, plot its unit step response. b) Also do the same symbolically by the method of Laplace transform. First, define symbols: syms s t. Use laplace command to find Laplace transform of unit step: heaviside (t). After finding c(t) by ilaplace command, use fplot to plot the response c(t) for the same length of time as in the plot of part a. Note 1: To force MATLAB to provide a solution for c(t), use this command to force numerical computations: ct – vpa (ct). Put it after finding c(t) by ilaplace command. Note 2: After plotting by fplot use this command: axis auto to get a better view. Controller Plant R(5) # R(S)- O S + 3 S + 2 32+25+ >CC) > C(s) 52 + 25 + 1 2 Sensor c) In your opinion, which method, a orb, is better? Read More »

C(s) R(S) using a) In an m-file, write code to find the below feedback system transfer function G(S) feedback command; then, plot its unit step response. b) Also do the same symbolically by the method of Laplace transform. First, define symbols: syms s t. Use laplace command to find Laplace transform of unit step: heaviside (t). After finding c(t) by ilaplace command, use fplot to plot the response c(t) for the same length of time as in the plot of part a. Note 1: To force MATLAB to provide a solution for c(t), use this command to force numerical computations: cct = vpa (ct); ccct = vpa (cct,3). Put it after finding c(t) by ilaplace command. Note 2: After plotting by fplot use this command: axis auto to get a better view. Controller Plant R(S) s+3 s + 2 1 52 + 25 + 1 C(s) 2 Sensor c) In your opinion which method: a orb, is better?

EXPERT ANSWER 3) In first one, you don’t need any separate commands, but fplot you need to mention about variables and 1st one is better if you purely working on control systems projects and signals and systems too… 2nd one is purely mathematical based procedure

1- Show each step of DFS traversal according to the algorithm on the given tree. [starting from the root node placement in external data structure] 1 2 7 8 3 6 9 12 4 5 10 11 2- What is the difference between BFS and DFS algorithms? How can the difference be implemented? 3- Run Dijkstra Algorithm on the given graph. 5 2 3 16 4 3 1 7 4 4 7 12 6 5 10

EXPERT ANSWER 1. DFS or Depth First Search follows depth wise travesal in which the next vertex is remebered using the stack. Rules for DFS are: 1. Unvisited adjacent vertex are visited and pushed in to the stack. 2. If there is no adjacent vertex found, it will popup from the stack and search till …

1- Show each step of DFS traversal according to the algorithm on the given tree. [starting from the root node placement in external data structure] 1 2 7 8 3 6 9 12 4 5 10 11 2- What is the difference between BFS and DFS algorithms? How can the difference be implemented? 3- Run Dijkstra Algorithm on the given graph. 5 2 3 16 4 3 1 7 4 4 7 12 6 5 10 Read More »

QUESTION 4: Mbyte (1024 Kbyte) block of memory is allocated using the buddy system.

QUESTION 4: Mbyte (1024 Kbyte) block of memory is allocated using the buddy system. Show the results of the following sequence in a figure similar to Figure 7.6 . There are four processes P1, P2, P3 and P4 . P1 means process number one . P1: Request 55 K Byte P2: Request 136 K Byte P3: …

QUESTION 4: Mbyte (1024 Kbyte) block of memory is allocated using the buddy system. Read More »

b. Computer users always have the impression that multiple processes are running on their machine. With the aid of a diagram, briefly explain to a novice that this is actually not the case for non-multicore machines.

EXPERT ANSWER Multiple processes do not execute at the same time on a single-processor multitasking system because there is only one processor. Instead, the processor alternates among the processes running at any one time. Multiple processes do not execute at the same time on a single-processor multitasking system because there is only one processor. Instead, …

b. Computer users always have the impression that multiple processes are running on their machine. With the aid of a diagram, briefly explain to a novice that this is actually not the case for non-multicore machines. Read More »