delivery of ads and I am going to talk about two specific issues in guaranteed delivery of ads and they are about allocation and forecasting which we do in this paradigm of ad delivery. So the talk, am I audible? I think I will restart. Am I audible now, better? Hi everyone, could you please settle down, there is extra seating in hall number 3 and this talk is live stream over there. You just need to come in for Q&A. Thank you. Sorry, live stream is not up yet. So yeah, settle in please, thank you. Okay, I will start once again. I am Aditya from Flipkart and good morning everybody. I am going to talk about guaranteed delivery of advertisements and specifically two problems here, allocation and forecasting. So the talk is generally structured like this. I am going to talk, introduce what is guaranteed delivery as opposed to what and then the two problems I mentioned allocation and forecasting. So before I even get into guaranteed delivery and talk about it in detail, what we need to know is what generally happens in online advertising. So when we open a mobile phone or when we look at a web page, what actually happens is an ad slot gets created every time an advertisement has to be shown and this ad slot, sorry, am I audible? Okay, so this ad slot is then sent to a server and where advertisers bid to get this ad slot and the winner, their advertisement gets shown. This is what happens normally in performance based advertising. But guaranteed delivery turns the problem around a little bit and says okay, can we add some more value here? One of the first things that we do is that give guarantees. What kind of guarantees? We can tell a brand, let's say Volkswagen is launching a car and we can tell them that, hey, I can give you a million views for the next one week, exactly million, at least a million rather. These kind of guarantees make their planning job much better and now they can even say that, hey, I want these guarantees on a niche segment of users, like they can say I want these guarantee, I am launching a book in Chennai, about Chennai. So can I target book lovers in Chennai and then show them this many ads? Can I get 10,000 ads from book lovers in Chennai? These kind of advertisers can demand these things and we can provide these guarantees. So that is essentially what guaranteed delivery does. What is in it for Flipkart? It is essentially that when you deliver such guarantees, you can charge a premium for delivering guarantees. But to ensure that, to ensure that we honor these guarantees, what we actually do is we shake hands with the advertiser on a penalty. If we do not deliver a guarantee, we do not honor on a guarantee, we are going to have an under delivery penalty. So on the downside, so this is fine. But the bigger problem about guaranteed delivery is not the penalty. It is the fact that guaranteed delivery can never completely be a system of its own. In a sense, we cannot assume that we can exactly know how many ad slots are going to come up in the next two months, three months into the future in every single targeting segment. So what happens is guaranteed delivery sits on top of the existing system and we just, so it just adds to the complexity. So the existing system has to be there where advertisers bid for the ad slots. But then we sit on top and then say, okay, we can also provide guarantees, but we'll still do it because it makes sense. So let me get into the various components of guaranteed delivery. So what enable guaranteed delivery? First thing is audience segmentation. So let's look at this. We have Flipkart, all the Flipkart users here and then we can segment them on various ways. I am representing this as a tree, but it need not necessarily be a tree. So let's say I can divide them based on the gender and then I can partition them based on their location. I can partition them based on which page they are on, what their interests are and so many other things where exactly on the page, are they at the top of the page or are they at the bottom of the page? Are they on the app top of the app, bottom of the app? So there are so many ways by which we can divide our audience, the people who are on Flipkart properties to show them advertisements. So this is called audience targeting. Essentially this is how advertisers give us information about what they want, who they want to reach. They would say something like men in Chennai interested in books, let's say. So that's just an example. So now what we have is once, imagine we can apply all such filters and then what we can do is we can get this bunch of circles here which are disjoint audience segments. By disjoint audience segments, what I mean is that whenever a user sees an ad slot anywhere on the Flipkart properties, he would exactly fall into one of these circles. That ad slot would exactly fall into one of these circles. So each circle contains a bunch of ad slots and each circle is called an audience segment. I am slightly abusing terminology here because just because an ad slot actually opens up, doesn't mean that it will be filled with an advertisement. So what we are interested is actually users viewing those advertisements. But let's assume that our efficiency is 100%. We can show the advertisements. So essentially user views and ad slots are one and the same. So the next thing is once we know what our disjoint ad slots are, what we can then do is we can predict. We can, given a day in the future, we should be able to predict how many ad slots are going to open up in each of these audience segments. So if you look at it, so these are some random numbers which are there. So essentially I would say that 2000 ad slots would open up in that particular audience segment, around 15,000 in the next and 120,000 in the third. So enabling this, enabling how many of ad slots are going to open up in each of these ad segments is called supply forecasting. So essentially we do have a supply of ad slots which are opening up and we need to forecast them well into the future. The next component of, so once we have this forecast, once we know what we are going to show, how many ads are going to open up. What we have is advertisers coming to us and saying, hey, I want to show this advertisement to these, these, these, these various slots. So the slots can be something like men in Chennai. If I take that, then what happens is there are lots of these segments which are about men in Chennai, not all of them, but lots of them. So what the advertiser would want to show is advertisements to men in Chennai. So then we will pick up all those audience segments and then connect them to the advertisement which is on the right. So the squarish boxes which you see on the right are, are actually the advertisements, sorry, advertisements. So this problem of allowing advertisers to ask for some amount of demand, essentially they can demand saying I want this many advertisements to be shown for this segment is called booking. Why is it a complex problem? Because an advert, we cannot give guarantees on, on an arbitrary number of advertisement views, right. We cannot show, we can only, we are restricted by the size of our audience. So booking is a system which has a conversation with the advertiser automatically and it tells the advertiser that, hey, based on your targeting, this is the best I can guarantee. I cannot guarantee more than this. So that system which figures out what is the best that you can do is called booking, right. Once we have this bipartite graph of forecasts on one side, the supply nodes on one side, audience segments and on the right, we have advertisements or the demand nodes, right. Then what we need to do is we need to distribute saying, hey, this topmost at audience segment can be actually, we can show two different advertisements there, the first advertisement and the last one, right. So how, how do I show, which advertisement do I show to if a user comes in the first segment, that is called allocation, right. Allocation is the problem of showing, figuring out which advertisement to show with what probability given a user comes, given a slot opens up in one of the audience segments, right. So I will go slightly deeper into allocation and then I will talk about how we model allocation as a constraint optimization and the solution, right. So as I said earlier, so allocation is nothing but advertising, assigning advertisements to ad slots, right. So I am browsing the app and there is an ad slot which opens up, some advertisement has to come in, right. But this is not done at a user level, it is rather done at an audience segment level. So essentially what we do is instead of doing it at a user view or an ad slot, we actually assign proportions to audience segment saying if somebody from this audience segment comes, then assign X amount, X percentage to them, right. So for example if somebody from the first audience segment comes, then we would say, okay, 50% of the time show advertisement one and 40% of the time show the last advertisement and the rest we could not book, so we would go with a regular bidding and figuring out who is the right advertiser to show, right. So this is how the system works, right. So the moment, like I said, so the picking is random, so we do not necessarily decide which advertisement to show at what slot based on any criteria. Once we know the probabilities, we just pick at random and then show the advertisement, right. This is fine, but there are couple of objectives here. One is an explicit obvious objective which is we have signed up on a penalty if we do not show an advertisement. So this penalty has to, we have to minimize this penalty. We do not want to pay a penalty to the advertiser for not honoring the guarantees. So that is a short term objective here and in the long term we also need to make sure that the audience segments are representative of the targeting. Representative here is a loaded word, but okay. What I mean by representativeness is that let's say there is a restaurant which opens in MG Road and they would want to tell people in Bangalore that hey, we are a restaurant in MG Road, why don't you come and visit us, right. So they come to us and say, I want to show 10,000 advertisements about restaurant, and about our restaurant, great. So what we do is that we see that there are going to be 10,000 men from electronic city who are interested in let's say books which is going to open up on that particular day and then say hey, let me allocate all of that to those people and not to anybody else in Bangalore. I'm honoring my guarantee. They just ask for people in Bangalore. Men in Bangalore are people in Bangalore. Men in electronic city are people in Bangalore. Men in electronic city interested in books are also people in Bangalore. So I have honored the guarantee, but the advertiser feels cheated, right, because the advertiser had an implicit assumption that it will go to all the people in Bangalore and since the 10,000 would get distributed across his targeting. But it doesn't have, so just minimizing the penalty doesn't ensure that the advertisements are, the audiences are representative of the targeting. So that's where the advertiser, in the long term, if you want a good relationship with the advertiser, we also want to make sure that the audience is representative of the targeting the advertiser is mentioning. So now let's pose this as a constrained optimization problem. So there is a minimization. The minimization has two terms. I'll go through these terms one by one. So essentially what we have first is the forecasted supply. This is represented as an S and it is indexed by I in this entire formulation, right? So there are various supply nodes or our audience segments and we call them SIs, right? So these are the various SIs and the demand is represented as DJs. So we have J advertisements to be shown and each advertisement, sorry, we have a bunch of advertisements that are indexed by J. So these are the DJs and then we have a representative allocation. By representative allocation, this is exactly what I mean. In simpler terms, let's say there are two groups of users. There are 10 people in group A and there are 20, sorry, 90 people in group B and I want to show 10 advertisements. Then I would show one advertisement to group A and nine to group B. So that is the representative allocation. So that is the theta ij which we are talking about. And Xijs are our actual allocation. What the algorithm comes up with saying, hey, this is the actual, this is what I can do best, right? What we want to make sure is Xijs to be as close to theta ijs, right? So we want to be as representative as possible. And if we are fully representative, then this entire term becomes zero and we have our minimization works well, right? So that's the objective here. And in the second part, this is our long-term objective and then we have our short-term objective. The short-term objective is pretty straightforward. We have an under-delivery which we have signed up with every advertisement. So every advertisement has an under-delivery. And sorry, under-delivery is not something we have signed up for. Under-delivery is essentially what we could not show. So even though we gave a guarantee of let's say 100,000, we could only show 90,000. So we couldn't show 10,000. Those 10,000 for that advertisement are the under-delivery. And what we have actually signed up for is the penalty. We agreed on a penalty PJ saying, hey, I'm going to pay this penalty per ad that I am unable to show. So essentially the product of the penalty and the under-delivery, that is our short-term objective. We want to minimize this. This is exactly what this is the amount that we have to pay out. And we don't want that to be high. So this is the minimization.  What are the constraints? So the first constraint is that let's move this UJ to this side. So essentially if this is what the advertiser has asked for and this is what we couldn't deliver. So the difference between them should be what we have actually delivered should be equal to or greater than that. When would this be greater than that? Equal to is straightforward in the sense what we deliver and what we couldn't deliver together should add up to what the advertiser has asked for. That's okay. The reason why there is a greater than sign here is that whenever we over-deliver, over-delivery there is no penalty. Advertiser is happy. We are also okay. It doesn't hurt as much. So if we over-deliver, then UJ becomes zero and SI, XIJ can be greater than DJ. So that's the reason why there is an inequality there. And the XIJs can be thought of as probabilities. For example, if you take the very first node, then we can think of these XIJs as something like this node with 0.5 probability show this advertisement with 0.4 show this advertisement for a person in this node. So these cannot add up to more than one. So that's this constraint. It's a commonsensical constraint and it's there. And our XIJs for the very same reason cannot be negative. And similarly our UJs cannot be negative. So if we over-deliver, we still call the under-delivery as zero and we use a greater than sign. So again these are non-negativity constraints. Pretty straightforward optimization problem. Yes, please go ahead. Yes, that's correct. Should I repeat the question? So good question. All I have to do is make sure that I minimize this term. It's not a... IJ is not a constraint. Theta IJ is just a part of my minimization. In the constraint, all I need to make sure is... See, the Sij Xij term, that's the number of impressions that I have delivered, number of ads that I have delivered, should either be greater than this demand or that plus under-delivery should be equal to this what derivatives are asked for. That's all the constraint is. The constraint is in a much simpler form. The difference is taken care of by the minimization itself. It's not necessarily... We don't need to write that down as a constraint. It's not a constraint. I agree. It's not a constraint. All I'm saying is that even if you over-deliver, you are not actually targeting the targeted audience. You may be showing the advertisement to people who are not really the ones where your advertiser is targeted. I agree. The point is that when we... So this entire optimization, it will find the most optimal solution to this setup. So if we are doing that, then we are going to lose the advertiser. If we are going to show it in a particular way, but we cannot do any better than that for this equation because this is the most optimal solution. If there are any further questions, can we take that after the talk? Sure. This is the short-term objective. This is my long-term objective. Formulation is pretty straightforward. What we have is... If you notice, other than Xijs and Ujs, we know everything else here beforehand. We have... Let's assume that we have forecasted and let's assume the booking system has given us the demand and we know the representative allocation. We know the penalty. So the only terms which we do not know are Xijs and Ujs. So what we do is we just append them into a variable vector and this is more like how we would solve it in Python or something like that. So essentially, we need to rewrite this entire minimization problem in this form, separate the quadratic and linear terms and all our constraints are represented in this form, in a matrix form. And just use CVXOPT or something like that to solve this. Solution is pretty straightforward. CVXOPT generally takes these PQGH matrices and then the solution object contains Z and from Z we can get the Xij vector and Uj vector. So the solution is pretty straightforward. The posing is the only thing. So that's about the allocation part. The other part is forecasting. So forecasting what I want to talk about is a brief look at our data. Please. Good question. So this is a simplified version of the constraint optimization. So what we can do is we can add a fairness objective here. So instead of just Sij, we can say how much importance should we give to representativeness for a given campaign? So let's say we can add an Fj term here, which let's call it the fairness term. S i, X i. So just next to this S i, let's add an Fj term. This Fj term is essentially how fair do you want to be to various kinds of advertisers? So the way we compute it is essentially, this is a large advertiser. We don't want to lose this advertiser. We might want to be more fair. That's one scenario. You might want to compute it in a different way. But essentially, we just have to modify this. And that will also become unknown. So it's just adding, there are no addition of variables. Fairness is just an addition of one more term into the thing. It doesn't change our variables or the overall optimization. That's correct. So it's a good question. It's a problem of guaranteed delivery per se. So when we are going to give guarantees, what are we giving up? We are giving up on matching the advertisements to the users. We are not completely giving that up. What we are actually doing is we are giving the control to the advertiser. So the advertiser goes ahead and says, I want to target exactly these people. So they are giving a very niche targeting. So the importance of matching users to advertisements goes on to the targeting rather than CTR models or something like that, which would give you the right match for a user to an advertisement. So the question was, how do we go about doing user segmentation? So for any given user, we know a bunch of attributes.  If you apply whatever targeting which the advertiser needs and put don't cares in the rest of them, what you would end up with is a bunch of circles here. So what the advertiser needs. So and then we go ahead and then say, forecast for those circles and the rest of the story. So essentially any targeting will reduce to a subset of the circles, which are the audience segments. So forecasting. So firstly, we have these audience segments, these circles. Now what we have is the number of user views which we have gotten at a particular circle, at a particular audience segment over time. So let's take daily aggregates and let's say this is 54 days worth of data and we see that the views are fluctuating. Sometimes some days we have a lot of views and some days we don't and in that particular audience segment. Now this is the basic time series of the data and the next thing that we have is that we also know whether all audience segments have a category information in them. For instance we know in what category is this audience segment. So we also know whether there were any sale events, whether there were any discounts, what other things which might potentially affect the traffic in that particular audience segment and that should also get captured and the way we capture that is we have a time series and we also have these blips which are essentially telling us that hey, this sale event happened here of this magnitude, a sale event happened here of this magnitude. We can add any number of variables. This is just to show how the data is. So and what we need to do is we would have these orange bars in the future because we know what we have planned for in the future and we know these bars in the future but we do not know how this curve is going to be or how the views are going to change over the future. So that is exactly what we need to predict given we know these orange bars in the past as well as the future. There are several ways of doing it. I am going to talk about one. One of them is our least squares regression and then there are smoothing models which separate these are not very great for modeling sale events, the smoothing models and there is something called ARIMA. It is an old technique but very useful and very useful in our case. So I will go into further detail. So Flipkart has millions, tens of millions, hundreds of millions of views in a given day. So once we have all those ads lot views happening, we have this entire hierarchy or grouping. So essentially advertisers might want something like running examples like women in Bangalore, people in Chennai looking at books and things like that and whatever the advertiser wants, we would need forecast there. We would need to be able to say hey, this is the number of ad slots which are going to appear. So one simple thing is if all the leaf level segments we have are disjoint, then knowing what would be, I just saying men in people in Chennai looking at books or women in Bangalore, just looking at women in Bangalore. It is just nothing but figuring out what are all the leaf level nodes which have these two in their paths and then we just add them, add their forecast up. So that is straightforward in bottom up but the problem with bottom up approaches is that if we have any nodes where there is not enough traffic, the traffic is so low that we cannot give reliable forecast, then we are going to have a problem. So and then there is another approach where what we do is we just start top down. We say okay, let's forecast here and then see how it gets partitioned into gender and then into location and everything. But then top down is also slightly messy because it assumes that there is a hierarchy. Even though I have drawn it as a tree, it is not a hierarchy. I can flip location first and then put gender later and it still works. So this is more about grouping. So what we do is we use bottom up with some constraints. So what we do is there can be millions of these nodes because of the number of ways by which we target, we can quickly see that it is the number of circles that we can end up with is millions. So one of the things that we do is that we look at all those segments which have very little traffic and don't give guarantees on those segments. It doesn't make sense to give guarantees on the segments when there is very little traffic. And then we take only those segments where there is enough traffic so that we can give guarantees. So that makes sure that our bottom up approaches work and we can just aggregate it back up. This is specifically for people who have logged in and people who have not logged in, there are ways to do it. If there are cookies in the machine, if the cookies are also cleared, I don't know, but for mobile phones it's straightforward because there is add ID and you can just pick up the add ID or the iOS ID and then start using it. So what we want to do is we want to build these time models which can forecast, but if I have to use an ARIMA model, I will get into details of what an ARIMA model is. But if I have to do that, I need to, something went wrong. Yeah, just one simple question. So does this mean that people in different locations could get different ads overall? That's correct. That's what you are showing me. Say what if I'm a Bangalorean and I'm visiting Chennai for some other reason? So does that adding algorithm change again? So it depends when I say location, right? There are several locations.  One is your current location. So based on what the advertiser is targeting, most advertisers target on base location. Whether even if you are in the U.S. and you are browsing a Flipkart app if your base location is Bangalore, you will still be shown the advertisement. Thank you. So one of the things that we need to ensure for ARIMA models to work is that we have to make sure that they are stationary. Why? Because generally when we build ML models, we are assuming that our features are independent. But the way ARIMA models work is that they take into account every data point is dependent. So we learn what is today's forecast based on yesterday's and the day before yesterday's and they are clearly not independent. So if they are not independent, on which we build ML models fail. So we need to ensure that we can build models. We can do a regression. The AR in ARIMA stands for auto regression. That means regressing onto your own data. So I will just keep talking while this thing comes up. So to do that, to ensure that it is stationary what do we have to do? Two things. To ensure that they are independent we cannot ensure that they are independent. So what we do is we ensure something which is a weaker constraint called stationarity. We ensure that the time series is stationary and then lot of these properties of independence hold on stationary data as well. So the stationarity becomes important and to make sure that our time series is stationary. So what do I mean by stationary? The mean of the time series over time. We measure the mean of the window on the time series and then measure the mean value. The mean value should not change. So the mean should stay constant wherever I measure the mean. So that is called stationarity in mean and then we also have the variance. The variance at any segment of the time series should also remain constant and this is called stationarity in variance. This is achieved through logarithmic transforms and there are some transforms but our data doesn't have variance sorry, our data is stationary in variance. So what we have a bigger problem is with stationarity in mean. So how does stationarity, lack of stationarity in mean look like? If a time series keeps going upwards. So if I measure the mean, if the time series is like this going upwards and if I measure the mean here it's going to be some number but if I measure the mean at the very end it's going to be some other number. So the mean is clearly changing and it's not stationary. So one of the ways of dealing with that's okay. So one quick way to deal with stationarity is that we can just take the time series and difference it. By differencing the mean is instead of looking at the time series itself what we would rather look at is the change over days. So from yesterday to today it changed I got 10 percent more views or 10 more views. From day before yesterday to yesterday there were 10 more views. Sure. I did my laptop switch off. Thank you. So this is my time series. It's all nice to think of a straight line going upwards like this and then saying it's not stationary but in a real time series it's not easy to say whether it's stationary or not. So we need to be able to say that hey whether the easiest time series is stationary can I go ahead and start building my models. So for that one simple if we know that it is stationary then there is a simple trick. All we have to do is change in time. So if y t is today's value and y t minus 1 was yesterday's value we rather use instead of using these as the time series we would rather use change over time as our time series. So we would rather forecast the change over time and then we can always recompute if we know the change over time we can always integrate and then get the actual value. So we sometimes if the time series goes up like this exponentially then we might have to do double difference double we have to apply it again second order differencing and so if I apply single difference so if y dash of t of this particular time series looks like this so for me this looks more like it's stationary in my mean in the sense the mean is stable whereas here there is a slight upward movement here but is it easy to is this the right way to do it so we have slightly better tools one of them is called the auto correlation function so what we do is we take the time series we take a time the same time series with a lag right with a lag of 1 with a lag of 2 with a lag of 3 with a lag of 4 and so on and so forth and then we see how correlated are the time series across lags right so this is the original series and this is auto correlation the correlation of the time series with itself across lags and we see that this doesn't fall fast it falls very gently to 0 this is a indication that the time series is non stationary this is a rule of thumb indication so to check this if you take the different series you see that the auto correlation falls very fast below 0 so this is this is a clear sign that hey we have reached stationarity but then we have as I said there are millions of circles even if we eliminate the smaller ones we still have hundreds of thousands of circles keep looking at these plots and then say hey this series needs to be different this series doesn't need to be different and they change every day so we cannot do this so in practice what we do is there are unit root test what this unit root test do is that the test first the whether there is a stationarity or not and one of the test is called augmented decay filler test this is implemented in most packages we just use that and a negative value here indicates that our series is stationary right actually augmented decay filler test actually test for non stationarity so from there we can figure out whether it is stationary or not so yeah so there is also differencing which is seasonal in nature so if you have seasonal data let's say every 12 months you you have more than a year's worth of data and then what you do is you difference this October's value from last October's value right so that's called seasonal differencing like how we did normal differencing we also can do seasonal differencing and that removes a seasonality out so this forecasting with Arima there are Arima is actually a combination of several models the I stands for the differencing that we did it's called integrated so it's just that we have to do the opposite once we have done with once we are done with differencing so that's I and the AR and MAR actually two different models the first one the ARP model essentially says that the value of a time series at time T depends on the values of the time series at the last P instances right so we awaited addition of them plus an unforecastable error term so this is simple auto regression model essentially this looks like our regression but just that these are these are values which are directly from which are the past values of this YT right so in a different series it will be y dash of T equal to this where this is y dash of T minus 1 y dash of T minus 2 and so on and so forth the ma model is slightly more complex it's called the moving average model what we essentially do is we assume that there is a model and then we we assume that there is a model and then compute the errors of the model and once we have the errors computed then we compute the YT and then based on the errors we get new models, new Thetas like a regular regression but once we get the new Thetas again we get a new set of errors and it's a complex model to build and a non-linear model but we do have algorithms and implementations in place which can solve these ma models so essentially an ARIMA model is nothing but a combination of these two so these constant terms are this C and then we have these ARIMA terms sorry AR terms, MA terms and E terms now what happen to the sale events right so sale events are pretty straight forward all we have to do is let's say we are looking at the past 4 days or something like that with P right so what we do is we then take the last 4 days what was the sale what were the sale events if there was no sale event we just set it to 0 and we add 4 more variables to this and then solve this right sale events, discounts everything it's just adding more terms like this to this particular regression and then figuring out YT so this is what ARIMA with sale events does but this is good but how do we know sorry please go ahead there is a for the sale events as you mentioned if it's a regular series it's okay but when you are applying it on a different series right how do you take I mean how do you take the sale events into account say the sale event is probably it is today so when you are differencing the values like today minus yesterday so but yesterday there was no sale event right so how do you take that into account so you don't have to difference the sale events just use the sale events directly right so take it on one side so let's say one simple way it's take it always on the if it is difference take it on the right side or YT rather than YT minus one something like that you assume one and you go ahead with that right it's just a signal which just says okay how much this value is dependent on the sale events but the sale events would affect the stationarity right sale events would no they don't affect the actual time series right they only affect they only add to they only add an additional component to that so okay can we take this let's discuss this okay quickly to conclude two more slides right so so this is all fine but we need to know the right values of P, Q and D, D we already know we can sorry we can use ADF test to figure out the D value but how do we figure out the P and Q values and that we generally what we do is we start with P0, Q0 this is if on a non-different series this is just assuming that we cannot predict it's just purely random and on a different series this is what we have this is called a random walk model essentially YT is dependent on YT minus one plus some error so this is a random walk model and we then that's P0, Q0 once we have and then we go ahead and compute a metric what metric I'll introduce a metric in the slide one of the things which we use is called mean absolute percentage error and I'll talk about that and so we we choose some metric and then we compute the metric here and then we pick its neighbors and go ahead see what is the winner and then pick its neighbors and so on and so forth till we found the optimal point right so this is what happens in this is what we do in practice to figure out the right values of P and Q and lots of these metrics not made but there are some metrics which also take into account the size of P and Q because you don't want to build model with lots of variables you want to reduce that and and that's so there are things like aka information criterion and BIC, Bayesian information criterion which can which do take a size of P and Q into into account so how does the output look like so let's say I stop 7 days before 54 that is on the 47th day this is where I stop and I learn the model there and this is how the forecast look like right using the optimal PD and Q values which I found for this particular time series for 3, 1 and Q, 1 so this is what the forecast look like so in reality and the mean absolute percentage error essentially what we do is we take the forecast and we take the actual value and then see what percent is it off from the actual value and then we compute a mean of those right so that's the metric which is called MAP and in reality what we do is we cannot take the absolute forecast rather what we do is because we have to give guarantees we take the forecast in a certain confidence interval and since confidence interval says that ok 80% of the time where does this forecast lie right so then it generally it should be lying here but that's the expected value but 80% of the time it lies within a window so what I am looking at is the lower bounds of the window the upper bounds are not useful and guaranteed delivery so the lower bounds of the window is what I am taking it looking at and providing guarantees on this is my last slide and ok this is a very simple python implementation of an ARIMA model with time series sale events and future sale events and this is how you do it just for reference so to conclude so we need guaranteed delivery for better quality of service better revenue and for that we need to make sure that these two components work well and there are other components which I am not talking about but allocation has to deliver ads by honoring explicit and implicit guarantees and forecasting we have to do that to set the base for GD in the sense of allocation and every other algorithm depends on this forecast right we have to forecast 2 to 3 months into the future that's about it questions please or do I have any more time for questions 4 more minutes ok so in the segmentation part so like if there is like CT there is the cardinality let's say 500 for the segments the cardinality let's say 100 and something else as the cardinality 100 so pretty soon it will the overall segments will be like 500 into 100 in turn pretty soon it will explode very fast so like how do you control that number of segments like you are using any specific strategy to control the number of segments by yeah there is an announcement please quick announcement guys so there is feedback forms please make sure you collect them from the volunteers if the hall is overflowing there is a balcony apparently which is auditorium 1 sorry yeah so there is a balcony at auditorium 1 and the rest will announce at the next talk thank you that's a good question so what actually happens is that we will have millions not even millions even more yeah it does but the audience in each of those segments drops to 0 so 99.9% of our segments don't have any audience views forecastable number so our number of views per day would be 105 something like that which would be so low that we would want we don't want to give guarantees there that constraint optimization part exactly we drop them off and how do we drop let's say we take only 99% of our traffic that will be only in less than 1% of our segments right so that's a good strategy 99% of our traffic or 99.5% of our traffic is a good strategy to make sure that these segments are very few one question the segments itself are not constant over a period of time so for forecasting do you pre compute what is the like numbers for each segment do you have a semi aggregated then you no we compute it for each day for each item so then the segment itself yes if the segments change whenever the change comes whenever there's a new store opens or there's a new category opens in Flipkart then we'll start forecasting for that as well back computing we will not have data initially it will not be in guaranteed delivery but slowly it will enter guaranteed delivery once we have enough data most ARIMA implementations allow us to give additional variables on which we would generally regress so they are called exogenous variables and what we can do is instead of just giving the original time series we can also give exogenous variables so they will be added as a part of the equation so that's ARIMAX exactly that's what it's called so whenever you are on a mobile app so the advertisement is not there beforehand just after you open the app and you are scrolling down what happens is a slot gets created like 10 to 20 milliseconds and ad comes up there so it's something which we don't perceive but what actually in reality happens is an ad slot opens up and tells the server that hey there is a slot here show an ad and the server comes back and says okay this is the ad exactly not just new sign in anybody any page right you are browsing any page any ad somebody is now on this page as the page is loading it's not opening up because of something freeing up because of usage I have one question audience targeting for segmentation so the base data which you use have you created a single customer view something like that to actually create these segments how do you come up with these segments which you use for audience targeting so there are various we have been doing advertising for quite some time so we know what segments are of interest to the advertisers right so the advertisers generally tell us what segments they are interested in that kind of tells us gives us a clue on what are those various cuts right and then based on that and that's one the other thing is we look at the traffic in each one of them and then determine hey there is enough traffic here that we can give guarantees if there is not enough traffic then we say okay there is no traffic we cannot give guarantees let's go into the bidding world and then let the advertisers bid and win those slots if required we know the segment cuts right and we know what data in the past was there in each of these things right based on the volume of data in the past we say which are the ones where we can give reliable guarantees and which are the ones we cannot and then we drop the ones where we cannot when you are relying on the past data the one thing I ask is like at a point of time different segments and different ads are competing for different segments isn't the performance of the ads dependent on the time seasonality for example like you know winter season whatever offer a sale is going on so at that time some particular ads were performing good but then like you know the time moved on the entire history might be redundant so how do you handle this variation good thing so what I was talking about is a model called addingma so there are lots of additions to this one of them is if you understand right for the sales forecasting not really for the mapping part that's correct so mapping doesn't change over time whether whatever is a seasonality the volume of traffic in each of these might change but the mapping what segments we have is let's assume they are fixed what arima does is there are seasonal variants of arima which can take extra sales events also into account so they are called sarimax seasonal arima with exogenous variables right so essentially it's just arima with a little complexity but that's how they are handled seasonal arima models actually take seasonal patterns into account seasonal even the differencing that they do to get stationarity is seasonal in nature and that's how they work that's something which we cannot do because booking system needs the forecast to be able to book right so the segments have to be before booking exactly we have to deal with all possible segments truncate them but still the number of audience segments is large so that's why the advertiser data you are talking about am I out of time okay I can thank you


