Last time we have considered Gaussian quadrature with two points. So, we had found interpolation points which are the zeros of a Legendre polynomial of degree 2. When we interpolate at these two points by a linear function and integrate the linear function, we get a formula for approximate quadrature and that formula is exact for cubic polynomials. So, we first found the points on the interval minus 1 to 1. So, the Gauss points in the interval minus 1 to 1, those are minus 1 by root 3 and plus 1 by root 3. Next we looked at a 1 to 1 on to a fine map from the interval minus 1 to 1 to interval a b, a general interval and then using this map we defined Gauss formula with two points for the interval a b. We obtained an error formula for this numerical quadrature and then next we looked at composite Gaussian quadrature with two points. So, our interval a b was subdivided into small intervals of length b minus a by n. On each of this interval we applied our basic Gauss formula with two points and then we obtained a composite Gaussian quadrature and the error is of the order of h raise to 4. So, it is same as the composite Simpson's rule with the assumption that our function should be 4 times differentiable. Today, what we are going to do is we are going to define a general Gauss formula. So, now, we had considered only two points. So, now, we will first define what we mean by n Gauss points or n plus 1 Gauss points. The two points minus 1 by root 3 and plus 1 by root 3 they were obtained by looking at three functions 1 x x square and orthonormalizing. So, same idea we will use and we will look at say 1 x x square x raise to x cube and so on. To these functions we will orthonormalize these and then get orthonormal polynomial and the zeros of orthonormal polynomials they are going to be our Gauss points. They will have similar property that if you look at n plus 1 Gauss points, if you fit a polynomial of degree less than or equal to n and integrate then we are going to get a formula for numerical quadrature of the type summation w i f of x i i goes from 0 to n. Now, this formula we expected to be exact for polynomials of degree less than or equal to n, but we will see that it is going to be exact for polynomials of degree less than or equal to 2 n minus 1. So, let us first define the Legendre polynomials and then define the Gaussian quadrature. So, our setting is x is equal to C A B. We have got our inner product, inner product of f and g is going to be integral a to b f x g x d x. Look at the functions f 0 x is equal to 1, f 1 is x is equal to x, f n x is equal to x raise to n and so on. Norm f is going to be the induced norm. So, we denoted by norm f 2 square root of inner product of f with itself positive square root. Then the Gram-Schmidt orthonormalization is g 0 x is going to be equal to f 0 upon norm f 0. Then for n is equal to 1, 2 and so on. Our function R n is function f n minus summation j goes from 0 to n minus 1 inner product of f n with g j multiplied by g j. So, we have come up to the stage n minus 1. So, we have calculated g 0, g 1, g n minus 1. We subtract this term from f n. Now, by very definition if I look at inner product of R n with g k, where k varies from 0 to n minus 1 that inner product is going to be 0. And this is normalization. So, g n is R n divided by norm R n to norm. The functions which we obtain or the polynomials which we obtain g 0, g 1, g 2 and so on, they have this property that when you consider span of f 0, f 1, f n that means look at all the linear combinations of f 0, f 1, f n.  So, this span is same as span of g 0, g 1 up to g n. Now, look at our function R n. In R n, we have got this function f n which is f 0, f n x is equal to x raise to n and then we are subtracting something. Now, each g j, when you consider j going from 0 to n minus 1, it is going to be a polynomial of degree less than or equal to n minus 1. So, f n is x raise to n. We are subtracting a polynomial of degree less than or equal to n minus 1. So, R n is going to be a polynomial of degree n and we are dividing by a constant. So, g n is going to be a polynomial of degree n. So, these g 0, g 1, g 2 up to g n, these are known as Legendre polynomials. So, now, g n is a polynomial of degree n. It is going to have n roots, but what is important is those n roots, they are going to be distinct. I am not going to prove that part, but that is property of Legendre polynomial. So, g n, it has got n roots. Those n roots are distinct and those are known as our Gauss point. So, we will look at the n plus 1 Gauss points, fit a polynomial of degree less than or equal to n, integrate it and then we will get the formula for Gaussian integration. Ortho normality property of our Legendre polynomials g j, it tells us that if you look at inner product of g i with g j, that will be equal to 1, if i is equal to j and 0, if i not equal to j. So, in particular, if you look at g n plus 1, this g n plus 1 will be perpendicular to function g 0, g n plus 1 will be perpendicular to g 0, g 1 up to g n. It will also be perpendicular to g n plus 2, but that part we do not need. So, now, our g n plus 1 is perpendicular to g 0, g 1 up to g n, span of g 0, g 1, g 2, g n that was polynomial space of degree less than or equal to n and hence our g n plus 1 is going to be perpendicular to any polynomial of degree less than or equal to n. So, we have g n plus 1 g j is equal to 0, for j is equal to 0, 1 up to n, span of g 0, g 1, g n is equal to span of 1 x, x raise to n and hence inner product of g n plus 1 with a polynomial a 0 plus a 1 x plus a n x raise to n is equal to 0, for any value of a 0, a 1 a n, a 0, a 1 a n, these are the coefficients, they are going to be real numbers. Now, g n plus 1, it has got n plus 1 distinct 0s. So, let me denote those 0s by x 0, x 1, x n, g n plus 1 is a polynomial of degree n plus 1, let us factorize it, these are 0s of g n plus 1. So, you will have a factor x minus x 0, x minus x 1, x minus x n. So, we have got in all n plus 1 brackets. So, that means that is going to contribute x raise to n plus 1 terms and then the lower order terms, because g n plus 1 is a polynomial of degree n plus 1, here the coefficient is going to be a constant, it cannot be a function of x, because if it is a function of x, then it will be a polynomial of degree bigger than n plus 1, but g n plus 1 is a polynomial of exact degree n plus 1 and it is perpendicular to a 0 plus a 1 x plus a n x raise to n for any values of a 0, a 1, a n and hence we can conclude that x minus x 0, x minus x 1, x minus x n, this is going to be perpendicular to x raise to j for j is equal to 0, 1 up to n. You substitute here, once a 0 is equal to 1, remaining coefficients to be 0, then a 1 is equal to 1, remaining coefficients to be 0, alpha n plus 1, it is a constant. So, it comes out of the integration sign. So, we have got this and this x minus x 0, x minus x 1, x minus x n, this we denote by w x. So, this is a crucial property of our Gauss point. So, g n plus 1 is Legendre polynomial of degree n plus 1, obtained by orthonormalizing functions 1, x, x square, x raise to n plus 1. This g n plus 1, it has got n plus 1, 0s. Those 0s are 0, 0s are 0, 0s are 0, 0s are distinct. So, we denote them by x 0, x 1, x n and then if you look at w x, which is x minus x 0, x minus x 1, x minus x n, it is in a product with x raise to j is going to be 0 for j is equal to 0, 1 up to n. So, using this property, we will show that our Gaussian quadrature is going to be exact for more than a polynomial of degree n. So, now, let us look at the interpolating polynomial. Look at the Lagrange form. So, p n x will be given by summation f x i, l i x, i goes from 0 to n. We have fixed now our interpolation points x 0, x 1, x n. We are fitting a polynomial, we are integrating and then we get the formula of the type w i into f x i, i goes from 0 to n, the summation and then we get the error part. So, the error part it is integral a to b and then two functions. One function is our divided difference of f based on x 0, x 1, x n and x and we have multiplied by w x into d x and then that integral. If instead of the divided difference based on a point x, if we had a divided difference based on some fixed points, then I could have taken it out of the integration sign and use the fact that integral a to b is equal to 0. Now, integral a to b w x d x is equal to 0, because we have got integral w x x raise to j is equal to 0 if j is equal to 0 1 up to n. So, a particular case when we have got j is equal to 0, then that means integral a to b w x d x is equal to 0. This property we can use by replacing our divided difference x 0, x 1, x n, x by a divided difference based on say x 0 repeated twice x 1, x 2, x n plus there is going to be a one more term and that is obtained by using the recurrence formula for divided differences. We have used this method earlier. So, we are going to use it now for this Gaussian integration. So, we have f x minus p n x to be error f x 0, x 1, x n x into w x, where w x is product of x 0, x n x into w x, where w x is product of x minus x 0 up to x minus x n, integral a to b w x x raise to j is equal to 0, integrate both the sides. So, you have integral a to b f x d x minus integral a to b p n x d x is equal to this error term consisting of two parts, one divided difference, another function w x. Now, look at the divided difference based on x 0, x 1, x n, x this using recurrence relation repeatedly we can write this to be equal to f, it is divided difference based on x 0 repeated twice x 1, x 2, x n plus the next is divided difference based on x 0 repeated twice, x 1 repeated twice and x 2, x 3 up to x n appearing only once multiplied by x minus x 0. In the next term x 2 also will be repeated twice and we will have x minus x 0, x minus x 1 and one continues and what one gets is divided difference based on x 0 repeated twice, x 1 repeated twice, x n repeated twice. So, all the interpolation points are repeated twice and then x multiplied by now x minus x 0, x minus x 1, x minus x n that is nothing but our w x and the property of w x is integral a to b w x, x raise to j is equal to 0 for j is equal to 0 1 up to n. So, now you integrate this, so you integrate this multiplied by w x, so I look at this integral that is our error in the numerical quadrature when I do that the first term is a constant. So, it comes out of the integration sign integral w x d x is 0, so there is no contribution from this term. Then the next again the divided difference is constant it is not depending on x and we are going to have w x multiplied by x minus x 0 d x, w x is perpendicular to constant function 1 and function x, so there will be no contribution from this term and like that for all the terms except this last term. So, our integral a to b f of x 0, x 1, x n, x w x d x becomes equal to integral a to b f x 0 repeated twice, x 1 repeated twice, x n repeated twice, x w x 1 w x 1 w x from here, 1 w x from here, so we have got w x square. So, now our error it has got integration of two functions, one function is continuous, we assume f to be sufficiently differentiable. So, we have got divided difference based on x 0 repeated twice, x 1 repeated twice, x n repeated twice, so these are going to be total 2 n plus 2 points and then we have got point x multiplied by w x square, w x square will always be bigger than or equal to 0 and hence the mean value theorem for integration is applicable. So, using this mean value theorem for integration, we can take out the divided difference term out of integration as f of x 0 repeated twice, x 1 repeated twice, x n repeated twice and some point c and multiplied by integral a to b w x square d x and then this term will be equal to as I said we have got x 0 repeated twice, x 1 repeated twice, x n repeated twice, so those are 2 n plus 2 point and this point x. So, here this point x it should be equal to point c because we are taking it out of the integration, this is some fixed point and that is going to be equal to 2 n plus second derivative of f evaluated at some point c upon 2 n plus 2 factorial and then integral a to b x minus x 0 square x minus x n square d x. So, we have a formula integral a to b f x d x is equal to summation w i f x i, i goes from 0 to n. So, it is based on n plus 1 points, the error is it contains 2 n plus second derivative of our function which will mean that if our function f is a polynomial of degree 2 n plus 1, then the error is going to be equal to 0. We have considered the case n is equal to 1, we have got x 0 and x 1, in that case there will be no error provided f is a polynomial of degree 2 n plus 1. So, n is equal to 1 that means cubic polynomial. So, this result it can be generalized and we have got x 0 and x 1 is a way to choose our interpolation points such that you are interpolating the given function at n plus 1 points. So, that means you are fitting the polynomial of degree n, but the error is 0 for polynomials of degree less than or equal to 2 n plus 1. Now, this integration at Gauss points. So, it comes out to be equal to modulus of the error is less than or equal to, there will be norm of f 2 n plus 2 infinity norm, then you will have integration of this. So, the integration it will definitely have a term b minus a raise to 2 n plus 3, each of this I can dominate by b minus a. So, I will have b minus a raise to 2 n plus 2 and then integral a to b. So, that is how you get b minus a raise to 2 n plus 3 and some constant. Now, one can find more precise bound by integrating this like not dominating it by b minus a, but you can integrate that is what we have been doing. So, you integrate, but anyway the error for the Gaussian integration is going to be less than or equal to this. So, now, we have defined Gaussian quadrature for a general case like looking at the n plus 1 point. Now, the question comes whether this is going to converge for all continuous function. So, that means you look at our set of points, they are going to be always Gauss point. We have looked at already Gauss 2 points. So, those were our 2 points in the interval a, b. Now, you look at 3 Gauss points. So, they will be something different. So, like that if you choose your Gauss points as interpolation points, fit a polynomial, obtain an approximate formula for integration, whether it will converge to integral a to b f x d x as n tends to infinity. Please note that we are not looking at composite rule. Now, we are increasing the degree of the polynomial. We already know that our polynomial p n x, no matter how you choose your rules, there always exists a continuous function for which the interpolating polynomial does not converge to f in the maximum norm. Now, the convergence of p n to f, that is a sufficient condition for convergence of numerical quadrature formula. It can happen that even though the polynomial does not converge to f for all continuous functions, our numerical integral can converge to integral a to b f x d x. Now, this is what happens in the Gaussian quadrature rule and it does not happen for the Newton Quotes formula when you are looking at our set of points to be the equidistant points in the interval a, b. In the interval a, b, we want to look at n plus 1 points. So, in case of Newton Quotes formula, we look at those points to be equidistant points and in case of Gaussian quadrature, we will take them as the Gauss points, which are the zeros of the Legendre polynomial. Now, to prove the convergence of numerical quadrature to integral a to b f x d x, we want to look at f x d x. There are going to be two terms, two facts crucial. One is, we are going to show that our weights in the Gaussian integration, they are always bigger than 0. So, this is the first one and the second one is the Weierstrass theorem, that any continuous function can be approximated by polynomials in the maximum norm. So, using these two results, we are going to show that Gaussian quadrature converges to integral a to b f x d x as n tends to infinity, where n plus 1 are our interpolation point. So, let us show that the points or the weights in the Gaussian integration, they are always bigger than 0. Now, so far, when we were writing a numerical quadrature formula, we were writing summation w i f x i, i goes from 0 to n. So, as such our w i and x i, they depend on n. Like look at equidistant points. In the case of equidistant points, we had got first two points, which are the two end points a and b. Then the next case was a b and a plus b by 2, but the case after that, when we want to consider four points, our points will be a b and then two points, which are the two points are at a distance b minus a by 3. So, if we want to be specific, we should have written our x i's to be depending on n and our weights also depending on n. In that case, so far what we have been doing is, we have been fixing the degree of the polynomial. So, that is why in order to not to have notation to be cumbersome, we wrote w i and x i with dependence on n understood or it is implicit. Now, we are going to change n. So, let us be more precise with our notations and then let us write this as w i depending on n and x i's depending on n.  Here, still I have not written the dependence on n, but afterwards when we are going to look at the convergence, that time we will write it explicitly. So, at present I am writing w i with understanding that it depends on n. How do we obtain w i's? We look at the interpolating polynomial p n, look at their Lagrange form. So, that is summation f x i l i x i goes from 0 to n, integrate it f x i's are constant. So, they come out of the integration sign and integral a to b l i x d x is that is our w i. These Lagrange polynomials, they have property that summation j goes from 0 to n l j x is equal to 1. This was one of our tutorial problem that the Lagrange polynomials when you add them up, then they are equal to 1 and hence I write w i as integral a to b l i x d x multiplied by 1. So, that 1 I am writing it as summation j goes from 0 to n l j x d x. Let us split this sum as when j is equal to i and the remaining terms when j not equal to i. So, w i is integral a to b l i square x d x plus summation j goes from 0 to n j not equal to i integral a to b l i x l j x d x. What we are going to show is this term is equal to 0. If we can show that this term is equal to 0, then w i will be strictly bigger than 0 because it will be integral a to b l i square x d x. So, that is the idea and in order to show that integral a to b l i x l j x d x is equal to 0, we will use the fact that our interpolation points those are not any points in the interval a b, but those are some special point. They have the property that when you look at w x which is x minus x 0, x minus x 1, x minus x n, this w x is perpendicular to functions x raise to j, j going from 0 1 up to n. So, using this property let us show that integral a to b l i x l j x d x is equal to 0, if i not equal to j. So, we look at the case when i not equal to j l i x l j x. So, the definition of l i x is product k goes from 0 to n k not equal to i x minus x k divided by x i minus x k. Similarly, l j x will be product say l goes from 0 to n l not equal to j x minus x l x j minus x f. If you do not write like the same notation l it can be p, it is just a domain x. So, this is product of l i x into l j x. So, look at the first product, the first product contains all x minus x k except k not equal to i. In the second one we have got x minus x l all the terms except when l not equal to j, because we are assuming that i not equal to j the term x minus x i will be there. So, I take the term x minus x i and join with this. So, what I will have will be x minus x 0 x minus x n including the term x minus x i divided by the product k goes from 0 to n x i minus x k upon for k not equal to i. From here I am taking the term x minus x i divided by x i minus x l. So, that term will be x minus x i is absorbed here. So, here this term should be equal to x j minus x i, because we are putting l is equal to i. Now, from this product the term l is equal to i we are associating here. So, this product becomes l goes from 0 to n l not equal to j l not equal to i and then x minus x l x j minus x l. The numerator x minus x 0 x minus x n is going to be our function w x. The denominator is a constant and now look at this term this has got n minus 1 brackets, because total there are n plus 1 brackets and 2 brackets are not there. So, it is going to be n minus 1 brackets. So, it is going to be a polynomial of degree n minus 1. So, we have got our l i x into l j x to be w x divided by the product k by some constant and multiplied by a polynomial of degree n minus 1. We are interested in showing that integral a to b l i x l j x is equal to 0 for i not equal to j. So, let us look at integral a to b l i x l j x d x that will be equal to integral a to b w x by some constant c multiplied by q n minus 1 and use the fact that w is perpendicular to q n minus 1. So, since x 0 x 1 x n are Gauss points w x into q n minus 1 x d x is going to be 0 and l i x is a polynomial of degree n. So, it cannot be identically 0.  So, it is a very important property of Gaussian integration that the weights are always bigger than 0 and using this property we are now going to show the convergence of Gaussian integration when we are considering the interpolating polynomial based on these Gauss points. Our proof it is going to be based on the weights are bigger than 0, then the Weierstrass approximation theory property and the third property is that in the Gaussian integration there is no error provided your function is a polynomial of degree less than or equal to 2 n plus 1. So, look at the function f to be continuous function. Let us introduce the notation i n f to be summation i goes from 0 to n w i n f x i n. So, now, I am denoting the dependence on n and there is no error or the integral a to b f x d x is same as i n f provided f is a polynomial of degree less than or equal to 2 n plus 1. So, as a special case if I take f x to be equal to 1 then integral a to b 1 d x is going to be equal to b minus a and i n for that function will be summation i goes from 0 to n w i n is equal to b minus a. Now, our claim is that i n f converges to integral a to b f x d x as n tends to infinity. So, the first thing is Weierstrass theorem.   When you look at q m to be a polynomial of degree less than or equal to m and here you are looking at i n. So, we have got n point when we have got n points the formula is exact for polynomials of degree less than or equal to 2 n plus 1. So, that is how I get that if n is bigger than or equal to m minus 1 by 2 then integral a to b q m x d x is equal to i n q m. This is our first step in the next step we want to show that modulus of integral a to b f x d x minus i n f it is going to be less than epsilon or constant times epsilon.  So, I add and subtract that and then I get this.  So, that is summation j goes from 0 to n w j n q m x j n and w j n f x j n. Now, since our w j n are bigger than 0 I do not have to write modulus here otherwise we have to write the modulus.  So, what is left is summation j goes from 0 to n w j n and that is equal to b minus a. So, you get this to be less than 2 epsilon into b minus a. So, for a fixed epsilon we have found n such that if n is big enough i n f is going to converge to integral a to b f x d n. So, this is convergence in Gaussian quadrature. So, now, what goes wrong with the Newton Quartz formula? Why cannot I use the same argument? Like I start with f belonging to C a b and then in case of Newton Quartz formula I am going to have n plus 1 interpolation point n plus 1 interpolation point it is going to be exact for polynomials of degree less than or equal to n. So, this is the difference that for the Gaussian quadrature we had exactitude for polynomials of degree less than or equal to 2 n plus 1, but that should not matter because anyway I want that modulus of integral a to b f x d x minus i n f should be less than epsilon when n is big enough. So, may be in Newton Quartz formula I will have to choose n bigger than in the Gaussian quadrature and for convergence that does not matter. What we want is given epsilon for n large enough modulus of integral a to b f x d x minus i n f should be less than epsilon. So, let us see where our proof breaks down. So, we have equidistant points and then our quadrature rule is going to be exact for polynomials of degree less than or equal to n. So, our fix our function f and let us calculate or let us find a q m.  So, integral a to b q m x d x will be equal to i n q m provided n bigger than or equal to m in case of Gaussian quadrature we had n bigger than or equal to m minus 1 by 2. So, I have only for n bigger than or equal to m. I look at modulus of integral a to b f x d x minus i n f I add integral a to b q m x d x add and subtract.  So, we have got this term to be less than epsilon into b minus a then look at the term i n f minus i n q m this will be summation j goes from 0 to n w j n f of x j n minus summation j goes from 0 to n w j n q m x j n. So, by triangle inequality this is going to be less than or equal to summation j goes from 0 to n mod w j n and modulus of f x j n minus q m x j n this term will be less than or equal to epsilon and you have left with summation j goes from 0 to n mod w j n. So, here is the crucial difference for Gaussian quadrature this modulus of w j n was same as w j n. So, we had here summation j goes from 0 to n w j n and that is equal to b minus a in the Newton quotes formula also summation w j n is going to be equal to b minus a that fact still remain, but in our error formula what is coming into picture is summation mod w j n and in case of Newton quotes formula the our weights they are going to be of mix sign that means they can be both positive and negative and that is why the there is no convergence if you choose your points to be equidistant points and hence we went to the composite numerical quadrature in case of equidistant point or the Newton quotes formulae we had special cases as trapezoidal rule then Simpson's rule and then we can write higher degree. Whereas, for the Gaussian quadrature we have got convergence we have a choice we can increase the degree of the polynomial. So, instead of considering the composite rules we can look at the higher degree polynomials and then get a numerical quadrature formula. So, if your function f is sufficiently smooth then it is worthwhile to apply Gaussian integration of higher order than composite say trapezoidal or composite Simpson's rule because the speed of convergence is going to be very high for Gaussian integration. So, if your function f is sufficiently smooth then one should use the Gaussian integration of higher order. Now, let us look at what are the disadvantages of Gaussian integration. Gauss two points in the interval minus 1 to 1 which we obtained they were minus 1 by root 3 and 1 by root 3. Similarly, the higher order Gauss points they are going to be irrational. So, that seems to be a stumbling block that one prefers a simple Simpson's rule. But then when you are writing a program that should not be a stopping thing because the Gauss points and Gauss weights for higher degree polynomials or for general case the tables are available. So, initially may be while writing the program it is a bit more problem, but afterwards it pays off. Now, another drawback here is that suppose I have got Gauss two points. So, I get minus 1 by root 3 and 1 by root 3 in the interval minus 1 to 1 I calculate. Now, I find that the accuracy is not good enough. So, I go to 3. When I look at three Gauss points then whatever work we have done for two Gauss points that is lost that is one of the disadvantage of the Gauss point. But as I said that if your function is sufficiently differentiable then in Gaussian quadration we are going to get a very fast convergence. So, in our next lecture we will consider Romburg integration and then we will solve some problems. So, thank you.


