Write a program which takes two digits

Assignment Help Computer Engineering
Reference no: EM131188721

I -

1. Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i * j.

2. Define a function which can generate and print a list where the values are square of numbers between 1 and 20.

Write proper doc string for the function

3. Write a program that calculates and prints the value according to the given formula:

Q=√(2∗C∗D)/H

Following are the fixed values of C and H:

C is 50. H is 30.

D is the variable whose values should be input to your program in a comma-separated sequence.

4. Write a program to compute the frequency of the words from the input. The output should print after sorting the key alphanumerically.

II-

PART ONE: Linear Algebra in Python

1) create the vector v=(3,7) and plot it.

# importing future for compatibility between python 2 and python 3

from __future__ import print_function

# importing needed packages

import numpy as np

import pylab as pl

# The dollowing command (it is called a magic command)

# is needed to display plots in the notebook.

%pylab inline

Populating the interactive namespace from numpy and matplotlib

2) modify vector v so as to get a vector twice as long, in the same direction of v=(3,7). Call the new vector vLong and plot it. For this and all following plots also plot the orivinal vector v with a dashed, grey line.

3) create a function, that takes as argument an angle (in degrees) and returns a roatation matrix (also a numpyndarray). Name the function rotMatrix.

defrotMatrix(angle):

4) apply the rotation matrix to the vector v=(3,7) and rotate it by 30 degrees counterclockwise, call this vector v30, and then by 90 degrees clockwise call this vector v90. plot them.

5) Sum the vectors vLong and v90. Plot the original vectors with dashed grey lines and the resulting vector.

PART TWO: Bayes theorem

1. Two connected devices A and B have the following probabilities of failure: P(A)=6% and P(B)=5%, while once second device fails the first one does so with the conditional probability of $P(A|B)=60\%$. a) What is the probability of two devices failing together? b) What is the probability of the second device to fail once the first one did?

2. Given three stocks of devices A,B,C, such that A has 5% of defective items in it, B has 10% and C has 3%, we pick up a random device from a random stock and it turns out to be defective. What is the probability that it came from the stock C?

Attachment:- Assignment.rar

Reference no: EM131188721

Questions Cloud

Americans pay for typical goods and services : Business profits account for nearly one-third of the price Americans pay for typical goods and services. More than 75% of what Americans buy is made in the United States. The United States is a relatively closed economy. Americans are among the mo..
Find the final weight volume and pressure of the gas : find the final weight, volume and pressure of the gas.
Justification for job training programs : Problem 1.2 A justification for job training programs is that they improve worker productivity. Suppose that you are asked to evaluate whether more job training makes workers more productive. However, rather than having data on individual worker..
Identify concerns you feel the bank will need to focus : Identify concerns you feel the bank will need to focus on because of expanding its online banking to mobile devices and opening its international branch office.
Write a program which takes two digits : Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i * j
10 leading causes of death in the world in 2000 and 2012 : Explain how the type of disease influences the 3 levels of prevention (primary, secondary, and tertiary) that should be considered.
Could criminal charges be brought against pestinikas : The state can prove that the 92-year-old man's death was caused by this failure and that the man died of malnutrition and exposure. Under the criminal code of your state, could criminal charges be brought against Pestinikas? What possible charge ..
What that means to your education and your career : This week you learned about personal branding and what that means to your education and your career. Your assignment this week is to define your personal brand.
Determine the number of revolutions made by the wheel : Frictional torque is 2.3 Nm. Using both force and energy methods, determine the number of revolutions made by the wheel in coming to rest. Also determine the time taken (in minutes).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Suggest a significant advantage and disadvantage of

suggest a significant advantage and disadvantage of researching health information on the internet. support your

  Give a detailed rational for choosing bit-mapped

For each of the following give a detailed rational for choosing bit-mapped or vector graphics when they are used in a web based application.

  Lately the gaps in my car had an update they sent me a

write a 200- to 300-word short-answer response to the followingrecently the gaps in my car had an update. they sent me

  Which data structure is the optimum one

When lots of inserts & deletes are involved. When you have no clue about how big the list would grow.

  Questionthink about a cellular system with a total

questionthink about a cellular system with a total bandwidth of 30 mhz. each full duplex voice or control channel uses

  Craft a five pages paper on artificial intelligence

craft a 4-5 page paper on Artificial Intelligence with 4 or more new references (that you find). Choose a particular style for your references.

  Translate those virtual memory addresses to physical memory

You need to read a file of ints that represent virtual memory and then translate those virtual memory addresses to physical memory addresses using a page table and translation lookaside buffer.

  How were the problems with the system missed

How were the problems with the system missed? How might these problems have been foreseen and possibly avoided? In perfect hindsight, given the widespread availability of such systems on the Internet today, what should the company have done?

  Express methods of unit, system, integration

Express each of these testing methods, unit, system, integration, user acceptance and regression testing.

  Questiontwo stacks of positive integers are required both

questiontwo stacks of positive integers are required both containing integers with values less than or equal to 1000.

  What are the serious challenges faced

What are the serious challenges faced when creating in-house software applications and what is the best process of training users on new software.

  Define the line through the maze and avoid obstacles

Program variables (any int, Boolean. or string used in the while program). Everything needed to follow the line through the maze and avoid obstacles

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd