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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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