Live from Las Vegas, it's theCUBE, covering Oracle Modern Customer Experience 2017. Brought to you by Oracle. Welcome back here, when we are here live in Las Vegas, the Mandalay Bay for Oracle's Modern Customer Experience Conference. I'm John Furrier with my co-host, Peter Burris, with theCUBE, and our next guest is Brian Curran, Vice President of Strategy and Design with Oracle Cloud. Great to have you on theCUBE, welcome to theCUBE. Thanks for having me. So you're a design and strategy person, you've been in the art and science of designing experiences, not so much technology, fastest port, fastest server, and yet innovation is the number one thing people talk about in the digital transformation, certainly that's happening, but it's hard when you have all this legacy stuff, process, people, well that guy does that, that's his job over there, and this guy runs it over there, so that's all coming together as we were talking about on our intro, Peter and I were talking about that. How do you get at the innovation when you engage with customers, when you walk in the door? It's funny, it's still a dirty word in company's innovation, right? I mean people are scared of it, because I mean the fancy word is innovation, the real word is change, and now you want to make changes in an organization, and it's scary for people, and what I really do is I try to spend time with them trying to get them to understand that this is an art and a science. The science part is usually when you start first because I'm trying to get them to kind of go through the discipline of what it takes to do that, and it's really about getting the right people involved in that, and so I really try to spend my time saying look, let's find something really small to go work on, let's find a little problem that maybe you have, and let me show you the art and science of getting from that understanding of the customer need all the way to, hey I've got a way to actually solve that and we'll drive results from the business. It's interesting the psychology of the customer is under a lot of stress, because as you said it's a dirty word to innovate because it means change, but now it's interesting with cloud, you're seeing some of these technologies out there, there's more pressure on top of that speed, they have to do it faster, so now you have a speed game going on, and then agility and all these things that people are seeing as use cases that okay people are getting things right, but what do I do, and this is a lot of pressure point. How does that add to the complication when you have to come in and say, okay we got to change, we got to do it fast, your roles might change, and how do you take that, how do you walk through that? First of all, when you talk about the trends and the changes, what it's driving is these increased expectations, so customers are dealing with an Amazon, then they're coming back to another brand and say hey, how come your experience is not like Amazon? So companies feel that pressure right now and they realize they can't wait six months, 12 months to go make that change, they've got to make it like in six weeks or 12 weeks, and so one of the things I'm a big believer is in rapid prototyping, get your point to a test where you can actually get it out of the market, so how do you frame something to really understand in a couple of days, how do you ideate in a couple of days, how do you get everyone to understand what you're trying to do in a couple of days, and eventually you get to a point where maybe five or six weeks before you're driving at that point, but the old days of going hey, let's have a big strategy session and then we'll come through stuff in three to six months and nine months from now, but then you're out of business, so we're really focused on trying to get people to understand it is about speed, it is about understanding, and get to that point. But it comes back to the customer, ultimately the design point is what experience do you want the customer to have with you, so in many respects the challenge is the customer does things, and they does, and in a B2B setting they do things with a lot of other folks in their organization, and they do things with the seller, in a B2C sense it's by themselves, but they do things and they move through this different context, what they do together, how do you help companies get focused on that singular element, it's what the customer is trying to do and how you want them to invite you to do it with them, so to me there's a journey, there's a step by step process that the customer goes through in order to fulfill their need, and so it is about understanding that interaction, that engagement, and determining whether you're actually meeting the customer's need at that moment, do you understand the context, do you understand the expectations, do you have all the things that you need in order to understand that moment, but once you've chosen that moment, now what you really focus on is a value equation, how do I fulfill that need in a way, drive that experience, that perception, that changes the customer's attitude, so they think differently, that ultimately drives a different behavior from the customer, that leads to a result that's different for the business, so businesses need to understand that value equation, your job, number one job, is to fulfill customer's needs, and I'm not talking about just the end need, but the need at every single moment along that life cycle, and if you can understand and fulfill that need, you can understand how to deliver your results, then it's just about plugging that formula in to get that done. So a question that I have for a lot of design folks, and it's kind of a big question, but it ties back into some of the trends we're talking about. The cloud, which is this thing that presumably allows companies to be in a lot of different places, with at least a digital presence, has been instrumental in presenting services to the communities, to a lot of communities in new ways. To what degree do you think the cloud, which, and design thinking are reinforcing each other? By that I mean, design thinking gets a business to focus on what's the value in use, and the cloud is presented as a service, not as a product. So is design thinking the cloud helping to move us from thinking about products to the services that they provide overall? Yeah, I would say design thinking first came out to actually drive product design, but now it's starting to drive experiential design. The thing about the cloud is that I can quickly go from rapid prototyping to putting it right in front of customers, where before using legacy, on-premise capability, it would take me months and months to stand up something that I wanted to go do. So I think we're at the beautiful time for design, right? Is that all the disciplines around design, the ability to really understand the customer, to have that empathetic understanding, to actually design experiences that are very relevant to that customer, but now to be able to actually take that experience and go multi-variant, A, B, test it immediately, not months from now, but like days from now. And to get that learning, because part of great design thinking is not just the first iteration. When I think design thinking, I'm also thinking service design, lean, agile. So I get the ability to take my minimal viable experience, not minimal viable product, get it in the market very quickly, get the learning from that, come back and make that iteration, put it back out in the market again. So the cloud allows you to do that on the fly, where before you couldn't drive at that kind of speed. Talk about the commitment level, because that's a commit that they have to make organizationally to... To fail? Well to be ready for the iteration, because you're throwing something out there but it's also, I mean some people just got to get over the, hey the parachute will open. Yes. You know, kind of get over that fear and then once they're there, they have to commit, they can't just leave it there. How do you walk through that with the customer? Because that to me, I think, is the trend that I see, maybe it's different across different customers, but it's the same organizational commitment. You got to stop thinking about projects and you got to start thinking about learning and engaging. And so for me, the process is really about going, hey can I design something? Can I actually test it very quickly? Can I learn? And learn to me is fail. I mean, I was involved in building the first Apple store. I will tell you the first Apple store was a complete failure. And it was the best learning that Apple could ever get in order to be able to use to build the next store, which was a much more successful piece. You have to build that in your DNA that says, if I'm fast, then I can actually reduce my risk. I can get to a point where I actually be able to learn very quickly and then I can go make that change come in place. That's great. I got to ask you a question in terms of customers because this is awesome. You have a lot of experience with the customers. What's the pattern that emerges as you go out and look at the transformational heroes out there that are taking the transformation from and the evolution of that? Is there a pattern that emerges? They kind of get nervous at first and they snap in line here and then things kind of happen. Can you share what you've seen as a pattern?  And they're so passionate about what they want to do. They're willing to actually kind of push the envelope. What I find is that's the innovator. That's the guy. And by the way, usually not up high, usually down around the middle of the company. Now, when they run into someone who on high also is passionate about the change but not sure how to do it. When the two of them come into combination, that innovator who's passionate and that leader who understands they need to build that DNA, what I find is when those two come together, that is the pattern for success. So bottoms up, tops down, innovation is really what works the best. I also find that the people who actually embrace discipline, embrace design thinking, embrace all of those aspects but also have the arty kind of, hey, let's try some new things. Let's be willing to kind of put our nose out. I find the stodgy people who are not willing to make the change are the ones who actually just get stuck and we've seen those companies all go out of business, right? So the people who are willing to be leading edge. What's great is though if you see really great leaders, they're also willing to be credible and authentic and get in front of audience and say, I designed this, it was a failure. I'm willing to actually now go do the next thing. And we see this from great leaders from Starbucks on. That way I tried to do a bar in Starbucks and actually it didn't work. So we're going to go on to something else. But doesn't it also, I mean, I agree with you totally, Brian, having studied this a lot myself over the years. But it also means data, that you have to build measurement into everything. Because the innovator doesn't get acknowledged or recognized by the leader if there isn't some data that transmits a message. You don't realize you're failing if you don't have data that alerts you early before you double down and triple down and quadruple down on a bad idea. So how does the science of design thinking come into play here? Because it's the designing in the measurements, the changes that become so crucial to actually moving us from just a good idea into something that actually manifests change. To me, the value equation is the first thing you work on, which is the math. I need to understand the customer's needs and I need to understand the results that you're getting to. So I need to understand the attitudinal, the behavioral, the operational, the execution, all of those measurements. So financial measurements, customer measurements, all those pieces. That data is crucial. I don't start, by the way, on any innovation projects till we have a current state understanding of that. The design is actually about how do I get that movement? How do I get that attitudinal, behavioral, operational, execution, financial movement by the design of what I'm doing? So data actually becomes more crucial. What's great too about the cloud is that I actually have more access to data that I didn't have access to before and the data is in the hands of the innovator. Not some other group. I don't have to wait a long time for analysis so I can literally go, here's our current state. Let me go do AB multivariant testing. Wow, I got this change right here. Look at the pattern of behavior that I'm getting from customers. Now I say, okay, that's working. We will eventually get the results and the fear for businesses in some cases, they need the financial result immediately but now what we can say is actually if you watch this track of behavior, you'll eventually get to the results. So if you're getting the behavioral change, you're actually heading the right direction. With risk management too, to your other point. So there's also a piece of don't just jump to where's the ROI? Correct. To, no, you're going to get there. Well, we're talking about things like advocacy and retention and these are loyalty. These are long term behavioral things. So you actually have to even go even further up and start measuring attitudinal. Am I getting the movement for customers of how they talk about our brand and how they talk about engagements? That will eventually lead to the behaviors that I want will eventually lead results. So there is a leap of faith here that says if you understand the formula you should be able to actually drive the outcome by understanding the pieces across the formula. But the good news is that by doing a better job of management, by having a disciplined approach to thinking about design, how it leads to innovation and getting leadership in place, you actually look at risk management as a way of thinking about what options am I going to buy in the future by failing now. So I've learned something that says, well, so now that group of options, we're pairing off. We still have this group of options. Let's pursue this group of options. Oh, something didn't work. Let's pair these options up. And each time the risk of movement, of action goes down. Well, the speed of it does too. So time actually costs money, right? So if I can make quick bets, I can test them very quickly and I can determine what I should scale and what I should not scale. It's actually cheaper to de-risk that piece that way. Yeah, this is an interesting point.  Whether it's the person in the trenches who gets the data and makes the discovery and the innovation to the executive. But one area that we've seen is, and certainly this is always talked about at the conferences and the stages, the no manager, they're looking for ways to say no. Right. Then there's the guy who says, look up to get to the yes. Yes. Take me through your experience on that because if you see, you have to know, you have to get to yes. Correct. You have to find that person that's looking for yes. Correct. In our process, by the way, we go from framing to ideating to share. And in share, we believe that showcasing is really important. The ability to actually put your idea in front of someone the right way. But when people say no, they spell it NO, and I always spell it K-N-O-W, right? Most cases that leaders say no is because they don't actually have enough information. So if you've framed, you really understand the customer, and you've done a really good job of ideating, and you're really putting some good proof of concepts together and getting them validated internally and externally, and you've done the disciplined work, by the time you get to a decision, you should be able to give enough of that K-N-O-W to get that leader to move in the direction. Yeah, because they're looking for information, they're looking for, they're looking to learn. Which means that you want an informed yes. Correct. You don't want the, because if you don't get the informed, yes, you're not getting the leader. You're really not getting the leader. Correct. You're getting rubber stamping. But leaders ask great questions, right? That's right. And they're looking for other people to have the answers, and they want to make sure that they went to the process. So when you bring me an ROI model, I want to say, well, wait a minute, how'd you put this together? How do you know that actually is going to get the increase? And I back them up to, well, wait a minute, here's the customer's attitude, and here's the behavior, and here's how I measure it. Okay, look at, you have to, well, how do you know it's going to cost this much? I went to every activity resource partner, I've determined what I believe it's going to take. If you're doing the discipline work along with the artwork, you have a much better chance of actually getting things done.  So for leaders, I'm thinking, don't make scale decisions, make test decisions, make very small little bets, very quick rapid prototyping, and then make scale decisions based off of those tests. Now you've de-risked the whole project. Well, you get clear visibility on what will the flywheel be for the scale, get the visibility on the metrics and unit economics, or whatever you're. All right, so final question since we got the wrap up is, what's the coolest thing that you've seen or been involved with with a customer? It could be an aha moment, it could be, you walked into a train wreck and then you cleaned it up, or big discovery or big innovation. So I try not to share too many of the individual customers I'm working with, I'll give you a story, I was in the Middle East, the customer that I'm working with, they were looking at, it's a communications company, they were looking at their bundling process of how do I sell wireless and broadband at the same time. So after going through the whole customer ethnography work and framing it, they realized that what they were doing is actually selling two silos that didn't make any sense. The customer just wanted connectivity. They didn't care whether it was broadband or wireless or anything, so they started thinking differently, which was maybe we should step back from this and actually stop trying to bundle or special pricing based off of the bundle, but let's just sell connectivity. Let's just do away with the whole thought process that is actually two different things. And it worked? They're in the process of actually doing that design. I thought you might say, well, here's how the American companies do it, do it the exact opposite. Yeah, well, yeah, because let's face it, the process is not right, but they actually got to the point, and by the way, we didn't come in with okay, here's the idea that you should go do. They came to a conclusion that said, it's not unified billing, it's unified delivery of fulfilling the need. The customer's need is not broadband and wireless. The customer's need is connectivity. If that's the need, we should be fulfilling that and not thinking about the duck below the water of whether that's broadband or this and that. That's a great point. A lot of companies just stay in their product lanes and say, buy the products, not what they want. Focus on the service. All right, all right. We are, Brian Curran here inside theCUBE, really laying out some great insight into the design, thinking, the role of the innovative, the role of the organization. Congratulations on all your work. Great insight here on theCUBE, appreciate it. Thanks for sharing the data. We learned a lot. We're going to iterate more of the great interviews coming up from Oracle Modern Customer Experience after the short break.


