Multiplying N matrices – symbolic calculation

What is the most efficient (quickest) way to multiply 20 identical 6×6 matrices (M)?

N = 20 w = sy.Symbol("w");v = sy.Symbol("v");p = sy.Symbol("p");q = sy.Symbol("q");c = 1;n = 1;nc = 1 M = np.array([[w*p*q,w*q,0,0,0,0],                [0,0,v,0,0,0],                [0,0,0,nc,0,c],                [0,0,0,0,v,0],                [w,w,v,nc,0,c],               [0,0,0,n,0,1]]) Mi = np.array([[w*p*q,w*q,0,0,0,0],                [0,0,v,0,0,0],                [0,0,0,nc,0,c],                [0,0,0,0,v,0],                 [w,w,v,nc,0,c],                [0,0,0,n,0,1]]) for l in range(N-1):     M = np.dot(M, Mi) difZ = sy.diff(Z2,w) expr = w*(np.divide(difZ,Z2)) Z_lamda = sy.lambdify([w,v,p,q], expr, "numpy") 

How can I make the user enter 2 inputs and how can I make some calculation on them(i.e adding and subtracting them)?

I trying to create a c program where 2 positive numbers should be taking in and some calculations process should be made on them like( subtract the second one from the first one, adding the 2 numbers)

I am new user of the program and I have never coded before, however, what I have so far is the order of ” Enter two positive numbers”

int main(void) { printf(“Enter two positive numbers:” ); int input; scanf(“%d&input”);

A way to approch a reasanable answer

Computer Networks, bandwidth calculation

I don’t know if this is the right place to ask this kind of questions, but I’m a little desperate and I can’t find the answer to this Computer Networks exam question.

“A P2P 1000 km connection uses a Idle RQ frame protocol with a frame of 1 KByte. Calculate the bandwidth to use at its maximum the line. Is it possible to increment the bandwidth by incrementing the frame size? Why?”

I’ve tried to reverse the formula for the efficiency calculation by putting U = 1 but it seems to be impossible because the last step turns out to be bw = 0

I also tried to relate the frame size and the bandwidth but that’s something used for the CSMA/CD which is not involved in this excercise

Thank you in advance for your help

calculation of Transitive Closure

This question is not from homework, but rather as preparation for the test:

The calculation of place-in is a calculation in which the algorithm does not need space beyond the output size (beyond beyond a fixed space complexity). Show how, given a graph (E, V = G), the transitive closure can be calculated in-place in the calculation of G * = (V, E *)

I tried to represent the graph using a adjacency matrix. what is the next step?

Calculation of Laurent series and decomposition in partial fractions

So I was asked to find the Laurent series of the expression around z=2: $ $ f(z)= \frac{z+3}{(z-2)^3}$ $

I am aware that this can be decomposed as $ $ 5\, \left( z-2 \right) ^{-3}+ \left( z-2 \right) ^{-2}$ $ Is this the entire Laurent series of $ f(z)$ around $ z=2$ . I am asking because in order to derive this I haven’t even used the fact that expansion is being carried out about 2. If so why?

2019 incorrect week calculation by the standard date format mask

Dear R-support team,

normally I calculate the week of the year by the standard date format mask %Y%W. Till 2019 it worked quite good but last days I’ve noticed that the first week of the year 2019 (2018/12/31-2019/01/06) is shown like the last week number 53 from 2018. And only the week 2019/01/07-2019/01/13 is the first week of 2019. I’ve checked if it’s correct. Everywhere you can see that the week 2018/12/31-2019/01/06 is currently the first week of 2019. And even Oracle knows it ( to_char(…, ‘yyyyiw’) ), but R don’t. At least they should have the same opinion.

It does matter for me and I think it looks like a bug. I’m using R 3.5.0.

Thank you for your feedback

Oracle/Sun Servers lifecycle calculation

In our data center we have following oracle servers-

  • T4-1 SUN Sparc
  • T4-2 SUN Sparc
  • Sun Server X3-2 Some of the servers are currently out of service and some are live. To purchase/service the servers i need to calculate the life cycle of all the servers. I did not find proper solution from oracle website. So my question is how can i can calculate the lifestyle of these servers.

add rows calculation and add/delete rows help

I am trying to make a invoice template that will calculate the total of each row and also be able to add rows and delete rows

I have managed to do javascript that adds new rows but I can't work out how to delete the last row added and also how to calculate each row total and then calculate all the rows total, my coding so far is below

Can anyone help please

<form method="post" action="" name="services">                           <button type="button" onClick="addRow()">Add New...
HTML:

add rows calculation and add/delete rows help

What went wrong in this calculation of number of distributions?

Problem: We have 2 people, and we have 6 objects. We want to find the number of ways that we can distribute these 6 objects such that each person gets at least an object.

My Attempt:

Object 1 can be given to 2 people

Object 2 can only be given to 1 person (the same person who did not get Object 1 to ensure that each person gets at least 1 object)

Object 3 can be distributed to 2 people (since the constraints of the problem is already met)

Object 4 can also be distributed to 2 people (same logic above)

………….

………….

Object 6 can also be distributed to 2 people

Thus, my final calculation comes out to be 2^5 = 32, which is wrong as the answer for the problem above is 62. I’m not sure as to which part did I undercount and where in my working did an error occur? Would greatly appreciate any help, thanks!