It truly has been a joy to be with this section of Christ's body and what's amazing about being a Christian is the union that we have with one another, the love that we have for one another. We don't have to know someone very long before you already feel connected.  I love this church in particular because you'll have a lot of love for one another and y'all's not ashamed to express that love with hugs and handshakes and pats on the back. All that is very affectionate and what that's one of the beauties of Christianity. That's one of the things that that the Lord says is one of the greatest apologetics of the fact that Jesus has come in the world, that his people love one another. That's something very unique about Christianity. In fact, that really loving one another is the key to relationships and relationships is the key to life. What would life be without relationships? What would you give? What would you have to have to give up all your relationships? Would you take all the money in the world on the condition that you would have all the money in the world and you could have all the limited buying power that would bring you fame and fortune, that would bring you power. You would have all the things that the world's looking for and if you could have that on this one condition, no friends, no relationships. Well, none of us if we're in a right mind would make that train. It's because God's made us not to be alone. He looked at Adam and says it's not good that he's alone. We're made for relationships, but the key relationship that God designed us for is a relationship with him. The thing that we can have a relationship with God. If you would, turn with me to John chapter 17. I would love to have expository sermon before this morning and we can go through this chapter. We're not going to do that. I just want you to look at verse 3 and then jump to 22. This is Christ's high priestly prayer. We heard that Christ is the greater priest and here is his crying to the Father. I think this is what Christ wants more than anything else. We would love for Christ to pray for us and he has prayed for us, but what did he pray for us about? What does he want us to receive more than anything else? Look at verse 3. And this is eternal life that they know you, the only true God in Jesus Christ whom you have sent, that we may know God. And this knowing God is more than just knowing about God is that we may have a relationship with God, that we may know him intimately. That's what Christ is praying for is that we, his people, would know him and that we too would know Christ. Now jump to verse 22. He says, the glory that you have given me, I have given to them, that they may be one even as we are one. I am them and you and me that they may become perfectly one so that the world may know that you sent me and love them even as you love me. Can you imagine this is what he's praying? He's explained in this prayer that from all eternity before he came into the world he had this joyful, glorious relationship with the Father. And this is the most important thing to Jesus. The most important thing that he has is the glory that he shares with the Father, this perfect relationship. So we see even in the Godhead there is this relationship of mutual love for one another. In fact, this relationship is so close. He says we're perfectly one, loving one another, treasuring one another. This is what the Son was doing from all eternity past. He's gazing upon the Father and enjoying the Father. And what was the Father doing from all eternity past? Gazing upon the Son, enjoying the Son. As it was when I first held Martin, my young boy, the first day I just gazed upon him. Just couldn't take my eyes off of him. And I don't know how or why, but immediately I love this little baby. Oh, all of a sudden meaning and purpose to life is brought about when the fact that I have this relationship with my own Son, how much more does a holy Father look upon Jesus as Son and just enjoy. And we are created for that purpose to glorify God, right? And to enjoy him forever. That's what Christianity is all about. It's not just getting to paradise and having seven virgins and having a cup full of wine or just having our bodily appetite satisfied. The purpose of glory in heaven is enjoying God forever. Having the relationship with the Almighty. Can you imagine that? What more could God give? He didn't just give us earthly materialistic things. He gave us himself. And more than that, the very relationship that the Father, the Son, and the Holy Spirit enjoy among themselves, which is the most glorious thing in the world. He says, I want you to enter into that relationship. I want you to be one with us. Not that we become divine, but we become joyful participants of that mutual relationship with the Father. And that's what we enjoy to some degree when we worship together and our love for one another here. We participate in the relationship of the Father, Son, and the Spirit as we love each other here on earth. What glory this is. And we're made for this. But Islam does not provide for any of that. The greatest thing it does not give us. In fact, Alexer McGrath, professor of science and religion of the University of Oxford said, we are created with an inbuilt yearning for God, which is famously expressed in the prayer of Augustine. You have made us for yourself and our heart is restless until it finds its rest in you. But Islam does not provide that with us. Abdul Salib says this about Islam and generally agree that according to Orthodox Islam, the purpose of man is not to know God and become more conformed to his character, but it is to understand his will and become more obedient to his commands. Islam is more about being a servant to the will of God, the commands of God, not necessarily having a relationship with God. Now we want to do the will of God because sin separates us from that relationship. It's just not a matter of just being obedient just for the sake of being obedient. Obedience brings us, if you would, into conformity to the character and the nature of God. And it's sin that separates us from that relationship. And I'm here to tell you this morning, and this is the purpose of today's message, which only the Trinity provides us with a relationship with God. Only the Trinity. You know, Muslims and Jehovah Witnesses and others will say the Trinity is a contradiction and they'll use the Trinity against us. I'm here to say no, the Trinity is what makes the Christian worldview cohesive. It's the Trinity that makes us, gives us the opportunity to have a relationship with God Almighty. You take the Trinity away. And if you have just a monolithic God, such as Allah, a single person deity, then there's no relationship. It's impossible to know this God. So here are my three points. We're going to look at the chronic explanation of the Trinity. How does Muslims understand the Trinity? And how does the Qur'an explain the Trinity? Two, we're going to look at the biblical explanation of the Trinity. How does the Bible explain the Trinity? And three, we're going to explain why we must be Trinitarian. Let's look at how the Qur'an explains the Trinity. And Surah 112, it says, Say he is Allah the one and only, Allah the eternal, absolute, Ibogetif not, nor is he begotten, and there's none like unto him. See, Muhammad thought that Christians, when they talked about the Trinity and Jesus being the only begotten Son, thought this was more of a biological process where the Father and Mary have some form of physical relations. And the outcome of this is a new deity where Jesus becomes divine in the birth. They thought the Trinity was God the Father, the Son, and Mary. Surah 471 of the Qur'an says, O people of the scriptures, do not exaggerate in your religion and do not say about God except the truth. The Messiah, Jesus, the Son of Mary is the messenger of God and his word that he conveyed to Mary and the spirit from him. So believe in God and his messengers and do not say three. Refrain is better for you. God is only one God. Glory be to him that he should have a Son. To him belongs everything in heaven and on earth. Surah 5116, the Qur'an says, and God will say, O Jesus, Son of Mary, do you say to the people, take me and my mother as gods? So here it's looking at, Muhammad thought, are you saying, or are Christians saying that Mary is a God? Of course the Bible never makes that claim. And Surah 19, 88, and they say the most merciful has begotten the Son. You have come up with something monstrous in which the heavens almost rapture and the earth splits and the mountains fall and crumble because they attribute a Son to the most merciful. It is not fitting for the most merciful to have a Son. See, Muhammad thought Christians believed in three deities. Surah 23, 91, no Son did Allah begot, nor is there any God alone with him. If there were many gods, behold, each God would have taken away what he has created, and some have lorded it over others. Glory to Allah. He is free from that sort of things they attribute to him. See, Muhammad thought, man, Christians believe in three gods, three independent deities, Mary being among them. He says, how could that be? If there were three gods, they'd be rivaling over who's the top deity. Far be it for God's glory. But Muhammad didn't understand the Trinity. He didn't understand the biblical teaching. But what does the Bible say about the Trinity? How do we explain the Trinity to others? Well, let's look at what the Bible says. And if we want to understand the biblical doctrine of Trinity, we need to understand three things. Some people have said these are the three pillars of the Trinity. So if you're explaining the Trinity to others, remember these three points. One, there is one God. And by that, we mean one essence. And by essence, we're saying who God is, what he's made out of. There is one God, one essence. Second pillar, there are three persons. We're not saying there is one essence and three essence. We're saying there's one essence and three persons. The third pillar is each person is fully God. One God, three persons and each person is fully God. Now let's look at these points more closely. The first pillar, there is only one essence.  There's only one substance in the Godhead. And what we mean by substance or the word essence is we mean his nature, his character, and his nature and his character or his essence is the totality of all of his attributes. God is who he is. I am what I am, he told Moses. That means he is love. God is love. That's not just something that he has. That's something who he is. He's made out of love. That's who he is. God is all-knowing. He doesn't just have this. That's who he is.  There is only one essence because there's only one God. Drutotomy 6.4 says, Hero is or the Lord our God, the Lord is one. That's why we are monotheists. 1 Corinthians 8.4 says, There is no God but one. Ephesians 4, verse 3. There is only one body, one spirit, just as you are called into one hope that belongs to your call, one Lord, one faith, one baptism, one God. James 2.19, you believe that God is one? You do well. Even demons believe and shudder. You see, there's only one God because the Bible says there's only one God, but also there is no other God besides this true living God. Isaiah 45, verse 5, I am the Lord. There's no other besides me. There's no God. I equip you, though you do not know me, that people may know from the rising of the sun and from the west that there's none beside me. I am the Lord and there is no other. Isaiah 46.9 says the same thing, for I am God and there is no other. See, God's omnipotence demands that he stands alone. How could he be all powerful?  And the power that we have, the power that is stored up in the sun that provides the energy to grow the grass and feed the cattle in which we eat, which we get energy. All that power is delegated power. And God has all power. How can there be another God besides the God who has all power? God would cease to be all powerful if there was another God beside him. Acts 17-28, Paul says, all lesser powers in heaven and earth live, move, and have their being in him. Even the power of Satan is only delegated to him, and he can only move, do, and act and behave according to what God permits. Thus, the three persons of their Godhead are not different essences, nor even of like essences. But they are one and the same essence. And this is the first pillar of God. There's only one all-powerful being. There's only one all-knowing being. There is only one God of love. He's one in his essence. And there's none beside him. First pillar. The second pillar that the Bible teaches us is that there are three distinct persons. Theologians call the persons substances. But what do we mean by substances or we know better in our own vernacular persons? What do we mean by persons? Hebrews 1-3 says, who being in the brightness of his glory and the express image of his person? Saying Jesus Christ in his person looked just like the Father in his person, but they're distinct persons. John Calvin in defining the what the Bible means by persons says this, by person therefore I call subsistence in God's essence, which while related to the others is distinguished by an incommunicable quality. By the term subsistence we would understand something that is different from essence. Here is my own definition of persons. Persons are incommunicable and relative properties that distinguish the three persons of the Godhead from one another by their personal relations to each other as distinct center of consciousnesses. So these are incommunicable relative properties that distinguish the three persons of the Godhead from one another by their personal relations to each other as distinct center of consciousness. So whatever we mean or the Bible means by the word person that there are three persons it must mean that these persons at least have a distinct center of consciousness. Professor John Murray says, why should we have difficulty in viewing each person as a distinct center of consciousness? Does not the scripture represent the Father as addressing the Son as thou and the Son the Father as thou? And the same must hold true of the Holy Spirit if Trinitarian distinction applies to him as well as the Father and the Son. The Dutch theologian Brachel says, we understand this to refer to a living, intelligent, incommunical being who is fully independent, sharing no part with one another. That is in the scriptures we see the Father is capable of speaking to both the Son and the Spirit as distinct persons. Likewise the Spirit and Son are capable of speaking to the Father. The Father knows that he is not the Son and the Father knows that he is not the Spirit and the Spirit knows that he is not the Son or the Father. These three are distinct persons without mixture or division. The Father is neither the Son nor the Spirit and the Son is neither the Spirit nor the Father. They remain distinct although they do coincide in one another. Jesus says, I am in my Father and my Father is in me. They coincide or co-inher each other. Some have said this is inner penetration of the Father in the Son, the Son and the Father, and likewise with the Spirit. Each person is able therefore to communicate, have fellowship, love, and prescribe glory to the other two persons. They are one in essence, but they are able to communicate to each other. They are able to have a relationship with each other. That is what we need to see about the Trinity. The Trinity allows there to be a God who has a real loving fellowship or relationship with the three persons. That is amazing because in all eternity there is this eternal relationship. All of it does not have that. We need this eternal relationship. One God who is all-powerful, who yet is not bored in heaven, who is stuck in eternity past with nothing to do. That is not our God. In fact, this is what makes him self-complete. He did not need anything. He made Adam and said, Man, Adam, you need a helper. You are alone. This is not good. I mean, the doctrine of Islam is true and Allah is just out there. I mean, he needs creation. He is going to have any type of relationship at all. God does not need us. He has this perfect, beautiful relationship with himself. See, the personhood has derived their relationship from each other. This is what we get in eternal generation. The Nicene Creed says, I believe in one God, the Father, the Almighty, Maker of heaven and earth, and all things visible and invisible. And one Lord, Jesus Christ, the only begotten Son of God, begotten of the Father, before all worlds, God of God, Light of Light, very God of very God, begotten, not made or created, like Islam teaches. And I believe in the Holy Ghost, the Lord and giver of life, who proceeds from the Father and the Son, who with the Father and the Son together is worshiped and glorified as God. Now, Calvin wants to clarify what he believes eternal generation means. He says, what is generated from the Father is not essence or what is communicated from the Father to the Son is not the essence of the Son, rather it's the personhood. Because the one essence of God cannot be divided, the essence of the God he has had is not derived or communicated from the Father to the Son or to the Father and the Son to the Holy Spirit. You see, the Father in and of himself is God. He's fully God.  God, the Father does not need the Son or the Spirit to be God. He is fully God of himself. Well, that is also true with the Son. In the essence, the Son is fully God in and of himself. The Son is auto-theos and the Spirit likewise does not derive his essence from the Father or the Son, but the Spirit is auto-theos. You see, they do not derive their essence and life from one another, but rather they derive their essence and life from within themselves. As the Father is self-existent, the Son and the Holy Spirit are also each self-existent. Therefore, only begotten speaks not of the creation of the Son, where there was a point where the Son did not exist. Rather, the only begotten or being begotten speaks of the nature of the relationship that the Son has with the Father. This is because the distinction between the persons come from their eternal relationship with one another. That is, for the Father to be the Father, he needs the Son.  You see, they need this relationship for the identity of who they are as a person, not in their essence, but as their persons is communicated by their mutual relationship with one another. That makes sense? Thus the eternal relationship between the three persons of the Trinity establish the individual uniqueness of the three persons of the Trinity. And together the Father and the Son's relationship necessitates the personhood, not essence, but the personhood of the Holy Spirit. In other words, personhood requires there to be a diversity within the unity. And this is why Christianity says unity and diversity are both equally ultimate. We see unity in the essence, but we see diversity in the personhood. Thus the three persons exist simultaneously together at the same time. We don't believe in modalism, where the Trinity is just different modes of the one person. Back to Brachel, he says the divine beings assist in three persons, not collateral or side by side, but rather one person exists by virtue of the other person either by the way of generation or procession. So this is the second pillar of the Trinity. First one is one God, second one is three persons. The third pillar is each person is fully God. The Father is fully God. According to scriptures the Father is declared to be God, 1 Corinthians 8-6. Yet for us there is one God, the Father. Second Corinthians 1-3, blessed be the God and Father of our Lord Jesus Christ. So clearly it's claiming the Father is God, is divine. The Father has all the attributes of God. 1 Peter 1-2 says, according to the foreknowledge of God, our Father. The Father is the Creator of all things, which that would be impossible if he was not God. Hebrews 1-2, in these last days he has spoken by us through his Son, whom he appointed the heir of all things and whom he also created the world. The Father is sovereign over all things, which this too would be impossible if the Father was not God. Luke 10-21, I thank you Father, Lord of heaven and earth. The Father is to be worshiped as God. Matthew 6-9, pray then like this, our Father, which is in heaven. How will be that name? The Father is to be glorified and is glorified by the Son. John 2017, I'm ascending to my Father, your Father, to my God and your God. So Jesus is claiming that the Father is God. And most people do not disclaim that, but our Jehovah will witness his friends. They say, well, that Jesus is not God, but this is not true either. The Son is fully God. One, the Son is declared to be God.  Titus 2-13, we're waiting for our blessed hope, the appearing of the glory of our great God and Savior, Jesus Christ. How much clearer do you need? 1 John 5-20, and we know that the Son of God has come and has given us understanding, so that we may know him who is true, and we are in him who is true.  Bible is not trying to hide this. The Son Himself, Jesus Christ claims to be God. Jesus said in John 8-58, truly, truly, I say to you, before Abraham was, I am Jehovah, I am Yahweh, I am, I am Lord. He calls Himself by the name of God. The Son allows others to call him God. John 20-28, Thomas answered him, my Lord and my God. If Jesus is not God, he's committing blasphemy. Why would he allow Thomas to call him God? But he receives us. He says, blessed are thou. You see because you believe that I'm God because you see, but blessed are those who believe I'm God who do not see. Jesus Christ possesses all the attributes of God. He's eternal. Isaiah 9-6 says he's everlasting. John 1-1 says in the beginning was the Word, and the Word was with God, and the Word was God. He was in the beginning with God. The Son is all-powerful. Isaiah 9-6, he calls him the mighty God.  He is the Son and he's all-knowing. In John 21-17, they said, this Bible says, Lord, you know all things. How could that be if he's not God? The Son is creator of all things. John 1-3, all things were made through him, and without him there was nothing that was made. The Son has power to forgive sins. And that's why they wanted to stone him. He says, Jesus says, your sins be forgiven. How could he have done that? Somebody wrongs my wife, Letha. And I go up to the person who did that, so I forgive you. What do I have to do with it? My wife has to forgive this person. This person didn't offend me. He offended my wife. We offended God and God alone. How can Jesus say, your sins be forgiven you if he's not declaring himself God with the power to forget? The Son is worshiped by angels and by men as God. Hebrews 1-6 says, and again, he brings the firstborn into the Word and he says, let all God's angels worship him. And the Son is glorified by the Father as God. John 8-54, Jesus answered, if I glorify myself, my glory is nothing, is my Father who glorifies me.  So Jesus Christ according to the scriptures is God of God. The third is the Holy Spirit is God. The Holy Spirit is declared to be God in 1 Corinthians 12-4-6. The Holy Spirit has all the attributes of God. He's eternal, Hebrews 9-14. He is omnipresent, Psalms 139-7. The Spirit is all-knowing, 1 Corinthians 2-10. The Holy Spirit is Creator of all things, Psalms 104-30. The Holy Spirit is sovereign over all things, Romans 15-19. The Holy Spirit is worshiped as God in Matthew 12-31. You see, all this is said about the Holy Spirit. This means that each person is co-eternal and co-equal in power and glory. The Church Father, Augustine says, the Father and the Son and the Holy Spirit, each of these by himself is God. At the same time, they are all one God. Each of them by himself is complete substance, and yet they are one substance. Because there's only one essence in the Godhead, and because each of the three persons fully subsists in that one essence, there are not three all-powerful beings, but there's only one all-powerful being. But each person is co-equal in power, eternity, and glory. The Father, the Son, and the Holy Spirit are co-eternal, co-equal without the slightest deviation in their essence. The Father is fully God, auto-theos. The Son is fully God, auto-theos. And the Holy Spirit is fully God, auto-theos. And thus the Athanation Creed says, we worship one God in trinity, and trinity and unity, neither confounding the persons nor dividing the substance. Isn't that amazing? Neither confounding the persons. We don't mix the persons together and blend them into one. There is true ultimate diversity. We're not trying to make the Father, the Son, and the Holy Spirit one thing. They remain distinct and diverse from all eternity past, but yet there are one in substance. For there's no, though there's one person of the Father, another of the Son, and another of the Holy Spirit. But the Godhead of the Father, of the Son, and the Holy Spirit is all one. The glory equal, the majesty co-eternal, such as the Father is, such as the Son, and such is the Holy Spirit. The Father uncreated, the Son uncreated, and the Holy Spirit uncreated. The Father incomprehensible, the Son incomprehensible, and the Holy Spirit incomprehensible. The Father eternal, the Son eternal, the Holy Spirit eternal. And yet they are not three eternals, but one eternal. Amen. That is the biblical doctrine of trinity. It could be explained through these three pillars. One God, three persons, and each person are fully God. Now, my last point, and this is where it gets good. Why do we need to be trinitarian? Why is all non-trinitarian worldviews incomplete or inconsistent? The trinity is a necessary precondition for knowledge in all knowledge. We must be we must be trinitarian. The problem with non-trinitarian religions, such as Islam, and Islam is what we call unitarian monotheism. Yeah, they are monotheists, but they're unitarian monotheists because they don't believe that the Godhead has more than one person. It's one essence, one person. But I'm going to show you, I hope to show you, how that is self-defeating. First of all, in the Quran, Surah 39, 4 says, He is Allah, the One. But this does not mean one in number according to Muslim scholars. For one in number would imply that there is a second. However, the Arabic word ahad, which means the negation of any number, according to Vincent Cornell, the director of King Fraud Center of Middle East and Islamic Studies at the University of Arkansas. I like the fact that he's from the University of Arkansas. He says, God is One. I'm talking about Allah. Allah is One in the sense that there is no multiplicity or division conceivable in Him. There's no diversity at all. We believe that there's diversity in the Godhead. He says, Not in Allah. In Him, neither outwardly, nor in the mind, nor in the imagination, God alone possesses such unity. In God, all there is is just this unity with no form of divisions, no form of differentiation. So everything that God is, is simply who He is without any differentiation. Well, this means that Allah is unknowable. And that's what Muslims would say. Such a view of God's oneness without any diversity means that there can be no divisions or differentiation, not just in His essence, but also within His mind. If God is not triune, then Muslims are right. There is no grounds for any distinctions at all within God. But without any inherent distinctions, all His attributes would be meshed together into one single attribute. However, if all His attributes were one without any distinction or differentiation, this brings in a huge problem. It means that there's no way that we can know Him. What does it mean to say God is love? If God's love is one and the same and identical with God's wrath? And what would God's wrath mean if it was one and identical with His knowledge? And what would knowledge mean if it is one and identical with His mercy? See, if all things are blended together and ultimately all unified and become identical, that means we don't know what love is. What is love? Well, we don't know. We know what love is by looking at the opposite. But if the opposite is the same as love, then it seems to be anything that we can put any knowledge on at all. Terms describing God would cease to mean anything if they can mean everything. Without distinctions within God, John Calvin says, only the bare and empty name of God flits about in our brains to the exclusion of the true God. Boss says this, may we also say that God's attributes are not distinguished from one another? This is extremely risky. Once you say His attributes cannot be distinguished from each other. We may be content to say that all of God's attributes are related most closely to each other and penetrate each other in the most intimate unity. However, this is not the same as to say that they are identical with one another. Also in God, for example, love and righteousness are not the same thing. Although they function together perfectly in complete harmony, we may not let everything endelmingle into a pantheistic way because that would end our objective knowledge of God. That's why Calvin says, if Allah or God is just this one single thing that you can't identify, then we can't know Him. B. B. Warfield commenting on Calvin says, according to Calvin then, it must be seen that there can be no such thing as a unitary monotheistic God. The idea of multi-formity enters into the very notion of God. That is, if we're going to understand God, there must be some diversity. There must be some differentiation within Him. But the great Islamic scholar of the 12th century says this, Al Ghazali, the end result of the knowledge of this unity is that the inability to know God and any knowledge in truth is no knowledge at all. So in Islamic studies and also in the crown, the go is for us not to know God. And if you can't know God, there's no relationship with God. But if God is this unknowable unity without any diversity, then this means Allah cannot love. Robert Lethem says, only a God who is triune can be personal and only the Holy Trinity can love. Think about this. Allah is all by himself. Let's pretend he can think, which he can't even think. But let's for now, just like he's thinking and he's self-aware, it's hard to think of a complete unity being able to even think. What would he think about? Because there's no distinctions in his thoughts. So really, he can't think. But let's pretend he can think, all is up there thinking. Well, how can he love? And if he can't love, how can he be righteous? Do you know righteousness stands upon the fact that there are more than one person? Think about the Ten Commandments, just love God and love your neighbors. But if you exist by yourself and no one else, there's no God, there's no friends, there's no neighbors, not even a dog. And you're just by yourself in this empty blank space. How can you lie? How can you steal? How can you covet? How can you hate? You can't. You can't hate. You can't transgress. But you can't love either. You see, Michael Reeves in his wonderful book, The Lighting in the Trinity, which I highly recommend. He says if God is a single person and has always been alone, why should he speak in his loneliness of eternity before creation? Who would he have spoken to? And why would he start now? The habit of keeping to himself would run deep. Such a God would be far more likely to remain unknown. And C.S. Lewis says all sorts of people are fond of repeating the Christian statement that God is love, but they seem not to notice that the words God is love has no real meaning unless God contains at least two persons. Love is something that one person has for another person. And if God was a single person, then before the world was, he was not love. All is not love. It cannot be love. He doesn't love his followers, nor can he love his followers. Jonathan Edwards says it appears that there must be more than a unity in the infinite and internal essence. Otherwise, the goodness of God can have no perfect exercise. To be perfectly good is to incline to and delight in making another happy in the same proportion as it is happy itself. That is to delight as much in communicating happiness to another as enjoying it for himself. I love that. So this is the highest good is to take the happiness that you have and want to share with the ones you love the most. That's why I watch a movie twice. It's the only reason. I'll watch it once and I'm done unless someone hasn't seen it, right? And you want to share what you enjoyed with the ones that you enjoy. That's what God's love is. God loves you. He shares what he enjoys, which is what? The son. I love the son. The father says, I want you to love the son and enjoy what I enjoy and participate in that which I participate in. That's the highest form of love. God was a triune. How could he do that? He couldn't. Ola could not be personal like our God. Robert Liemtham says, in fact, he's the lecturer at Systematics and Historical Theology at Wells Evangelical School of Theology. This is what he says. If he were not love, he could not be personal either. And this means Ola does not enter into a personal relationship with us nor can he. But sadly, this is where it becomes all self-defeating. They believe that the Quran is the revelation of Ola. But if they're right about Ola, Ola can't speak. If there's no differentiation within God, then there cannot be any differentiation in the mind of God. Consequently, without God being able to distinguish between various thoughts and attributes as in monastic pantheism, God would be utterly unknowable even to himself. In fact, that's what Aristotle says about God. We cannot know him. He's this unmoved mover. But neither does God know himself. If God can distinguish his knowledge from any of his acts of power, it would be impossible for him to reveal himself to man. And this is why Jonathan Edwards says that the divine revelation is rooted in the doctrine of the Trinity. If there's no Trinity, then God cannot speak. He cannot communicate because there needs to be diversity or distinctions within the mind of God. And if God is this mesh of unity without distinctions, he doesn't know wrath from law. And if he doesn't know that or can't distinguish that in his mind, how is he going to reveal that? How is he going to speak? Speaking by its very nature is taking bits of stuff and separating it from other bits of stuff and communicating to us in a way that we comprehend. God is all that is impossible for him to do such a thing. Well, God intrinsically, that is, in this intrinsic Trinity, in the ontological Trinity, in the fact that God has always been a communicative God. That's who he is because the Father and the Son and the Holy Spirit from all eternity have been speaking. How they've been speaking? Because they've been speaking to one another. And because that's who he is by his very essence in nature, he's capable of revealing things to us. He's capable to speak to us who are made in his image. Thus, communication necessitates that, our divine revelation necessitates that God is triune, that God is able to speak. Thus, the Cron says it's the revelation of God. But their God cannot reveal. We need the Trinity. But let me conclude with this. Not only does the Cron have a misconception of the Trinity, and if this was really the revelation of Allah, would he not know what the Bible had said about the Trinity? Why would Allah craft a straw man argument? But that's what Allah did in the Cron. This represents the biblical teaching of the Trinity. We don't believe Mary's God. But more than that, their God is impartial, unrelatable, unknowable, and unloving. Aren't you glad for the Trinity? Here's my closing exhortation.  Shame on us if we do not delight in the Trinity. Shame on us if we're not trying to grow, not just in obedience, but her obedience is driven and motivated out of love, out of love to be with Christ and the Father and the Holy Spirit, and enjoy that mutual, glorious relationship. He prayed for that. The highest thing that we may go to glory and enter into a perfect, without sin, without covetousness, without jealousy, that perfect relationship. Let's practice that now. Let's grow in that now. Let's love God with all of our heart, with all of our mind and soul, and let's love each other. Let's love each other less. We love ourselves because we're made for relationships, and only Christianity provides that. Let's go, Lord, in prayer. God the Father and the Son and the Holy Spirit, we love you and we're thankful for you. Thank you for loving us. Thank you for bringing us into a relationship with you. I pray, dear Lord, for those who may be here that is outside of that relationship that does not know you, that is alienated from you because of their sins. Dear Lord, I pray that they would see how their sins have separated them from you. Lord, I pray that they in Christ would repent, repent and come crawling to you. We're thankful, dear Lord, that you allow us to have a relationship with you. This we pray in your Son's name.