T F N N headline news update Good afternoon everybody I'm Tommy O'Brien comedy live from T F N N headquarters in St. Petersburg, Florida 1 p.m. Eastern time on Friday three hours left to go in the trading week and we got markets finishing it off on positive territory Dow Jones up 199 points trading at 25,908 S&Ps currently positive by 21 trading at 28 33 you get the NASDAQ up 75 points or almost a full percent trading at 7706 Dollar index negative 200 ticks trading at 96 040 notes and bonds higher price lower yield ten-year note up seven ticks 122 29 30-year bond up 18 ticks 14602 gold contract up $7 at 1302 80 and as we started off we're gonna jump over to those rates, so we're looking at the ten-year here We're gonna put this on the last year just for perspective So right now you're looking at a yield of 2.596 over the last 12 months the low end 2.553 the high end 3.237 we are right near that lower end as we got notes and bonds higher price lower yield Jumping over to the futures market. We'll start it off with the Dow quite an acceleration starting at about 1045 this morning You have the Dow trading from 2682 we're now approaching 260 points above that level with the Dow trading 25,940 little bit of that having to do with Boeing getting a pop and Why not we'll jump over the story So you got Boeing shares rising on a report that the 737 max fix could come sooner than expected We'll see if that becomes a reality But nonetheless NASDAQ 100 quite an acceleration as well early this morning just before the opening bell trading 7285 now up a solid 64 65 points above that little trading 7348 S&Ps trading at 2833 early this morning trading at 2815 Crude oil with volatility in both directions the highs made last night almost up there at $59.58 92 we trade down a solid dollar to 5775 back up there at 5850 Goal contract was up at 1306 just at about 1030 currently trading at 1303 and the good old pound right up against that 133 mark 13292 and to jump over to Boeing Little bit of an appreciation there as you've seen Kind of correlates to your Dow You got the Boeing spike happening right at about 10 past 11 this morning trading all the way from 367 up to 386 now currently 381 Stay tuned folks Steve Rhodes coming up right now with the traders edge. Have a great Friday


