Question 3.[10 pt]
As indicated in the course book and discussed in the class extensively, there is
generally an efficiency trade-off among execution time, memory usage and communication
overhead for a given algorithm. Please give at least two examples where such a trade-off occurs.
For example, can you give an algorithm example wherein more storage permits faster execution,
or vice versa? Similarly, can you exemplify another algorithm wherein there are trade-offs
among communication and/or memory and/or execution time?
Algorithm Trade-off Example Brief Discussion 1 [5pt]:
Write a paragraph here by explaining the
name of the algorithm and how the performance trade-off.
Algorithm Trade-off Example Brief Discussion 2 [5pt]:
Write a paragraph here by explaining the
5
name of the algorithm and how the performance trade-off occurs.
Question 4. [30 pt]
In this exercise, we start getting familiar withtwo-dimensional arrays, i.e., a
matrix (remember that matrices are nothing but 2D arrays).Matrices are one of the most
fundamental data structures, and they are used in every aspect of Information Technology
including but not limited to AI, cyber-security and software engineering. The most basic
definition of a matrix is here:
https://www.mathsisfun.com/algebra/matrix-introduction.html
Specifically, as an example was given in the above link for 2x2 matrix, you will perform the
most basic arithmetic operation on a matrix,
adding two matrices entry-wise
. Please see the link
below and read
“Entrywise Sum”.
Each corresponding cell in a matrix is added and put into 3
rd
target matrix.
https://en.wikipedia.org/wiki/Matrix_addition
Write a program named “
hw2.py
” that will add two matrices entry-wise. The matrix dimension
is fixed and 5x5 for this exercise. Your program should print an error if the dimensions of the
two matrices are different. In this case, print a message stating that the matrix dimensions does
not match. There are two matrices to be added. One is shown in “hw2-m1.txt”
5 2 0 3 4
2 4 1 1 0
3 0 5 6 1
0 2 6 0 1
4 1 1 0 0
6
The other one is shown in “hw2-m2.txt”
2 0 4 0 1
2 2 1 0 5
0 0 1 0 3
2 1 0 4 1
0 0 4 0 1
Read these two matrices from “.txt” files, and use your own codes to add them,
donot use built-
in functions
. Finally, you should print the result on the screen as
The result is:
7 2 4 3 5
4 6 2 1 5
3 0 6 6 4
2 3 6 4 2
4 1 5 0 1
In: Computer Science
A consulting company was tasked with identifying which market segment would be more profitable, labeled as Segment A or Segment B. A survey was created showing a product to the two different segments, and respondents were asked to rate the product on a scale from 1 to 10 (1 worst, 10 best). Run the correct test using α=0.10 . Which is the correct conclusion?
|
There is no statistically significant difference between Segments A and B. |
||
|
Cannot run this test, data not normal or not enough sample size. |
||
|
There is a statistically significant difference between Segments A and B. |
||
| Segment | Product Rating |
| A | 6 |
| A | 5 |
| A | 2 |
| A | 2 |
| A | 10 |
| A | 9 |
| A | 9 |
| A | 8 |
| A | 6 |
| A | 9 |
| A | 6 |
| A | 5 |
| A | 8 |
| A | 10 |
| A | 4 |
| A | 9 |
| A | 4 |
| A | 2 |
| A | 4 |
| A | 5 |
| A | 8 |
| A | 6 |
| A | 7 |
| A | 7 |
| A | 4 |
| A | 7 |
| A | 7 |
| A | 6 |
| A | 7 |
| A | 10 |
| B | 8 |
| B | 1 |
| B | 3 |
| B | 7 |
| B | 6 |
| B | 5 |
| B | 4 |
| B | 1 |
| B | 7 |
| B | 2 |
| B | 1 |
| B | 7 |
| B | 9 |
| B | 2 |
| B | 1 |
| B | 4 |
| B | 7 |
| B | 1 |
| B | 9 |
| B | 9 |
| B | 8 |
| B | 4 |
| B | 10 |
| B | 5 |
| B | 10 |
| B | 10 |
| B | 10 |
| B | 3 |
| B | 1 |
| B | 2 |
In: Statistics and Probability
|
No Interaction |
Low Interaction |
Moderate Interaction |
High Interaction |
|
2 |
3 |
3 |
9 |
|
4 |
3 |
10 |
10 |
|
4 |
5 |
2 |
8 |
|
4 |
1 |
1 |
5 |
|
7 |
2 |
2 |
8 |
|
8 |
2 |
3 |
4 |
|
1 |
7 |
10 |
9 |
|
1 |
8 |
8 |
4 |
|
8 |
6 |
4 |
1 |
|
4 |
5 |
3 |
8 |
In: Statistics and Probability
Calculate the integrals given below using partial fractions:
a) [int] 1/(x^2 - a^2) dx a is a fixed positive real number
b) [int] 1/(x^4 - 1) dx
c) [int] 1/(x^2 + x) dx
d) [int] 1/(x^2 - 4x - 5) dx
e) [int] 1/(x^2 - 3x - 5) dx
f) [int] exp(x) / (exp(4x) - 5exp(2x) + 4) dx
In: Math
Calculate the integrals given below using partial fractions:
a) [int] 1/(x^2 - a^2) dx a is a fixed positive real number
b) [int] 1/(x^4 - 1) dx
c) [int] 1/(x^2 + x) dx
d) [int] 1/(x^2 - 4x - 5) dx
e) [int] 1/(x^2 - 3x - 5) dx
f) [int] exp(x) / (exp(4x) - 5exp(2x) + 4) dx
In: Math
1. what is the difference between type 1 and type 2 duabetes mellitus?
2. what are the differences between their signs and symptoms of Diabetes mellitus type 1 and 2?
3. Is hypoglycemia ONLY MANIFESTED IN patient who has TYPE 1 Diabetes Mellitus, or could also be for TYPE 2
In: Nursing
find all eigenvalues and eigenvectors of the given matrix
A= [1 0 0
2 1 -2
3 2 1]
In: Advanced Math
Reaction: 1 PbBr2 + 2 HCl --> 2 HBr + 1 PbCl2
How many moles of PbBr2 are needed to react with 2 moles of HCl? Blank 2 mole
How many moles of PbCl2 are produced from 1.23 x 10^28 moles of HCl? The answer is 6.15x10^__ Blank 3
What is the molar mass of PbCl2? Blank 4g/mole
How many grams of PbCl2 are produced from 1.23x10^28 moles of HCl? The answer is 1.71x10^__ Blank 5
In: Chemistry
Find a polynomial p(x) with zeroes at 1,-2, and -1 and such that p(2) equals 6 ?
What is the remainder when the polynomial p(x) equals (x^101 - x^50 - 3x^9 + 2) is divided by (x+1) ?
Find a polynomial of degree 4 with zeroes at -2, 9, and 5. (NOTE: leave your polynomial factored; please do not expand it)
Factor the polynomial x^3 - 4x^2 + 3x + 2.
List all the possible rational roots of the polynomial 9x^7 + 2x^2 - 5x + 10. (NOTE: you are only asked to list them not to factor them)
Solve the equation 2x^3 - 3x^2 - 11x + 6 = 0 given that -2 is a zero of f(x)= 2x^3 - 3x^2 - 11x + 6.
For the rational function f(x)= 2x^2 - 1 divided by x^2 - 9, find the vertical asymptotes, if any. It's horizontal asymptotes, if any. It's X intercepts with multiplicity, if any. It's Y-intercept, if any.
Solve the inequality (X - 3) divided by (X - 2) less than or equal to 0.
Solve the inequality (X + 5)(1 - X) is greater than or equal to 0.
For the rational function f(x)= 4X divided by (x^2 - 4) find its Verticle Asymptotes, if any. It's Horizontal Asymptotes, if any and the end behavior. It's X-intercept, if any. It's Y-intercept, if any.
For the function f(x)= (x - 4)^2 - 1, find the vertex and the x and y intercepts. The equation of the axis of symmetry.
In: Math
Problem 1 [6] Compute the eigenvalues of Hˆ = pˆ 2 2m + 1 2 mΩ 2xˆ 2 + λxˆ using two different methods: 1. Complete the square in 1 2mΩ 2x 2+λx (that is, write the term as 1 2mΩ 2 (x− x0) 2+C with suitable constants x0 and C) and use the exact eigenvalues En = (n+ 1 2 )¯hω of a harmonic oscillator with potential V (x) = 1 2mω2x 2 . 2. Apply second-order perturbation theory in λ
Problem 2 [2] Compute the eigenvalues of the matrix Hˆ = 2 λ λ 3 − 2λ ! and Taylor expand them to second order in the real number λ
In: Physics