So we'll now use this formula to compute the determinant of B, eventually. So we have a nice formula for determinant of B that works in all its symbol generality. But how do we compute these guys, the inverse matrices, or parts of these inverse matrices. So we actually need just one entry of every search matrix and then how do we compute the inverse here? And to compute Bm inverse, we can use the following symbolic identity power series for VM inverse. These would be the sum, the formal sum for i from zero to infinity, x to the power of i, Am to the power of i. If we formally multiply these series by the Bm, we'll get identity matrix indeed. Let's try that, so Bm is actually the matrix which is obtained by taking identity matrix of order m and subtracting x times Am. And if we take these matrix and multiply it by identity matrix of order m plus x Am, plus x squared. Am squared, and so, we get the product of two identity matrices. Which is identity matrix as well plus xAm times identity matrix, which is the xAm minus xAm, times identity matrix, which is minus xAm, and so on and so forth. So we see that as soon as we have something out of here multiplied by this identity matrix. It would be vanished when it is added with the term, which we get by multiplying these guy with some other term from these clause. And in the end what survives is just the identity matrix. So, this formal series satisfies the properties of inverse for VM. So now let's plug these guys in here and we get the following expression. Now, how do we take this inverse? In the very same way. So we have a product here, the final product of elements of these infinite series and involving matrices. But really, if we formally compute this series, it would be a matrix. But then when we take the element at position 1, 1 of this matrix, this would be just an infinite power series of X. And it will start with 1, because for i equals to 0, we have x to the power of 0, there's just 1, times the 0 power of Am, and this is identity matrix. And the element at position 1, 1 of identity matrix is just 1. So we have 1 plus x times something, plus x squared times something. These formal power series start with just one and when we take product of these types of power series, we also get a power series, which starts with one. So let's denote these guy by 1 plus H of x, where H of X is some power series, starting with terms, at least of the first power of x. And we can check that the inverse for these kind of series, can be computed as 1 minus H of x plus H of x squared minus H of x cube, and so on. Because when we take products of these guy and these guy, we have 1 times 1, which gives us 1, then we have H of x times 1 and minus H of xtimes 1. And so on and so forth. So again, the standard idea helps. So in the end, we can express the thing that we need the determinant of B as this guy, which is the sum for i from zero to infinity. Over the powers of minus H of x, these are the powers of 1 minus these products. Now everything for now seems pretty terrible. Currently, everything seems pretty terrible, because we have infinite summation here, and this summation is of some infinite power series. So it may be cool from the pure mathematics point of view, but what does it have to do with algorithms? But everything here is nicer than it might first seem, because we know what determinant of B looks like. This is what we're searching for and this is actually just a characteristic polynomial of A. Well, at least polynomial with the same coefficients, so that's just 1 minus s1x plus S2x squared. And so, and the last term is minus 1 to the power of n, sn, which is the determinant of A times x to the power of n. So, this is a polynomial and it ends with the nth power of x. But then it just means, that when we expand all these things formally, all the terms involving higher powers effects, they will just vanish. So we do not really need this infinity here because the power of x would be too high. So if we're interested in just powers x up to nth, we can see here and the summation, not at infinity, but at j equal to m. Of course, this will be no longer mathematically correct equality, but if we put these brackets here, and less or equal to n. Meaning that we're only interested in the lower powers of x in this expression, powers of x not exceeding nth, then this would be quite the correct thing. And the same thing we have with this infinity. So again, we can change this infinity to just n, because all the higher values of i will produce the higher power here. And as we know that actually these guy starts not with constant, but with x and then we have x squared and so on. At least, this means that if we're interested only in the lower powers of x, we'll never need more than i equals to m here. So that now we get a finite summation, a finite products, yet another finite dimension, everything is finite in this expression. And this brings us to quite an efficient parallel algorithm for computing all the coefficients of characteristic polynomial of a, logarithm would look like this. Let's first, note that these computation can be done a bit more efficiently, then it's been written down with the mathematicaly. Because instead of first computing the powers of these matrices, then summing them up, multiplied with formal variable x. And then taking the element at position 1, 1 of the result in symbolic matrix, we can do it in different order. So, we can just first for each of these matrices, take the element at position 1, 1. These are just numbers or elements of a field and then we can build a polynomial of x with these coefficients. So our first step would be computing for every m from 1 to n. In parallel, we compute elements at position 1, 1 of all the matrices from Am to the power of 0, through Am to the power of n. This is just identity matrix, so this guy of course is equal to 1. But formally, it's convenience to cover an additional for this, this would be alpha m0 and the last guy would be alpha mn. And we can do this by first computing all the powers of the matrix Am using a parallel prefix scheme. That we have employed formally for designing a carrier look at the other. But this time we can take a matrix Am and take a product of this matrix times itself and compute all the prefixes of these products in parallel. And thus we have efficient computation of all these guys. So now we have ingredients for these polynomial, because these polynomial equals to the sum for j from zero to m, alpha mjx to the power of j. Now we come to step number two, we need to compute these products. The product of the polynomials for which we have all the coefficients already computed at the previous step. So we compute these products for m, from 1 through n of some polynomials of degree at most n. And to do this, we can employ the standard three legs scheme. So a binary tree of multiplications, so we split the guys into pairs, we compute a product of every pair. Then we split the resulting things into pairs and so on. So we get a binary tree scheme computation. And the time required is begle of logan and being the number of polynomials in this product. And if we need the estimate in terms of elementary operations, of course, we need to multiply this guy by the time of computing a product of two polynomials. But to take product of two polynomials, as we are currently taking into consideration the parallel model. We can compute all the coefficients of the resulting polynomial in parallel. Ultimately, the time needed on this step is spoilerific. Next, we have step 3, as soon as in step 2, we have computed this guy. We now essentially know these guy, so we need to take it into different powers to sum it up. So we have some polynomial again, P of x, and we are computing its powers, P of x, P of x squared up to P of x to the power of n. This can be again done, for instance, by employing a parallel bridging scheme or even simpler types of computation. And again, while computing all these things on the way, we do not need to track any powers of x that are greater than n. And then on the fourth step, we are summing these guys up, so we have the zero power of x as well. We sum up these guys into pairs and again, we have a binary d of summations, this step can also be done in point of polylogarithmic time on n. So at the last step, we finally compute the sum for i from 0 to n, in this polynomial P of x to the power of i. And the coefficients of these guy will be the coefficients of the characteristic polynomial of our matrix, including the determinant of the matrix.