Hello and welcome back. In this lecture, we are going to look at the use of assignment expressions. This is a new kind of expressions. We will look at their use in loops and also at other places in C++ programs. Here is a quick recap of some of the relevant topics we have already studied. We have looked at iteration idioms in programming. We have looked at the fact that they are sometimes necessary and they certainly provide a convenient way of programming repetitive actions. We have looked at three different constructs in C++ for implementing iteration. These are the while construct, the do while construct and the for construct. And we have also seen how break statements can be used in loops to jump out from the middle of a loop when certain conditions are satisfied. In this lecture, we are going to take a closer look at for loops. In particular, we are going to see how assignment expressions and its variants are usually used in for loops. And we are also going to look at comma separated expressions and their use in for loops. Now recall from the earlier lecture that a for loop in C++ looks something like this. There is a part of the program before the iteration and then there is a part of the program after the for loop. And in between is your for loop where you use the keyword for. And then there is iteration initialization, loop condition and instructions to execute at the end of every iteration. We use semicolons to separate these three parts. These semicolons do not denote end of executable statements. They are just separating the three parts in this for statement. Since they are just used for separating the three parts, we do not have a semicolon at the end of this last part which are the instructions that are to be executed at the end of every iteration. And of course, this is the main body of the for loop where we can have a block of statements. Now if you look at the C++ standard, it specifies that a for loop must look something like this. Instead of the initialization code, it says that you must have an initialization expression. And instead of instructions to execute at the end of every iteration, it says that you must have an update expression. So, this looks a bit strange. We wanted to do some initialization over here. For that, we needed some statements, but the standard says that we must have an expression here. And here also, we wanted to execute some instructions at the end of every iteration, but the standard says that we must have an expression here. So, does this appear nonsensical? We needed assignment statements both for initialization and update, but the standard says that we must have expressions there. Is this meaningful? What if I wrote a plus b star c for an initialization expression or an update expression? What exactly would be initialized by the value of a plus b star c? What exactly would be updated by the value of a plus b star c? So, at first sight, it looks like there is some difficulty in implementing initialization and updation with expressions. Because it is not clear what is to be initialized and what is to be updated when I write an expression like this. However, in c plus plus, it turns out that we can use the assignment not only as in a statement to actually assign the value of an expression to a variable, but you can also use an assignment as an operator to build an expression. And when we write such expressions with the assignment operator, these expressions have side effects which are the actual assignment as it happens in an assignment statement. So, let us look at an example. Suppose I have this assignment x assigned y plus z. If I put a semicolon after this, this becomes an assignment statement and the value of the expression y plus z is evaluated and this value is assigned to the variable x. However, if I do not use a semicolon and I want to use this as an expression, then this equals symbol is used as an operator in this expression. So, this becomes an assignment expression using the assignment operator and this expression like any other expression has a type and value, but this expression also has a side effect. The side effect of this expression or the side effect of evaluating this expression is exactly the same effect as you would get if you executed the statement as an assignment statement. So, the side effect here is that the value of the expression y plus z will get stored in the variable x and what is the type and value of this entire assignment expression? It is the type and value of whatever appears on the right hand side of the assignment operator. So, in this case it is the same as the type and value of y plus z. So, now if we go back and look at our four statement, when we write programs like this with a for loop where I say count assigned 1.0 as part of the initialization code and count assigned count plus 1 as part of the instructions that are to be executed at the end of every iteration. I could view this as a statement which is initializing the value of count 1 and I could also view this as a statement which is incrementing the value of count, but remember these semicolons are not to be used as demarcators at the end of an executable statement. They are just separating the three parts of the for loop and these can now be viewed as expressions with the assignment operator and which have side effects and the side effects are precisely the initialization and the increment, but in accordance with what the C++ standard requires us to do, we now have an expression here in particular this is an assignment expression. We have another expression here that is also an assignment expression, but in the process of evaluating this expression we are going to have the side effect where the variable count will be initialized to 1 here and here the value of the variable count will be incremented. So, now you see that when we look at a for statement with count assigned 1.0 and count assigned count plus 1 here these are not really assignment statements, they are assignment expressions with side effects which actually update the values of variables. Now well if you are going to look at assignment as an operator then you must talk about the precedence of the assignment operator.  So, it turns out that the precedence of the assignment operator is lower than that of all the arithmetic and logical operators that we have studied so far. So, in this case if I write this expression plus will have higher precedence than assign. So, B plus C will be evaluated first and then the value of this expression will appear to the right hand side of this assignment operator and then this operator the assignment operator will be evaluated and when this assignment operator is evaluated we have a side effect which is A is assigned the value of the expression to the right hand side of the equal sign which is B plus C and the type of this entire assignment expression is the type of the expression that appears to the right hand side of the assignment operator. So, therefore, it is the same as the type of B plus C and similarly the value of this assignment expression is the same as the value of B plus C. Now, just like precedence if you want to treat assignment as an operator you also have to worry about its associativity. Now, unlike any of the operators that we have seen so far the assignment operator is right to left associative which means if I write an expression like this first of all plus has higher precedence than assignment. So, A plus 1 is going to be evaluated first now among the three assignment operators because it is right to left associative the right most one will be evaluated. So, this is the assignment expression C assigned A plus 1 that will be evaluated first then B assigned this assignment expression C assigned A plus 1 that will be evaluated next and finally A assigned this entire assignment expression which is B assigned C assigned A plus 1 will be evaluated finally and if you work through the rules for the type and value of an assignment expression that we just discussed in the earlier slide you will see that the type and value of this assignment expression is the same as that of A plus 1. Therefore, the type and value of this assignment expression is also the same as that of A plus 1 and therefore, the type and value of this assignment expression will also be the same as that of A plus 1. Now, just like we had the simple assignment operator there are some special assignment operators that are used in C plus plus. So, for example, we have special increment operators and in fact, there are two flavors of it, post increment which is used like this, you take a variable x and then you put plus plus. So, this plus plus denotes increment and because it appears after the variable x, we call it post increment. Now, when you have an expression like this with the post increment operator, this is very similar to having an expression like x is assigned x plus 1. The only difference with this expression is that in this case, the value of this expression x plus plus is the same as that of x before incrementing. So, x plus plus is an expression which will have the type and value same as that of x before incrementing, but it will have a side effect which will increment the value of x. So, for example, if I have an assignment like this, y is assigned x plus plus then x plus plus here is being treated as an expression with the post increment operator. If the value of y before the statement is 10 and if the value of x before the statement is executed is 2, then this entire expression x plus plus will evaluate to the value of x before it is incremented. So, it will evaluate to 2, whereas the value of x will get updated, incremented as a side effect of evaluating this expression. So, after this instruction is executed, y will have the value 2 which is the value of this expression and x will have the value 3 as a result of the side effect of evaluating this expression. Similarly, just like post increment, we can have pre increment where we put plus plus before x and once again this is similar to x is assigned x plus 1, except that the value of x here, the value of the expression here is the same as that of x after incrementing. So, in this example, if I said y is assigned plus plus x and if the value of y before this instruction is executed is 10 and if the value of x before it is executed is 2, then the value of this expression is the same as the value of x after incrementing it. So, the value of this expression is 3. So, y gets assigned the value 3 and x's value is incremented as a side effect when you evaluate this expression. Just like increment, we can also have decrement operators. So, we can have post decrement like x minus minus which is similar to x is assigned x minus 1, but its value will be the same as that of x before decrementing and here we have a simple example that is worked out. You can look at it and you will be able to easily realize how the values of x and y are obtained after the execution of this instruction and similarly, we could have pre decrement which is once again similar to x is x minus 1, but its value is the same as that of x after decrementing. So, in this particular case, since the value of y and x before the execution of this instruction at 10 and 2, when you execute this instruction, the value of this expression is the same as the value of x after decrementing. So, it is 1. So, the value of y gets assigned 1 and x is of course, decrement is a side effect. So, it also gets the value 1. Now, just like the increment decrement operators, we can have compound assignment operators which basically increment decrement the value of a variable by an expression. So, I could write something like x plus equals y plus z. This is just a shorthand for x is assigned x plus y plus z or I could write x minus equals 2 star w which is the same as x is assigned x minus 2 star w. So, this whole thing is an expression. It has the side effect and the type and value of this expression is the same as that of x after this assignment happens. So, similarly, I could have compound assignment operators with multiplication division and also remainder and the interpretation is exactly as you would expect. Now, with so many kinds of assignment operators, increment operators, decrement operators, we need to worry about the precedence and associativity. I do not want to go through this slide. You can read it at your leisure because this is just taken from the C plus plus standard which says this has the same precedence as that, this has higher precedence than something else. This is left to right associative, something is right to left associative and it is a lot of complication. The moral of the story here is that try not to mix increment decrement operators with other operators if possible. The precedences and the associativities are quite complex. These operators are provided as convenient idioms for incrementing and decrementing use them mostly for that purpose. Now, once we talk about assignment operators being used to build assignment expressions which can be used inside a for loop, it is also appropriate to talk about the comma operator which is basically used to build a big expression which has several other expressions within it. So, in places where we are only allowed to use one expression but we want to sort of have the side effects of multiple expressions, we can build a compound expression with the comma operator in this manner. So, in this expression for example, the different component expressions will be evaluated in left to right order. So, there will be two side effects, x will be incremented, the value of y will be updated to that of z plus 2 and the value of this entire expression will be the same as the value of this rightmost expression which is z plus 5 and similarly for its type. So, this is often used in initialization and update code for for loops. For example, in this example, you can see that there are two assignment expressions here separated by comma. So, this whole thing will be treated as one expression. So, in a for loop I can only put one expression here. So, I could do this similarly there are three update expressions or assignment expressions over here, but in a for loop I can only use one expression, but I could use all of these three by building a compound expression and this will evaluate to a single expression with two side effects and the value of this expression, the type of this expression will be the same as that of the rightmost one. So, in summary we used the assignment statement as both a statement and as an expression and we looked at various variants of the assignment statement and we saw their usage in loops and in other places too in C++ programs. Thank you.