Answer:
see explaination
Explanation:
function [] =
inverse(A,B)
da = det(A);
disp("The det of A is");
disp(da);
inva = inv(A);
disp("The inverse of A is");
disp(inva);
x = inva*B;
disp("The value of X is");
disp(x);
rk = rank(A);
disp("The rank of X is");
disp(rk);
Di = eig(A);
disp("The eigen values of A is");
disp(Di);
[V,Di] = eig(A);
disp("The eigen vectors of A are (Each column represents one column vector)");
disp(V);
end
A = [1,2;4,5];
B = [1,2;4,5];
inverse(A,B);
%ab = [num2str(t)," ",num2str(dx)," ",num2str(dy)];
%disp(ab);
B) To help you calculate how much money you have in your account.
Answer:
- import math
-
- def standard_deviation(aList):
- sum = 0
- for x in aList:
- sum += x
-
- mean = sum / float(len(aList))
-
- sumDe = 0
-
- for x in aList:
- sumDe += (x - mean) * (x - mean)
-
- variance = sumDe / float(len(aList))
- SD = math.sqrt(variance)
-
- return SD
-
- print(standard_deviation([3,6, 7, 9, 12, 17]))
Explanation:
The solution code is written in Python 3.
Firstly, we need to import math module (Line 1).
Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).
We can test the function using a sample list (Line 20) and we shall get 4.509249752822894
If we pass an empty list, a ZeroDivisionError exception will be raised.
Answer:
See explaination for the code
Explanation:
def wordsOfFrequency(words, freq):
d = {}
res = []
for i in range(len(words)):
if(words[i].lower() in d):
d[words[i].lower()] = d[words[i].lower()] + 1
else:
d[words[i].lower()] = 1
for word in words:
if d[word.lower()]==freq:
res.append(word)
return res
Note:
First a dictionary is created to keep the count of the lowercase form of each word.
Then, using another for loop, each word count is matched with the freq, if it matches, the word is appended to the result list res.
Finally the res list is appended.
<span>If you match the physical properties of a substance you dont know about to the properties of a known substance, you now know what you've got. For example, if you know that compound X is bright yellow and screams when you poke it, an unknown sample that is yellow and screams that you poke it is probably compound X. trust me, im a dog in a suit.</span>