My name is Jack Mostau, and I am very proud and honored to lead the RoboTutor team. It's amazing. The average person should care if they have a heart. If they care about kids growing up by the hundreds of millions without learning how to read. If they care about kids missing out on all the things that you can do and learn about if you read. There are lots of books with lots of wonderful things to learn about in the course of a lifetime. Living without that is a blighted existence. As a techie, I'm really excited about our setup for remote field testing. So the tablets are equipped with software that records screen capture video, the audio, the screen touches that show up as white dots, and the camera input of the kids' faces. Whenever there's Wi-Fi, another off-the-shelf app uploads all that data, so we get it as soon as they've got Wi-Fi. I love doing this. This is the most fun I've ever had in my career. What could be a better way to feel a sense of purpose in life?


Satguru, if the creation is perfect and the Creator has done such a good job on us, as you say, why is there so much suffering in the world? Why do we need to depend on somebody's compassion to exist here? So, if creator had done a good job on us, why there is so much suffering in the world? Why we need to depend on other people's compassion and understanding to exist here? This is like, it happened once, a little boy came home with a ten dollar bill. But Luke, in Ohio, a little boy came home with a ten dollar bill. His mother asked, he said, I found it. His mother asked, Luke, did you really find it? Are you sure? He said, sure, ma'am, I even saw the man looking for it. Why there is so much misery? If this is a perfect job, it's such a perfect job that it gives you the opportunity to be whichever way you wish to be. If creation had not given you the necessary opportunity to be what you wish to be, then there would be no possibilities, isn't it? Then there would be no such thing as liberation. So why create a bondage and then liberation? Why couldn't you be liberated? Then there would be no creation, only because there is creation. Now the possibility of going beyond that. Now in animal nature and in other forms of life that you see around you, every kind, there is not much possibility. The possibility is just to survive, procreate, carry on with life and die one day. Because there is not much possibility, there is not much misery either. You don't see other creatures of the planet suffering like human beings. Their suffering is purely physical. If they are physically harmed, they are in pain. Even in pain, they do not know the kind of suffering that a human being knows. Human being knows this suffering not because creation gave this suffering to you. Creation just gave you the freedom to make whatever you wish to out of yourself. You're making suffering out of yourself or a large population of the world has decided to make suffering out of themselves. That is their choice. Physical realities sometimes are comfortable, sometimes are not comfortable. That is so. We have been given the necessary intelligence to create necessary comfort for ourselves. That's not an issue really. If we have no problems with each other, creating comfort for all the population in the world is not a problem. It's not at all a big problem really. Simply because we have inner problems, simply because this freedom which would have been a benediction has become a curse upon humanity. Right now what human beings are suffering is not their bondage, they're suffering their freedom. If you suffer your bondage, it's all right but if you suffer your freedom, that's tragedy. Right now human beings are unfortunately suffering their freedom. This moment you can make anything out of yourself, you can make joy out of yourself, you can make suffering out of yourself. But to do if fifty percent of the people or ninety percent of the people are choosing to make misery out of themselves, that's not creation's fault. Just gave you the freedom so that you could go beyond. Once you have come as human, you are not trapped anymore. Other creatures are trapped in their own instincts, beyond that they cannot think. You have instincts for survival but still you have the possibility of going beyond this instinct. If you don't choose to go beyond, that means still enough suffering has not touched you because it's unfortunate in the world that very few people transcend out of their intelligence. Most people have to be trashed by life, only then they will transcend. Only then they will think of going beyond, otherwise no. I don't know if you're aware of this Luke, you came early but in India if you tell somebody that I'm living in an ashram they will ask you why what went wrong, what happened to your life. So they believe only after something really goes wrong you'll go to the ashram, okay. Because most people's intelligence is such because they kept their brains in cold storage. They think they're going to use it in future. So they can only seek anything beyond when something really goes wrong with their life. Until then even if something really goes wrong they will only pray for a better life next time. Now you don't have to depend on anybody's compassion or understanding. The whole world can live under the umbrella of your compassion and your understanding. I would like to see that you stand up that way, that the world lives under your compassion and understanding. You don't live in other people's compassion and understanding. If you have any dignity that's how you should live, isn't it, isn't it so?


