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

  How do you include a loop structure programming in python

Explain when we would use each. How do you include a ‘loop' structure programming in Python? How do you control a loop? What you found that was new and exciting that you plan to use personally.

  Prepare a 3 to 5-page report to jan and kim that comprises

jan and kim are considering installing a radius server. prepare a 3-5-page report to jan and kim that includes the

  Compute a discount that customers receive

find a discount that customers receive based on the value of their order. If the total amount ordered is less than $20.00, no discount will be given.

  Discuss other professions aside from health care and

brain saving technologies inc. and the t-health institute medicine through videoconferencing.in a three- to five-page

  Design a basic jsp page

Submit your JSP page along with your screenshots that show what your code has produced

  What occurs in an infinite loop

What occurs in an infinite loop? Create your own Repeat-until repetition arrangement.

  How has the system installed by dtis helped integrate

how did the dtis crm team change the business process for dealing with abandoned vehicles in san francisco? how did

  Linux advanced server vs windows 2003 server

Please give me 10 topic examples that I can select to write about in my class assignment. The example must be able to cover the directions that are listed below.

  Google model of principal cloud computing services

Based on the Barr (2010) article, how can the Google model of principal cloud computing services-similar in function to Windows Azure cloud computing infrastructure-be used as a substitute for on-premises disk management

  Describe python modules and packages

Describe Python modules and packages

  Questionnetworking cis 505select one of the following

questionnetworking cis 505select one of the following topics in that you will base your responses in the form of a term

  What is green computing and green communication technology

What is Green Computing and Green Communication technology.

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