The study provides rigorous bounds on the generalization error in variational quantum machine learning algorithms based on parametrized quantum circuits, showing that known implementable models generalize well from an efficient amount of training data. This article was authored by Matias C. Karo, Hinyuan Huang, M. Sarazzo, and others.


Look at me recording in vertical mode. In general, you probably heard me complain about people recording stuff in vertical mode, but I've also have done a couple of vertical videos when they make sense.  For example, I'm filming my phone's screen, which is in vertical mode. If I was to record this on a standard portrait mode, you would lose resolution. I'm trying to get you the best resolution for this video. So even if you're on a desktop where your screen is in landscape mode, you're getting better resolution. Otherwise, I would have to, it would be squishing things down and cropping things out. We're getting the best resolution here. So just don't jump down my throat because I also hate vertical video when it's used improperly, which is 99% of the time. Anyway, today we're looking at, this is a fresh install of lineage GIS or GSI on my old Motorola Power G 2021, I think it is. And I just loaded it up. I installed Turmux and Turmux API. Those are two packages you're gonna need for what we're doing today. Turmux is a nice little shell environment.  And then we also have to install the Turmux API package. It is important you install them both from the same place. Otherwise they can't interact with each other, which they need to do. So if you install Turmux from FDROID, make sure you install Turmux-API package from Turmux as well, or if you use the Google Play Store, install them both from there, or wherever you get them, make sure you get them both from the same spot.  Once you have them both installed and you start up Turmux, you're gonna have to do PKG install Turmux-API to access the API. I already have that installed. Once you do that, what the Turmux-API application does is it allows Turmux to really interact with the Android interface. Turmux by itself does all your shell stuff, but if you want to access, for example, your Android clipboard to either put stuff in the clipboard or retrieve stuff from the clipboard, you're gonna want API installed. If you're gonna wanna access your cameras on your device, you're gonna want the Turmux-API installed. Or today we're going to do dialogue boxes. Yeah, so once that's installed, you should have a command called Turmux-dialogue. Run that and by default gives you a blank dialogue. This is going to be kind of like Xenity or Whiptale or one of those easy to use, simple dialogue boxes that you would use on your desktop Linux device to get simple dialogues, but Turmux has it all built in so you can write shell scripts and create icons and links or just run those scripts, however, and you can get a GUI dialogue. And right now we're looking at Turmux-dialogue, but you can also do notifications on your phone or little toaster pop-ups, which we'll look at in the future video. But there's a lot of options for this, just like you get with Xenity or like I said, Whiptale, there's a few other ones out there, but let's go ahead and get started. So just writing that gives you the blank dialogue. If we do dash T, it will give you a title. So we can say, hello world. I might do a lot of typos, gonna type fast, but don't worry, I'm not gonna stress myself out about typing these properly as far as the strings. Hello world, and then we have this little box we can type something in. I can say, hey, back at ya. And if I hit okay, you can see it gives us exocode, and then it also gives us the text that was typed so you can retrieve the text someone typed that way. So let's do that again. Let's clear the screen. We'll run that command again. And instead of hello world, we can say what is your name? And then when we, oh, forgot the closing or opening quotation mark there. And now we get this and I can type in Chris, great, perfect. And I get a responsive Chris in a nice JSON format. But we could also put a placeholder in that text area so I can say enter name here. And when I do that, now we get what is your name? And then down here it says enter your name here and then I click on that and it's just like a placeholder on like an HTML form. There you go. And we get that output that we can grab and do something with our script. You can also do confirmation boxes where you just want yes or no. So for example, instead of just typing this, instead of termux dialog, the default is that input box but we can do confirm. And we can say, instead of what is your name? I can say do you? Again, I typed something wrong. Want to continue.  Bunch of typos right there. And we can hit enter there and we get a dialog box that says, do you wanna confirm? By default it says confirm. Again, we can say yes or no. We'll get that output and then we can do something with it later in our script. And then we can also give dash I and say, that's the title of our box up here. So we can just say instead of, do you wanna continue? We'll just say continue. Again, typos. I'm not gonna worry about the typos. I'm gonna keep saying that. Would you like to continue? And now we say continue as the title and then we'll say, would you like to continue yes or no? If I click no, it will say no.  You can also do date dialogues. So again, termux dash dialog and we can just say date. Again, we can give it a title. We can say dash T, what is the date? Or what is your birth date? Or whatever question you wanna ask. Boom, it's gonna open it up.  So we already know what today's date is. So we could do something like that but we can say instead of what is the date, we can say, what is your DOB for date of birth? And then we can give it a default date. So dash D and we can say 04091975. And now it'll say, what is your DOB for date of birth? And it didn't, it didn't default to that date. It should have. Did I type something wrong? Dash D. As you can see, when you check a date, it gives you the date. Oh, I'm looking at my notes here. But it does not change the default date displayed. The following changed the default date if none is selected. Oh, hmm. So it doesn't default to that day but if I don't select a day, okay. Ah, good. Good thing I wrote notes on my notes and I'll link to all my notes of all these examples below. That doesn't change the default date shown. It will set a default date. If you hit cancel, it returns the default date. That's what that does. See, it's great to have notes and I'm sharing them with you in the description of this video. What about radio buttons? So we can do again, termux, dialogue and we can say radio for radio buttons. And then we can say dash T. Please select a user. And then we're gonna do dash V for our options and then we're gonna give options separated by comma so I can say John, comma, Jack, comma and Jill. And you can give as many as you want. I'm sure there's probably a limit but it's probably a lot. And when you do that, you get an error because I typed something wrong. Let's see. Oh, that shouldn't be an R. That should be a T. There we go. So it says please select a user and then you can select. It's a radio button. So it just lets you select one whichever one you click. It'll return that. It'll give you the index of the item and also the text. Okay, let's look at this. How about a sheet? Okay. It's similar to a radio button but slides from the bottom and instantly enters on selected. No okay button. Okay. So with our last example, again, I was just reading my own notes. We select one and then click okay. If we do the same thing, let's run the same exact command but instead of radio, we're gonna say sheet with two E's that is. It gives you a dialog down here at the bottom and as soon as you select a name, it chooses that. So there's no okay button but it returns the name, there's text that you selected and the index. Great. Now let's look at spinner. So same exact command. We're gonna leave the title the same, the same options but we're gonna say spinner. And now we get a spinner dialog which is basically like a dropdown box here but it's called spinner. I'm not really sure why it's called a spinner but that's what you get. So you can choose it. That's probably good if you have a long list instead of it all being in one dialog. Okay. Another option, how about passwords, right? You wanna enter a password. You don't want it displaying on the screen. So we do the same thing and then we can do a default input so we don't have to give a type because it's gonna default to an input and what we're gonna do here, we can give it a title, please enter a password and then we can put a placeholder if we want. We don't have to but enter password and then we just do dash P and the dash P option tells us that it's password. So if I come in here and start typing it's gonna act like a Android password which only shows you the letter that you're typing as you're typing. Okay. But of course it returns it in plain text in your script. So let's see. How about a multi-line input? So let's go ahead, go to the last one. I'm just gonna leave all that text but instead of dash P we can do dash M. So we're not giving it a type so it knows it's default to input and when I run that, well now I can type in this and this and I can give it a multi-line input and when I click okay, it returns that in a string with the new line backslash N so you can split that up in your script and do stuff with it. How about entering a number? So on Android devices, you have your keyboard, that's what this is called, your touchscreen keyboard down here which can change depending on the type of input you give. If you're writing something in HTML you can say that it's a numeric input and it will default to your numeric options, your numeric pad on your keyboard. I don't know why I keep forgetting the word keyboard. So here we can just say please enter a number and I'll just say enter number and then at the end we're just gonna say N for numeric and when we do that, we come in here, we click here and it defaults to your numeric touchpad so that way they can enter just a number they don't try starting to type. It's easier for them to type on this and it's just great. I just love that you can on machines like this default to a number pad and let's see. And we have number and then the last example I have is selecting the time. So we're just gonna again say termux dash dialogue and this time we're just gonna say the type is a time dash T for title because you don't have to give it a title but it's usually a good idea. We'll just say select a time and there we go. We have your nice little, it's gonna default to whatever clock type system that your phone or user so it's what the user is familiar with. We can do AM, PM, we can change the hours, we can change the minutes. If you want, you can bring up a keyboard I guess. Oh, and then we can type it like that. Just like any other application.  But yeah, there's probably more options but those are all the basic ones. Again, I'll put a link in the description of this video to all these examples. I hope that you enjoyed this tutorial. I hope you found it useful. It's great to be able to write scripts that are specifically for an Android device that gives the user, it makes your shell scripts more user friendly on a touch screen, small touch screen device like a phone. So maybe you'll use this. And of course you can always with Turmux add scripts to your home screen with icons or you can have a shortcut list. That's all stuff that you can do with if you install the Turmux widget app. So yeah, thanks for watching. Please visit my website filmsbychrist.com. That's Chris the K and in a future video we're gonna look at doing this sort of thing but trying to make your script so it's compatible across different devices. So you can write a shell script once that uses dialogues if a GUI interface is available that will work on your desktop Linux or your Android Linux or if there's no GUI interface it will default to the shell. Thanks for watching. And again, please visit filmsbychrist.com. That's Chris the K. There's a link in the description as always. Have a great day.