Yeah, Mothry told me there. He was at that event and that's when he shared his memories of Snoop with me Wow, what and what did he what did he say? He liked about his music. I don't even think music was on there Yeah, they was just Did it snoop the little Snoop ever did he have did he know Mothry or did he ever I mean I found out that he did I didn't know who three but Mothry told me to him and Snoop, you know, Mothry told you that yes He did where we all at we were at an event Violence top the violence event with the urban specialist Wow shout out the score. Yeah, and so they had Yeah, Bishop Omar and They call him kiddo but Bruce Wayne So yeah Mothry told me there. He was at that event and that's when he shared his memories of Snoop with me What and what did he what did he say he liked about his music? I don't even think music was on Yeah, they was just I don't think music was ever but even though cuz I remember skip cheat him was it came 104 back in the day Okay, he came on Whitehurst in a van. It's really freestyle for him. Wow. Yeah, he did So he he definitely kind of been doing it. Actually, there's another group here. I can't think of their name They used to let Snoop come to the studio with them, but if he messed up in school, I wouldn't let him go So they you know, he was younger being probably like 11 to it right something like that. Yeah, man. So I know that's just crazy, man just Have to go through what you went through that time, you know what I mean during that time up until the day You know what I mean? Yeah, we on boss talk one-on-one Yeah, we gonna


Okay, there we go Hello everyone I'm good to see you guys here for attending my sessions of Linux essentials and networking stuffs So it is going to start with a brief introduction about me what I am where I'm from what actually I do So I'm a Gotham Wurma doing software developer from Indore, India Currently I'm appointed as a mentor at Google Summer of Code under Liquid Galaxy organizations and Apart from this I'm doing a WinkStuff at ETH India fellowships That's for my past experience if we take a look into that I am a two-time contributor at Google Summer of Code Again under the Liquid Galaxy organizations and in parallel I also did an internship under the support of Bitcoin under the Eclure organizations and I have built somewhat around the monitoring tools for Ethereum node that this does Stop related to a monitoring and visualize the time-series metrics and with the help of Grafana and Prometheus Apart from this and developing stuffs. I have a bit experience of writing a technical content Like under the Geeks for Geeks organizations or company. I have like written up certain amount of articles that are related to tech terms like working Programming languages and stuff around this So at at at like at last I have a pretty good experience of working in tech industries around two to three years of experience like experience and And yeah, let's see what we are going to discuss in the sessions and How how we will gain the knowledge about the networking essentials and in the Linux. So let's get starts master in Linux essentials. So like Networking is a stuff which is we want to have in our system when we need to communicate with our network or another device Networking is essential if we want to perform a wireless connections over Over the sharing of data and stuff related to that Not just a but but the thing is that working is not limited to wireless connections We also need a networking stuff when we perform the networking via cables via modems via hub Like networking is essential if we wants to connect with the word Right, if we want to connect with any other computer, we need that working if you if you want to send our data to Our other stumps we need networking. So networking is essentials for for like in this world And in the session, we will see how we can perform the networking in Linux and what are their basics concepts of the networking's and and like we will also see some critical services that is that's comes under the networking and And after this we will see how it's like how we can manage that working stuff in Linux And at the end we will see some general problem that generally occurs when we perform on it for the stuff and Linux so let's start So like before getting deep dive into our managing of networking It is it is what if we have a brief introduction about like what networking is or like like like what is IP address What is subnet type? What is DNS? What is DHCV? This is somewhat a service related to our networking So if we will first take a look into the services and then like we will move further on first We will clear up with the fundamentals and then we will take a look deep dive into our next next store So the first time they can So IP address is nothing but a unique numerical identifier that is assigned to an every device Connected to one network and that uses the internet protocol for communication, right? And the thing is IP address enables device to communicate with each other and to access the resources on hope like over the internet and and then IP address consists of Six as you can see that and this we have Notations for IPv6 Like which is the four so there's six versions of internet protocols If we talk about the IPv4 like version four addresses and this is these are basically a 32-bit number and Represented as a four decimal numbers are predicted by DOS as we can see this in this example and for the IP address IPv6 addresses there is that like Numbers are are like usually represented in hexadecimal notations and we can see the examples here We have a like two example that completed completely represent IPv4 and IPv6 and so that's all about the IP address we are Like mainly use these two types of IP addresses that is IPv4 and IPv6 We have discussed this form and like we have discussed the format of IPv4 and IPv6 So in IPv4 we are limited to like around 3.5 billion addresses But in IPv6 we have a huge huge like huge Range or limit of IP addresses. So we came up with the solution of IPv6 and At the end I will say that IP address is nothing but an internet protocol that help our device or note to identify their Identity uniquely over the internet or a network For the basic communications between them. So this is all about IP addresses. Let's get Let's get into more about the subnetting So here subnetting is a process of dividing a large network Into a smaller subnet or we can see that subnets this is typically done to to like improve the networking efficiency and like allowing the security by better control over the network traffic and Like it is also used to minimizing the impact of network failures or attacks because Because the main main big networks are divided into a subnetworks In the example you can see that we have the home network that has an IP address Which is range of <IP_ADDRESS> to <IP_ADDRESS> right with the subnet mask of <IP_ADDRESS> This means that the first three octet of IP address that is 192.168.0 represent the network portions by the last octet is represent the host portion that is 1 2 to 54 and And the thing is subnettings allows us to like further devise a network into a smaller subnets by the sending the subnet mask and In this example, we can see that we devise our home network into a four subnet mask by dividing the range of host portion as you can see that here in the example we clearly divided from 1 to 62 and 65 to 126.63 host 63 and 62 host So that this is all about a subnetting. Subnetting is one of the major like fundamentals of networking because we usually Needs to devise like divide our big network into a subpartus by handling with the big network and it also minimized the issue of getting attacked by any Needs equal to creatures. So it is good to know the what is actually subnetting is So let's move ahead with some network interfaces so Network interfaces is an hardware or a software component that That that enables a computer or user or another device to connect to a network It is as the name suggested that it provides the interface between the computer operating systems and physical network connection and a network interface can be a physical component like Network interface card or like any wireless adapters and it can be a virtual component also such as a software divine network interfaces that we usually see in the Docker type things and If we talk about the physical network interfaces are basically installed inside of a computer and or or a device and Connected a network wire ethernet cable so this is a physical And we say the physical network interfaces While on the other hand we see the types of network interfaces that connect the wirelessly We can say that virtual network interfaces or or or like created by a software and Are used to connect virtual machines to a network this in like the thing is this in like interfaces are created and managed by the hyper visual and Which is the software layer that enables multiple virtual machines to run a single physical machines If you like you know about the hyper vision if you know a bit about how virtual machines actually works and How how how they perform the communication between each of them. So hyper vision is set between the between like act as an as an communication manager and Yeah, this is all about network interfaces Like nowadays we have literally wide varieties of interfaces and we can't even take a look all of them so here you can see some pictures of Basic network interfaces like Ethernet Wi-Fi Bluetooth and Docker and the Docker we like the dockers is like most of us are usually used to docker for Managing or like deploying our applications So we we know about how how networking interfaces are actually quite in Docker and that's for Wi-Fi and we are using it from from our channels So we know that how our Wi-Fi provides our our facility to to like interact with another networks and Yeah, this is all about the network interfaces So the thing is now I want to see the available network X network interfaces and Linux So how we can see that so far like for for like Seeing the available networking interfaces in the next we have a wide variety of tools available in the market or Or like also it it came in to be installed by default But one of them is called a fan CLI and I'm CLI stands is a Like a command line duty or stands for the network management on like It it it helped us to manage the network interfaces in a efficient manner Like in this snapshot We can see that we are using the command and I'm CLI device status that have a various columns like device Which types of network interfaces it is it is connected disconnected or unmanaged states We also have connections at the end and it it likes we have the computer couples or the correlations between between like in the case like in the table and we can easily see what it is about The network interfaces in the like with the help of this command all you need is to run and I'm CLI device status You will get information about it As you can see that I am using the ENP zero S3, which is a type of Ethernet and it is a kind it isn't like wireless acquired elections so somebody like you will get information about this and Yeah, that's all about the network interfaces Now like we have the brief introduction about network fundamentals like what is subnetting what as IP address? What is network interfaces? So, yeah, like the thing is we are a bit familiar about what the Basics fundamentals of networking. So now let's take a look into a critical services that is provided Like we usually use in the networking and and we usually use in any in Linux also Okay So DHCP DHCP is nothing but a dynamic host configuration protocol And it stands for the as I said that it's it's called like like a dynamic host It is a network protocol that is used to automatically assign IP addresses and other network is Other network citizen settings to the device on our networks The thing is when a device is connected to a network that uses that DHCP It sends a request for an IP address and other network set is it that is the settings Like some like this is a simple thing whenever we our device is connected to a network that That uses the DHCP protocol It sends out and a request for assigning the IP address and the network settings than a DHCP server network That responds to this request by assigning available IP address and the other network settings to a device This this works simple as it is edit as it seems our our device make a request for for Assigning an IP address settings and IP address to a DHCP server and DHCP server will respond to this request by assigning available IP available IP address from a shared pool and other network settings to the devices The DHCP server You like uses the pool of available IP address and another settings and which can like which it can assign to devices as they connected to it Don't in that works as as I said this This enables a device to automatically configure with So like the user not need to perform any Configuration they just need to connect a device that device will make a request to DHCP server And the HCP server will respond to a device with the assigned IP address and like and that IP address will be available and With the other network settings like some like some like math and Okay, so now the thing is What if I wants to see the light working on DHCP in the next? We haven't various tools for foreseeing the life working of DHCP in Linux, but majorly we have Like we like we usually use the two tools that is one is wire shark and another is to see we don't Wire shark isn't like opens a software that enables a user to capture the packets over the internet This this tools can easily help you do modify like to capture the DHCP protocol like DHCP protocol DHCP protocol DHCP protocol packets and we can easily make us some filter over it and then easily see the packets on the dashboard of wire shark and another another method of like seeing the DHCP protocol is We use the TCP dump command if CP dump month is also command line utility that Widely used for capturing the packets that is moving over the networks all you need to just think like I did like All you need to just type the interfaces that as you can see that in this command We are running this command as a pseudo privilege as soon as you can be done That's like an eye. I've got eyes next for the interface that is ETS zero and the port number Here I'm using a port number 67 and 68 because the ACP uses this protocol like this ports for communications and for sending the packets and this and like this the ACP uses this 67 and 68 port number for for the packet conversion for packet communications So this is all about the ACP now Let's see how the ACP actually work like how they science request how the ACP Responds to that request and then finally assigned the data settings to it So yeah, like in this in this picture, you can see that in the left side We have the Linux client on the right side. We have the DHCP server and the firstly when like whenever our client is connected to the network they They they they broadcast the DHCP discovered message and the DHCP finally Receive it and then DHCP server sends the DHCP offer Broadcast message again to DHCP client and and again the HP if it be request that they can I mean our next slide But it would make a DHCP request to a DHCP server and then finally So I assigned the IP address along with some reference settings and at the end we have that knowledge Acknowledge the message from the DHCP server So, yeah, that's this is all about the communications between DHCP clients Next slide. So, yeah Another critical service DNS Most of us we already know about DNS because it is the most popular Popular like services that we used and in our daily life while we use of email While we use web browser while you visit sites and I think so, let's understand what this DNS is So DNS stands for the domain and systems. It is a system that translates the human domains like www.example.com or like www.world.com into the IP address that machines can understand That is we discussed that IP address that we discussed in our previous slide. That is somewhat looks like <IP_ADDRESS>.880 so this is What the machine understand? Machine doesn't understand what is the domain machine don't understand what is www.example.com The only thing machine understand is the IP address and that may be an IPv4 and IPv6. It doesn't matter And the thing is the DNS system is a distributed database that is managed by a global network of a DHCP server Like whenever the user enters a domain into a web browser or another application the DNS system search for corresponding IP address and the return its address to the user device and The process of resolving a domain names to an IP address involves several steps as at first the user sends user device sends DNS query to a local DNS server and if DNS server has a requested information in its cache then it will definitely return the IP address to the user device. If the information is available in the cache, they will respond to the user request immediately But the thing is what if the information is not available in the cache If information is not available in that local DNS server cache, it forwards the request to an upstream DNS server Now the process continue until the information is found and returned to the user device And the DNS is used in the wide range of applications including email web browsing online gaming local server for file transfer without DNS user would need to remember the IP address of all websites And it is literally next to impossible for us for understanding or like for reviving the IP address of all the machines And it will literally create problem for us. So DNS is the most widely a service we usually use in web activities and email in web browser and And let's see how the working of DNS with the help of this example As you can see that in this this browser suppose amra, I want to visit www.example.com and wants to get my information about the file I will first make a request with a DNS server and suppose that the DNS server have the corresponding IP address for www.example.com in its cache It will immediately return the IP address for it as you can see that here we have <IP_ADDRESS> That is the IP address over with the example.com server response. So when we visit this IP address the web server respond us with the help with this Data or our information So this is all about the DNS working. I hope like you are like you guys are getting a Pretty good information about DNS working in DHCP working network interfaces and Some water stuff related to our network research later on we will see the How minus the network settings. I think that we have the brief introduction about networking What networking is what like what we usually do in networking? This is just a smaller or like a small parts of networking all the networking is literally big The more we get into it the more we will discover it Yeah, this this is all about the networking networking. This is so big We can't cover all this all the networking stuff in the one sessions We need a lot of station for covering Covering the all the networking stops. So let's see how to manage the networking settings Yeah, so in this in this like like from like from this slides from this current slide We will see the limits commands only for managing the networking stops and We will see some command lines too Or that we usually need to use while managing the networking services in limits and Yeah, that starts so if conflict This is the most used Command I have ever used when when searching for the IP address of my systems or any Or any network interfaces that that is connected to my systems So as you can see that I have one pick high point A This is the commands look simple and return a simply all interfaces that is currently available over our systems And it returns information about whether it is down or up All we need to just use a high point a flag like this Like this flag And with the help of ip config we can perform several tasks also like to activating or deactivating the network interfaces And we can also assign IP address like a particular IP address to interfaces by running this command As as in the second command you can see that I am assigning This 190 like <IP_ADDRESS> IP address to ptl 0 Interface with the subnet which is like the net mask of <IP_ADDRESS> So when the other this command I will like I will be able to assign this IP address to the particular network interfaces And for the rest of two commands And one is for the activations and one is for the Deactivation or extra to known on network interfaces And we can like all we need to do is like sudo. I can't pick up The interface name it may be etn0. It may be some more Docker and any other Network interfaces that's not a matter And for deactivating we just need to do a vice versa. We didn't up We like we did also the if config down etn0 So yeah, this like here in the screen we have examples how if config command looks or like render the information about the network interfaces as you can see that We have here like information like this up We have The broadcast that is running multi-casting But the like iNet number is ipv4 now IP address and this is ipv version 6 IP address This is the broadcast IP address And this is the name of network interfaces So this is this is the information that is actually written by the iNet config command And with the help of this we can we can identify the types of network interfaces that is connected to our lennet systems Yeah So yeah, here we have the another tool that is eth2 it is also Also another command line utility Which which which is used to like manage the internet Like network interfaces over the Or we just we have here we can see that there are three We take different ways of using this command first commands are like eth2 interfaces, which like which which like just out all the informations about the interfaces like what is the Interface name what is the status is like is it up or down The speed of internet connections The duplex mode with half power flex full group duplex and other supportive features So This like this up to command you can see that one is for the speed and another is for duplex With the help of this we can we can like we can set the duplex mode Whether we want to work full duplex half of blacks or as Like with the help of this tool we can also set the speed for an effort interface So I guess this is a pretty like pretty good tools we can use for For like setting up the levels stuffs around the networking So let's see the example, okay, and this example you can see that i'm getting the information about uh Interfaces that is sample in p0 s3. So as you can see that we this is uh Like auto negation is yes is like this is the speed is thousand mps But not actually a thousand mps because actually this is too much like as this I connected a wire This is showing just because of this because this is a wire network But if I take a look over the wire that it will be it means or like a town Because it is actually impossible as you can see that the port is to set the pair cable and uh And yeah, this like you will get this this was some kind of information about Uh about the network interfaces And it's like in this we can also see that the duplex mode is full Okay, so here we have uh the another command line tool that is root So root is a limits command line utility That allows us to view or modify the network routing routing table So routing table is nothing but a table which is used uh by the operating system to determine in The path that network packets take to reach the destination Suppose, uh, there is a sender a and there is a sender receiver b So if sender space and some message or packets to receive a b Then routing table will contain the information about the path or the way that uh, uh The packets that they uh, let's take from uh sender a to receiver b On or in between a route that is taken by a packet to reach the destination So routing table contain the information about uh about the route that uh that like that like that is taken by the Packet and based on the description of ip address and available network interfaces So let's see how actually a routing table or route commands use and looks likes Yeah and like here you can see that how the routing tables looks likes and And how about the how we root the like how we use the root command with the help of root command We can also define uh, like we can also define a route for traveling the packets We can like we can define it we can define it manually also So in the first uh command or first screen shot, you can see that we are simply seeing the Routing table and in this we have the various columns including the destination the gateway gen marks Black metrics reference use and ii ii ii is nothing but a network interface so like with the like the Like one of the important things I personally think about the route table is that it provides a entry or exit point Of networks, right? So with the if if suppose if our systems get in trouble and if attacker attacks our node Over the internet networks or over the networks and and we want to see the entry and exit point of Of attacker so with the help of routing table We can easily see the entry and exit point and and and like and with the help of pseudo privilege We can delete the entry and exit point of Of attacker so this like performance activity will prevent our node from being attacked by any attacker so in this in like in the below command you can see that I have added the uh IP address and in the path that is that means to be taken for Duri's the destinations and And the like in the above command I have run the pseudo with the pseudo privilege which command add And then if we take a look at the route route table you can see that we have added here routing And like similarly and with the first of add we can also delete the table All we need to just mention the like pseudo a root delete then the information about the Uh The root or or like way we want to delete And then again this snapshot you can see that we don't have any entry of 192.168.1 So yeah, this is how routing table work So the main aim of showing this Routy route or routing command line utility is you this you to provide how we can how we can see the Root path or that is taken by our our package to the destination. This is the one thing But with the help of routing table we can perform or like resolve lots of problems Suppose if our sender sends the message but but receiver is not able to receive it So we can use the routing table to identify what path it actually takes to these destinations and Is there any problem in in like in in in that particular way or Or the way or or the path they have taken so with the help of root command we can easily see that And also Prevent us from any attacker because with the help of this root command we can see the entry and exit root of the attacker So let's move forward and see our troubleshooting the network issues we we usually encounter when performing a network email and Linux Let's develop Pose your phone that's an error. We are troubling finding that state Most of us encounter with this information that we are not able to find the information This may occur because of server not found. So what is down or server is not able to respond to a request or like many other many other problems So, yeah, pink Pink is a so much cool command. I have ever seen So pink is the command that is used to identify that there is in communication is up between between the between two Forced or like between sender or receiver or not. Suppose the Google who will example. Let's take an example world if Let's understand the pink example for them with Very low level Suppose my internet connection is cut And I'm trying to reach the world.com by a web browser But the thing I encountered is Google is not able to provide you service Like the server is unavailable as you can see that in this previous setup So now let's open a command line to and just type pink world.com This command will set me a request or like the like pink Pink the world.com and check whether the Google server is responding to its request or not If the request is not responding it will say that sex server out of Like temporary fairy it name is always like world.com is not able to convert this into an IP address because because of unable to Like we don't have a network access as we have studied the information about the DNS So this problem occurs because of DNS Like our our world.com is not able to get the IP address of it. It's like where it is running So this problem occurs But when we connect our system with the internet and then again run the pink world.com command We can see that we are receiving some packets from Google That is 64 by 64 by 64 by it means that our system is able to communicate with Google and getting the response from the Google server or like they are having like we are receiving the package from the Google Now we can if we again really run Or like to revisit the website which we want to visit or we will be able to visit So pink command is can be used to identify the problem that is like If the communication is up between the between the receiver or sender or a host or Or or are like a like host or a user as in this case we are the user and Google is host So we check like we simply run the pink or like ping over.com Come on to check whether we are getting the response from the Google or not the another command that is dick dick stands for domain information Grover so dick command is like used to get an information about the particular uh particular domain or particular particular like the particular domain or or a particular server It's perform a dns lockup and this is the answer that is deleted from the purely server name right and Like it is a part of dns it is packet that is installed installed with a point in server And it is usually installed by default And this information returns information about the server as you can see that we we bind it We bind the google.com with the 8.8.8 IP address And here we can see that we have found the one server. There is a global option cmd and And the server name is this It is n here is the IP address that like over with google.com is available And Yeah, we can use the dick command to get information about about the domain or server we want to get So this is also a command we can use to find the general information about the systems or sorry That domain name that is google.com In our case Yeah, okay, so as we move forward In our sessions we have some No command that is based on command So as a means of this place routes a command in linux is actually prints the prints the route that the packet is taken to reach the host, right? As as we see in the routing table, we have information about the path that is taken by a System to read destinations, but in this we specify the destination as you can see that in our example we have like I've mentioned that there is root google.com And And and like the commands Command and like cmd command will do is print the route that packets takes to reach the host This is like a command which is useful when like when you want to know the root about When you want to information about the route and about the hopes that the package takes and in the We can detect how the root command is used to reach the Google.com which is like which is present over the IP address of <IP_ADDRESS> Yes, you can see that in the second line and Like from the local machines and it also reads about all the details about the hopes that we visited in bitwell in between to reach these destinations And as you can see that in the first in the first column corresponding to hope hope counts The the second column represent the address of that hopes and after that you can see that three space separated times in the milliseconds and And the trace routes command sends three packets to the hope and each of times referred to the time taken by the packets to reach the hopes So, yeah, this is all about the trace route. We can use this command to to like to to check the What uh, root Takes to reach the destinations or google.com Yeah Let's move forward with tcp thumb command and we have the end of this session So as you can see that in earlier in the dhcp Like while we are talking about the dhcp We get to encounter about a tcp dumps command which is used to capture the packet that is moving around the Of like which is moving around the network over some addresses along with the port number so this Uh tcp dump command is used to capture the packet that is running over particular address particular port particular Uh particular Interfaces like in this that like in the snapshot again Like you can see that we are we are capturing the packets that is all the packet It is available over the e and p zero s three network interfaces and you can see that we have Like this command render the information about Um on the packet that is moving over this Interfaces this pack this like this commands is usually used when we want to check whether the center center sends the message Or not or like whether whether like whether like the receiver received the packets on the different or like Or listening to our wrong port like with the help of this tcp dump one we can check Like over which port Center sends the the message and over which ports receiver receive the message If centers are sending the message to a wrong port or not But the help of this command we can check it we can check it we can easily check it with the help of this commands so Yeah At the end of this is all about my presentations We are encounter with also information in the sessions and and get a brief info about How we perform the networking in the linux and we also get to know about the critical service that is provided when Provided in linux like dncp dnx server and we have also taken a look at At subnetting we we have taken a look at dns. We have taken a look at ip addressing We also have taken a look at network interfaces and we are also encounter with some of great commands like the root trace root if config tcp dump And etc, etc I hope you guys like my sessions and we are like I hope you guys like my sessions and we And we discuss agree a really great stuff around the networking if you guys having any any like queries or any Any feedback like any valuable feedback for me just reach out to be in the state But your code is available on your screen You can just need to scan it with your phone and just get like problem message or LinkedIn or send a request We will get together if The time suits for me. Yeah, this that's all about me. I hope you like my sessions. Thank you so much. Thank you


So today I'm going to talk about writing a solver for a game called Ricochet Robots. This is a board game. I've got a couple copies if you want to come and play after, find me in the hallway, we'll set up a table somewhere and play. Super fun game. So why would I want to talk about writing a solver for this game? Really, I wanted a solver for the game because we play to work all the time and we never know if we've got the best solutions. And of course the best way to do a side project is to propose a conference talk about it and then get accepted and then madly write the solver and then talk about it all at the same time. That's the best way to get a side project done, right? But really what I'm going to be talking about is some computer science stuff, graph search algorithms and things like that. I learned this stuff back in college, but not everybody knows this stuff. We had a local Ruby users group meetup where we were working on maze solvers which use very similar algorithms and very few people knew these algorithms. So I thought it was worth talking about and the game is a fun way to do that. So why do we care about graphs and graph search algorithms? Graphs are very common data structure in when you're modeling business organizations. Actually in a Rails app I'm working on, we just had a problem where we needed to use graphs and a couple of these algorithms to solve a problem we had. Relationship maps like your LinkedIn connections because I'm sure you all have LinkedIn connections or Facebook, any kind of social network. That's a graph structure. Travel planning, trip planning, network routing. All of these things use these kind of data structures and these kind of algorithms. Obviously much more complex than the ones I'm going to talk about but still they're important so it's good to know about this stuff. So what is ricochet robots? As I said at the board game you have a 16 by 16 grid of cells. There's these colored target cells on there and you have a set of five robots distributed around the board and the idea is you pick a, there's actually 17 little discs with the goal symbols on them and you go through them in order, in a random order, sorry, and the idea is you have to get the proper colored robot into the goal cell. So in this case we're looking for the green square cell and we need to somehow move the green robot into that cell. Now the robots can only move in straight lines and they can't stop unless they hit something. So you have to run into a wall or another robot before you can stop and change directions. So all, what's that? Yeah somebody called 7. And so you can move any number of robots and so everybody starts at the board and figures out how many moves that would take them to solve this, calls it out, whoever gets the best answer within a certain amount of time gets to go. So here's an example solution. We're going to move the blue robot first and then we're going to chase the green robot around after it, bounce off the blue robot and down into the goal cell. That's how the game works and if you're like me you can immediately say, hey I want to write a solver for this because it seems like you should be able to do this, right? But before you embark on writing a solver like this you need to kind of characterize the problem and decide, you know, just what am I dealing with here? So first of all what's the size of the problem space? There's 256 cells, four of them are already always taken up by that center island. So there's 252 cells and five robots. That means there's 976 and a half billion possible board states, different positions of all the robots. That's a pretty big search space. The other complicating factor is the branching factor. From each board state there are anywhere from 9 to 20 possible moves, you know, five robots, four possible directions, that's 20. Sometimes they're in corners, sometimes one is just moved in a certain direction, so it could be as few as nine. That's a pretty wide branching factor. And because there's so many states you have to think about how am I going to represent this board in memory? You don't want to take up too much memory if you're going to have a lot of states in play at any one time. So I studied the board a little bit and thought about it. The grid itself is fixed. It's always this grid with the center island. That's static. You really only need to represent that one time. At the next level are the walls and targets. You can actually have a bunch of different board configurations, but for the duration of one game this is fixed as well, so you really only need one copy while you're solving the game. A little more variable are with the goal, what target are we shooting for right now. That changes once per turn, but it's still relatively static. And then there's the robot positions and those change all the time. So in the solver I wrote I ended up representing a board state as a combination of the goal cell and the robot positions and that's how I represented it. Okay you also have to represent robot movement and in this case the board states are the nodes in the tree and each edge of the tree is the movement of one robot in a certain direction. So the red one moving left or right or whatever. So you hopefully get the idea. So what is a tree? A tree is a fairly common data structure in computer science. You have nodes which I'm representing as boards here and edges, the lines between them. And to make it a tree every node has at most one parent. Okay so the root node at the top doesn't have any parents. Every other node in the tree has exactly one parent and that's what makes it a tree. You have any number of children but one parent. When you have trees you generally need to search through them and that's where search algorithms comes in. If you want a really accessible introduction to search algorithms, see James's book that he just wrote. I read it when he was writing on his blog and it's awesome. Very good accessible. He's talking about maze solvers but the algorithms are very similar like I said earlier. So I highly recommend that and James is speaking tomorrow so I'm guessing he's going to be talking about some of the same stuff. So highly recommend it. So the first search algorithm I'm going to talk about is kind of one of the most basic ones. It's called the depth first search and in depth first search you search all the way down one branch of the tree and then you back up and try a different branch. So that ends up looking like this where we go all the way down to the bottom of the tree back up and over up and over and that's a depth first search. Okay very simple algorithm the program it's a recursive algorithm. So I've got the solve method where I'm taking an initial state solving recursively and as I'm solving I'm building up the list of candidate solutions and then I find the shortest solution and that's my answer. The recursive solution you just look at the path is it a solution if it is put it on the list of candidates return otherwise find all the successor paths. All right sorry about that. Okay so you generate all the successor paths and put them or then solve each of those recursively and that's a depth first search. Now in this solver I started out solving for a single robot just because that was an easier problem to work from and the first problem you run into is the idea of a cycle. So you can get a robot up in the corner here and it starts going around in circles. So you have to guard against that you want to make sure that you don't end up in an infinite loop because you'll never find your solution. So you can think of maybe well let's keep track of all the board states that we've seen before and not process those again but the problem with that is that you can sometimes get to the same cell via two different paths. So here on the left I've got a board where it took four moves to get to that cell and on the right a path where it only took three moves to get to the cell and if my goal is that green circle I've got one more move to go if I if I start with the board on the left and then I find I got to the same cell I've been in before I throw that away and I just missed my shortest path so I haven't actually found an optimal solution. So what you find is that this nice little tree I showed you is not really a tree at all. It's actually a graph where nodes have multiple parents so in this graph I've got a length two paths of the same node and the length one path so you have to watch for that. The other complication is that these algorithms I'm talking about are designed to find the optimal shortest solution but in the rules of ricochet robots there are some short solutions that are not legal. For example if the robot starts on the goal cell already that's not a legal solution you have to leave and go back or if you start one move away that's not legal either you have to actually ricochet once before you get to the goal cell. So here the best solution is to go left down right up now I'm back where I just started that looks like a cycle right except that because that first move was not a legal move I have to not count this as a cycle so it's a little bit tricky then I move into the goal cell that's actually the shortest solution for that board. So there's ways to solve all of these but really this is a bad algorithm because if you if you have to search all the way to the bottom of the tree you have to search the whole tree the whole state space in order to find the shortest solution and with 976.5 billion states now we're not doing that we don't have time so we need a better algorithm so the next algorithm I'll talk about is one called a breadth first search and in a breadth first search instead of working down the branches of the tree you work across the levels of the tree and that's so that looks like this so we look at the zero move solutions then one move then two moves and then three moves the nice thing about this algorithm is it's guaranteed to find the shortest solution first because you're always looking one move then two then three then four and so on so that's nice so the code ends up looking like this and use a queue to help you implement this so I put the initial path on the queue and then I pull the first one off the queue if it's a solution I return it I'm done I don't need to search any of the rest of the tree otherwise you put the successor states all on the end of the list and you move on so with this algorithm we can actually use a global visited list that didn't work with the depth first search because if we get to a state we've already seen before we're guaranteed that we got there faster the first time or at least as fast anyway so that's a nice optimization we don't have to process states multiple times like we did with depth first search but even with this this was not fast enough this can't solve all the boards fast enough so it's time to optimize the global visited list is one form of optimization but really there's three kinds of optimizations we can do one is to do less things we want to somehow try to reduce this the size of the search space another is to do things faster and this is what most people think of with performance optimization where you're just trying to speed things up speed up your code make it run faster run a run a profiler just less work per state with search algorithms there's a third thing you can do and that's introduce heuristics which are basically rules of thumb the thing about heuristics is that unlike the previous two optimizations which are very objective and work all the time heuristics don't always work and they kind of some some states it may work some it may not and so they're they're much more variable often you can find good ones that work most of the time but they don't always work and so you have to be careful with them so when I was working on on my solver the first optimization I tried was actually heuristic and I was thinking about the game and the last move you make is always to move the active robot into the goal cell so why don't we try heuristic where we always check the active robot first because when we get to the level where we're going to find a solution we'll find the solution fastest by moving the active robot first so I tried that with this graph represents is all 17 turns in a game there's several places where the two lines coincide and that's because they both move the same robot first most of the time the red line with the triangles which is with the heuristic in place is a little bit below the blue line so it most of the time helps but there's that one outlier out to the right edge where it was way worse and I don't know why it was like that but just kind of illustrates the point that heuristics don't always work I kept this heuristic in place because overall it seems to be a win I need to analyze it a little more to make sure it really is enough of a win but it did kind of skew my results a little bit because of that one outlier so then I started moving on to more objective optimizations and I realized that I was processing way too many states you remember the algorithm I showed you earlier we check a path force whether it's a solution when we pull it off the front of the queue but what if instead we checked it before we even put it on the queue in the first place so originally to find a solution at node 16 here I had to search all 16 nodes but if I change my code to look like this where I generate the successors and then I check whether any of those is a solution before I put them on the end of the list what happens is I can find the solution at node 16 when I'm processing node 6 so I've knocked 10 nodes off of the search here and you can imagine with a branching factor of 9 to 20 at each level and you get down eight or nine moves in the tree this is a pretty big savings and it turns out it was this is the number of states that I had to consider to find a solution for my example game and it was almost a factor of three improvement a reduction in number of states considered so doing a lot less things and that sped things up quite a bit then I started running a profiler and the next thing I found is that most of my time was being spent trying to figure out where the robot was going to stop because I had a really dumb algorithm I was just going can I move can I move can I move can I move oh I got to stop there and that was where all the time was going and so what I did is I pre-precomputed the stopping cells for the robots so for each cell on the board and for each of the four directions figure out if I move that direction where am I going to stop and and I didn't consider other robots in this pre-computation and this is a classic trade-off that you make in optimization a lot where I needed to use extra storage space to store these pre-computed cells but it made the algorithm much faster so I was trading space for time and that is a classic optimization technique even in your RailsOps database indexes you have to take up extra storage space to store the index but it speeds up your queries drastically so you're trading space for time very common optimization technique and as you can see this sped things up this is the number of states I'm processing in a second and it was a pretty good jump without optimization then I did a little bit of research and I found another talk by Michael Fogelman where he was writing a ricochet robot solver and he made the observation that there are some board states that are equivalent even though they don't look like it so here's two boards the robots are in exactly the same positions but it's different robots in those positions if I'm solving for the green robot it's in the same place I don't really care what color the other robots are it just doesn't matter because I can bounce off the red robot or the blue robot to get where I'm going I don't care and so I was able to implement what I call a board state equivalence class that that treated these two board states as equivalent and that was a slight improvement a few less states to consider but also in order to implement that I came up with a more concise representation of a board state equivalence that was faster to compare so I actually ended up doing things faster at the same time and I was able to process more states per second so sometimes the optimizations you do are going to have both reduce the amount of work you have to do and speed things up the board state equivalence class I implemented I implemented as a set of position representations and I realized that the second person was taking long a long time and so I switched over to a sorted array instead which is actually faster to compare another slight speed up the next thing I found was I was creating a lot of unnecessary objects every time I tried to move a robot whether it moved or not I created a new board state that I would then have to compare and so I stopped creating new states when the robot wasn't actually going to move if I'm up against a wall and I try to move I'm not going anywhere why create a new state for that that was a huge win so definitely creating less objects is another good optimization technique and finally I found some places where I could compare objects by identity rather than a DP quality and that was another speed up now the solver is actually pretty good but it's not good enough yet there's still some places where it's slow but at some point I had to stop working on the solver and actually put together some slides for this talk so that I actually had something to talk about so this is still a work in progress but it's pretty good so here's where I ended up with the optimizations I did this is the total solving time for the example game I was running and you can see it sped up quite a bit those first couple of algorithms were pretty naive and pretty slow and with these optimizations I just talked about it sped up quite a bit so let me show you a quick demo of the solver in action it's very text-based and I'm running an example that I know how fast it runs I stole a trick from Minitest thank you Ryan where I print out the random number seed that was used so I can feed it back in and run the exact same game over and over again that was great for testing this so it's a great trick so let me just run the solver this is going to be playing an entire 17 move game by itself I can guarantee you I cannot play the game this fast so blue square is a little bit of a slower one I think it's actually a nine move solution there we go about 30 seconds to play an entire game of ricochet robots so like I said there's still some board states where it's not quite that fast but it's pretty good so how else might I improve this thing well obviously I could try some better algorithms there's a very famous algorithm called a star it's kind of like the breadth first search I just show you but it's actually more of a what's called a best first search and what it does is when you have a list of states to consider instead of just choosing the one that has the shortest distance traveled so far it adds in a factor which is an estimate of how much further there is to go and as long as that estimate is never an overestimate as long as I always estimate low then a star actually comes up with an optimal solution so the way that would might work we'd have to come up with some some way of coming up with an estimate of how far there is to go and I got this idea from Michael Fogelman's talk as well you can kind of you can compute if the robots could stop anywhere where they wanted to how many moves would it take him to get to the goal so obviously if you already have the goal that's a zero anything in a straight line is a one anything in a straight line from there is a two and then threes and fours and in this board five so from those cells mark five even if the robots could stop anywhere they want it would take five moves to get into the goal cell from there just because of the structure of the board and where the walls are so that's actually a pretty good estimation function for how many moves there are to go and so the way the algorithm would work is let's say I've got one board state where I've already made four moves but I estimate one more to get into the goal and I've got another state where I've only made two moves but I estimate five more to get to the goal well four plus one is less than what I say two plus five so I would actually consider that state where I've already made four moves first I would try that one first and this actually should speed things up a little bit I haven't tried this one yet it's probably my next one to try but that's a star in a nutshell maybe collision detection algorithms for figuring out when robots are going to run into each other or into walls maybe that would be an optimization I haven't tried that yet that's an idea another thought is to take a different approach and maybe work backwards so you look at the goal cell and then figure out where's all the possible places I could stop before I get into the goal and then work back from there maybe that would be a better algorithm I don't know I kind of use this one when I play a fair bit I kind of work backwards a little bit whether that works for a computer or not I'm not sure I could also try some better heuristics for example most solutions only involve two maybe three robots so what if we always move the most recently moves robot first and try that maybe things will be a little bit faster or maybe some combination of moving the active robot and the most recently used robot maybe we could be smarter about which directions we explore first like maybe from this state moving left is more is is likely to be better than moving up or down and so we we choose more intelligently that way what my profiler is telling me right now is that the slowest part of my algorithm is figuring out whether I'm going to run into another robot so I've got the pre-computed stopping points with the walls but that doesn't factor in where the robots are at that time because they move a lot more frequently so the pre-computation didn't seem like it would pay off as well but maybe I could pre-compute per robot stopping positions so that's an option could always try to use less objects and more primitive types you know sometimes creating a lot of objects is really slow and if you could use primitives things would go faster then there's always the ever-popular throw more hardware at it parallelize things process states in parallel and see if we can find an algorithm faster so those are just some of the ideas of where I'm going to go with this next maybe you got some ideas for how this could be optimized love to hear about them I want to thank a few people um Trevor Yarish who's one of the founders at zeo and also one of our designers did all the design work on these slides and I think he did a beautiful job the animations where he did those um so I'm very thankful for to Trevor for the time he put in the other guys at zeo paired with me on the solver a little bit gave me ideas and feedback so thank you to them I mentioned Michael Fogelman a couple times his talk was really interesting so I got some neat ideas from there and Trevor Lailesh Manaz the guy who introduced me to this game at RubyDcamp a couple years ago and so I thank him very much because I love playing the game it's a lot of fun code for my solvers up on github I'm going to keep working on it but if you want to play with it feel free to fork it and play with it and I've got a few minutes for some questions if anybody has questions all right thank you very much


Er hwyl yw hefyd yn fawr i'r cymdeithas, wrth gwrs, rwy'n wedi gynnig yn gystafol o'r cyfrithur arnaeth yn y ddiwrnod rhywbeth, ond mae'r cyfrithwyr rym ni wedi gynnig hefyd. Rym ni mewn llawer o'r Cyfrithwyr rym ni yn y KEG, mae'r Cyfrithwyr yn yn gilydd yn y gyfrithwyr yma, mae'n wrth gwrs mae'r cyfrithwyr ar y cyfrithwyr. Mae'n o英ynedr ar y Cyfrithwyr. I remember doing an exchange visit with some Japanese visitors when I had no Japanese, he had no English, so we were doing things through translators. My translator started to laugh when I was being introduced to my Japanese friend. I said, what are you laughing at? He said, he's just described you as an eternal typist. So I know my role in life. I'm noted for taking on hopeless causes, the football association job being one for all the Man United supporters in the room. I'm also an Arsenal fan who was in the away end at Old Trafford two weeks ago for the 82 humiliation. And I think being able to take on things that make you unpopular is a necessary part of the job that I now have. We, like every major government around the world, have huge, huge problems to deal with at home. We have financial crises, we have social crises, we have economic and enterprise crises, and it's a huge, huge job that the British government and indeed every other government around the world has to try and turn the situation around. We are trying to play an important part in that role through my team. I work simultaneously to the Prime Minister and Francis Mord, for those of you that know Francis. He's the Minister for the Cabinet Office in the UK government, but also through to the Chancellor of the Exchequer, George Osborne, and to Danny Alexander, who's the Chief Secretary to the Treasury. My job face is both sides of the centre of government, if you like, to the Prime Minister and the Chancellor. I would say that's a necessary part for success. You need to have your equivalent of Prime Ministers and Finance Ministry leads on board with everything you do, otherwise the system will divide and conquer. I think it's also important that you have political leadership in the sense that you need at least one politician who is passionate about the agenda and is prepared to stand shoulder to shoulder with you and all the other people that you work with to push through what are never to be difficult decisions. I have that with Francis Mord, who's a very interesting man, another time I could talk more about him, but he glorifies in doing what he regards as the unpopular, unsexy bits of politics, the things that save real money and change things behind the scenes, and he leaves the front facing stuff to his colleagues. I think that's a really important focal point. I don't believe we will be able to do the job that we've been asked to do without his leadership. We've got a lot going for us in that way from political leadership. One thing that I would urge people around Europe not to do is to enter into a climate of criticising and bashing the public servants that work in the organisations, whether they be central government or wider public sector bodies. In my experience virtually every public employee goes to work to do a fantastically important job that they care about, they work hard for, and they put up with a lot of staff because of what they care about. If you go over the top in terms of criticising them, as the British press does in my opinion with our public sector, it can really damage the climate in which you're trying to introduce change. I always make it a point in any public presentation to make the point I've just made, but mostly to thank and compliment everybody who's working in the public services around the world because I know they all do a great job. If there are systems and problems that they work within, it's very rarely due to them as individuals and I always make that point. If we're operating in a world of economic and public pressures with political support and hopefully without bashing the public servants in the press, what are we actually trying to do? I suppose it really boils down to three things. The nature of my organisation's title is efficiency and reform. The first word is the efficiency word. I'll come back to what I mean by that in a minute. The second is the reform word, making change sustainable and systemic. The third thing I always say is that credibility begins at home. If you don't actually make your own backyard work in a reformed way and in an efficient way, nobody will take you seriously. I make that point because actually when you start on one of these roles, you hoover up bits of government from wherever they might be and put them into one place. You actually have to put quite a lot of effort into bringing that team together, changing it, making it more effective and recruiting new leadership always and you don't normally have the luxury of very long to do that in. So, when I arrived a year ago, I think I had seven different bits of government brought together under one machinery of government move and I make no apology for it. None of the people that were directly reporting to me on day one are still there. I've changed the team completely and I have brought them together in a different way and we operate in a much more in one building in a flexible resourcing mode and it has changed the way that we operate and that is now being talked about by others and I think that's an important lesson for people who are trying to lead one of these exercises. If you're not good at yourselves, nobody will take you seriously. So, having put that out of the way, let me concentrate the rest on what we mean by efficiency, what we mean by reform. Now, I know there is a theological debate about what we mean by efficiency. To my minister, it means about spending less money each year. It's quite simple. He doesn't get into the sort of new security and the nuances of this. He says, I want to see folding money in my hand, you know, being returned from the system. We set a public spending review last October in the British government for four years that basically took the previous government's expenditure plans, which saw public expenditure of about £700 billion sterling at the start and the original plan was to increase it to about £780 billion and the British government basically said we are not going to increase that £700 billion figure. It's going to be a flat cash settlement for four years. So, everybody talks about it as though we are cutting the public sector by £80 billion. In fact, we're not growing it by £80 billion, we're keeping it constant. And I think that's the first important message. So, when we are then trying to say, well, how do we find efficiencies that add up to as much of that £80 billion as we can, we have to be realistic and say we're not going to find it all from just trying a bit harder and doing things a bit differently. There are going to be some tough choices and decisions to be made. One area that's inevitable is going to be welfare. I think in almost every government around the world welfare spending is a huge part. You can't save big chunks of money without tackling the welfare budgets. In the UK's case, they've got a number of reforms to welfare coming through which most people talk about as being linked to a programme called Universal Credit. So, that is a huge part of saving the £80 billion. But the rest has to come from real efficiencies and doing things differently. The way I like to think of it is, we probably want to get about £20 billion of that £80 billion out of central government. We want to probably get about £20 billion out of wider public sector and we probably want to get another £10 billion out of fraud, error and debt in the payment system and those are the sort of three big blocks of money we're going after. We've started on central government in the first year. We've taken the view that central government is key and in the first 10 months we've now had an audited figure published of having saved just shy of £4 billion sterling. I'll talk a little bit about where that comes from in a second, but it's £4 billion that hasn't come from closing hospitals and reducing teachers and schools and all those sorts of things. It's been from stuff that's largely invisible to the general public and it's shown the art of the possible. We're now setting on a journey to try and increase that to a £20 billion per annum figure by the end of the spending review. In the wider public sector, for which for us is places like health education, the police and local government, they've all got their own financial settlements but they in turn are having to find efficiency savings. They're all doing it in slightly different ways and already they are quite politically controversial. Our recent troubles in August from the two or three days of rioting re-invoked the debate about should we be cutting the police numbers at this time and all of that. It's very politically sensitive territory in the wider public sector. Fraud error and debt is something that just about everybody unifies around. It's just it's really hard to find it and to deal with it. But in every trade union discussion I have, in every political discussion or journalistic discussion, they go, if only you collected the tax that was due to you, if only you went after the debts that were paid with penalty fines and courts or whatever it is, that would actually take a lot of the pressure out of the system and so those are important areas. But if I stick just now to the £20 billion and talk about what are the sorts of things we're doing, obviously you have to look where does the money get spent, the money largely get spent in pay and procurement, we know that. We have to deal with those two issues but there are some totemic issues that you have to get right because people won't take you seriously and the two that we've picked upon are spend on consultancy and spend on marketing. We have savaged the budgets on both. In fact the reduction one year on another of consultancy spend is 70%, 70%. And on marketing it was just about 80%. So we've basically just stopped doing TV and radio advertising and stopped employing consultants to walk around the Whitehall and I speakers one so I can say these things. Because if you don't do that, nobody takes you seriously on the rest. It's necessary to do and we've done it and people have stopped talking about those issues now and now they're talking about the real substantial issues which are how do you change beyond that. If you're going to change the payroll bill of somewhere like Whitehall, you have to do it through reductions in the numbers of people working. We have about half a million civil servants in Britain out of six million public servants. We're already down to about 470,000 people and that's a year on and that number is falling all the time. There'll be a new figure out shortly. Don't know exactly how far that's going to go but some commentators have talked about 80,000, 90,000 off the peak total. It's already the lowest it's ever been since World War II but it's got a long way to go. If we're going to reduce the number of people in the system, you have to treat them fairly and well. We had some difficult issues to deal with about redundancies in early retirement programmes where the accrued rights were so expensive and people would argue favourable to the employee that nobody ever invoked them. So the government came in and put an act of parliament on the table to completely savage those rights and then set about negotiating a position with the union somewhere in the middle which it has now done and actually put those offers to larger numbers of civil servants who've accepted the packages and it's actually happening relatively painlessly and for many of the people that I speak to who've taken those packages, they are finding it personally liberating. If they're towards the older end of the spectrum, they're getting their pensions early and finding they can do new things with the younger people who've gone, they're finding they've got a lot of really good experience to take into the workplace with them. So it isn't the disaster scenario that people painted it in advance and most of the people who've left have left in good heart and good odor and it's working well. It also means you then have to concentrate on the people that are left who see a kind of tsunami slice of cuts being applied to them for every week, every month, every year. So what we've tried to do is to say let's get ahead as quickly as possible and make all the reductions in staff that we need to do in civil service quickly in the first 12 to 18 months so that for the rest of the spending cycle and the rest of the parliament, those staff know that they're part of the future and not worrying about their own jobs. It's analogous to the sort of retail organisation taking the jobs out of head office before it starts worrying about what it does in the stores. So a big part of payroll reduction is about getting fewer people. We've had pay freezes, we've had reductions in the compensation scheme but the one that's most controversial in the UK at the moment is the public sector pensions issue where there has been two major changes. To the long term nature of the pension scheme turning it from a peak final salary scheme into a career average scheme and the other is to ask employees to contribute more to their pensions along the way. Interestingly it's the second of those that's more controversial because it's immediate, it's understandable and people see that from next April their pay packet is going to reduce by x% as they increase the pensions contributions they have to make. The ethereal what their pension might be issue is a little bit harder for them to worry about but in either case the trade union movement have made a loss of capital with the public sector workers on pensions. We've already had one round of strikes just before the summer break. I'm fully predicting we'll get many more this autumn particularly as the weather turns. I think we're expecting big days of industrial action in November probably coordinated across all public sector workforces so it's probably the most controversial thing we're doing of all of the reforms around downsizing the people. On the procurement side I think what we've done is straightforward. We've taken a view that if government is buying things that you might classify as commodities, people quote a paperclips but I prefer to talk about things like energy and utility bills. These are things that we're aggregating at the centre of government doing once on behalf of all of the Whitehall system and we have a program now that is agreed with all of the Whitehall departments to increasingly move their commodity spending across 10 commodities to the central buying arm which in turn we're doing some very innovative and good deals with the supply market in order to get the savings. At the other end of the spectrum we're taking the bigger and more complex end of procurements and taking a different approach to how we negotiate with our suppliers. Many of our suppliers work for multiple government departments and they're brilliant at dividing and conquering and doing different things in different departments. We've taken a holistic view of how we deal with a company and pick British Telecom because they're the one company that everybody uses. We now have a single person facing BT on behalf of the British government and dealing with all of the issues that all of the Whitehall machine is having with those suppliers and we're finding that we're getting much better and stronger leverage deals with those suppliers. Interestingly the people that are doing that are not sitting in the centre in my team, they're actually the departmental commercial directors who we've said if you're the commercial director of the home office you're a strong commercial director in your own right we would like you to operate on behalf of the whole of government as well as on behalf of the home office. We've anointed them with crown level representation and they can deal with certain companies as the whole of government as well as for their department which is giving them personal job types of action. It's also getting them into the whole of government agenda and breaking down the traditional barony resistance to doing things in a coordinated way. So those are the big changes that we made there. The change to suppliers, we called them all in the top 20 suppliers, they had an annual budget of about 8 billion between them. We said we want 10% off the price now for no different service and no different contractual terms and we got it, first year 800 million savings just by a coordinated approach to negotiating with suppliers. We begin to bear fruit very quickly and you can get some real savings. Having sort of talked about the savings side and there's more we could go into, what are the reform areas? Because I know that if I took all those sort of approaches and just let them sort of go lax for a minute, behaviour would reverse and we'd be back to the same old stuff as we had when we went in. So what are we trying to do to change the way the system works at large? Well one thing we're doing is we're constituting new style boards of Whitehall departments with a very powerful set of non-executive directors going on from the private sector. This was coordinated by Lord Brown, John Brown, who used to, as you will remember, run BP and John is both the lead non-exec director of the Cabinet Office, my bit of government, but he's also the lead non-executive director across the whole of Whitehall and he has created a team of four non-exec directors to every Whitehall department drawn from the biggest bits of British business, British public service and British voluntary service. Those boards are absolutely crucial to getting systemic change in because otherwise I think the Whitehall machine will fragment when we relax on it. Secondly we're looking at civil service reform. This is an agenda that is a long term one and I think one of the things I find about the British civil service is it is already a very highly capable professional and experienced civil service. I was telling somebody this morning that one of the people who I met in the early 90s was a lady by the name of Ursula Brennan who was a bright young policy sort of star in the traditional Whitehall sense but took the view 20 years ago that her career would be unfulfilled if all she did was policy in the centre. She took herself off to go and do large IT projects and large operational management projects in the north of England as it happened and that's where I first met her. Fast forward 20 years she's now one of our permanent secretaries. She's running the MOD so the idea of a woman running the MOD is something that lots of people find interesting. I find that actually massively reassuring them for the first time I'm actually confident that the MOD now has highly capable professional leadership at the top because her background has prepared her to do such a job by taking herself off into policy, operational and corporate roles in the public sector. So we have some good examples of that. We're also fortunate that we have a diversity success in our British civil service. Half of the permanent secretaries are women and I think now a third of the next 40% of the whole of the senior civil service is now women as well. So we're building a pipeline of really strong female leadership in other diversity ways as well. So we've got a lot going for us already but there is a lot more that we need. I don't buy the argument that you just parachute a whole load of people in from the private sector and just watch it all come right. Many people from the private sector who've gone into the public sector struggle with the way it operates, with the complexity of it all and the fact that the thing doesn't operate as it always does say in a very command and control private sector. So it's a simplistic answer to do that but it is an important part to get a breadth of skills in and what we have found successful in the past is bringing people in perhaps on a sideways move from their job in the private sector letting them become familiar with the environment in the public sector and then they're ready to take on the next stage of leadership. I know I could not do any of the jobs I've done in the last two or three cycles if I hadn't done that myself by coming across in a sideways position from the private sector. I think it's a good model for how people, it takes time but you get better results from it so I think that's important and I'm learning from that. Going forward on civil service reform I think we're looking quite radically at lots of different ideas. One of which is looking at whether or not we can significantly co-locate chunks of the central Whitehall machine so that departments are actually sharing the same buildings that tends to break down barriers between civil servants. We have moved my bit of the cabinet office into the building that is known as the Treasury building for precisely that purpose and that already is enabling the centre of government to join forces in a way that perhaps it hadn't before. We're also looking at new IT tools to try to give people flexibility in working across civil service boundaries and you're probably like me familiar with the situation where you move department and suddenly a technology stops working and you come from usable technology in your private life to government technology which is riddled with security overlays so you can't actually achieve anything with it. It becomes a very frustrating way of collaborating with colleagues. We're trying to enable ways in which we can break the boundaries across departments down in that way. We're also looking at putting other areas out into the wider space so looking at whether more policy advice should be more contestable rather than solely the province of the public sector civil servant. Actually getting the civil service to manage a more plural set of policy advice from think tanks and the like. So lots of ideas going on but I wouldn't pretend we've set the direction out yet on that and probably the next three months we will and then it'll be easier to talk to you more firmly about what that programme is. So those are some of the sort of reforms we're doing at home. I think in the wider world probably the most interesting reform we're doing is for looking at whether the delivery of public services which has traditionally been either a state run body. Or a holy private sector body. Whether there is some hybrid model that might enable us to get the best of both worlds. And the model that the government has picked on is the so-called mutuals model where we're looking to take a piece of the public sector today and say if we put that in as a private entity and gave it a three way ownership structure part owned by the government. Part owned by some private sector partner which might be a venture capitalist or it might be somebody with a natural specific asset to bring to bear. And crucially part owned by the staff then do you create an entity that has the best of both public and private. It's what our government believes in very strongly. They look to well-known models in Britain to sort of use for examples of which the most famous is the John Lewis retail chain. And everybody knows that it's their favourite shop and it's growing and it's very successful and all that so therefore they think it must be a good thing. And so we're trying it out and we have some quite small scale examples in places like small bits of health and so on. But probably the biggest entity we're trying it with is the civil service pensions administration function which is currently done by 500 civil servants on behalf of the one and a half million members of current and previous civil servants for their own individual pensions. And we're looking at creating an entity which is roughly a third owned by the three entities playing different games on their ownership model. But when no one group has the dominant ownership model and where you give the entity an initial contract to get it going but then you treat it as just like any other supplier that you might have. So interesting new model. If it's successful it could be as radical as privatisation was in the 80s. If it's unsuccessful I won't ever mention it in any of my speeches in the future and pretend it never happened but it is something quite new and innovative. Then finally in reform. Reform is then the front line of the public services. This is not primarily where I would argue that me and my team are leading but we are trying to enable it. So for example there are big reforms going on to try to provide more public services digitally so that you don't have to, a bit like the airline industry has reimbursed itself around the web. A lot of public service moves to do the same. My team owns the government digital service which is both doing some of that and enabling some of that. We've just hired one of the Britain's best digital entrepreneurs to come and lead that which is fantastic. We're also helping in areas like the education reforms where the free schools, the particular reform that this government has chosen, freeing schools up from local authority and other control but still being publicly funded. Obviously that's primarily a role for the education department but we're supporting it in ways like finding, when new free schools want to come up, we're finding bits of the public sector property estate that they can inhabit which takes a lot of the lead time out of setting these schools up. We've just had an example of that happening in the city of Bristol so those sorts of areas we're supporting. We're also supporting the reforms like the universal credit program in welfare because as we all know these things are quite easy, they're quite hard to do at the policy level but by comparison they're a lot easier than to implement because the complexity of the technology and the change management of the organisations that deliver welfare are huge and that's an area where we are playing quite a critical role in helping the Department of Work and Pensions succeed. I could go on into the other reform areas, the justice area where there's a much greater use proposed of the voluntary sector in the rehabilitation of offenders. Again my team is responsible for the policies and the arrangements with big chunks of the voluntary sector and the so-called big society agenda and we've introduced new financing models like social impact bonds to enable to encourage and attract new finance to areas of traditional social and public service. So there's a huge amount going on on quite a broad waterfront. I come back to what I said at the beginning however, there's really three key messages. The efficiency measure about saving money and doing it and then establishing an environment in which it's sustainable is crucial. The reform agenda about ensuring that people feel that they're getting a better service for what they would regard as less money and also making sure that you change yourself so that you are credible with the right leadership and the right operating model at home. I leave just with the two sort of slogans that I try and push around the place. For many years government's been talking about more for less. The less now is so dramatic in our administrative budgets we're reducing by 30%. You cannot sit there credibly in front of staff and so we are reducing budgets by 30% and we want you to do even more than you did before. We change that to better for less. Now I know it's a word change but the important thing is you start to open up what does better mean. Better can often mean not doing it at all, vacating that space and allowing other people to fill that space. Better can mean a good enough service not a gold plated service etc. Sometimes better means radically reinventing it and just doing it in a fundamentally different way so we're putting the focus on the better rather than the more and that's the agenda. The final thing people say to me is well I understand all this but how can we save money when we have to invest up front to get the savings, the so called spend to save business case. My colleagues in the British Treasury would say they've seen an awful lot of spending over the years and not much savings so that sort of case gets very short drift. So we've kind of inverted it and said do what you do at home you save to spend.  So if your budget is reducing 10% year on year which most of them are, reduce it by 12% year on year and then reinvest the remaining two. That's what I've done in my own backyard and we've gone way below our cost curve initially to come back up again with new investments and new people and new technology and so on. And still live within our affordable budget line. So those are the two mantras we're preaching. It's better for us, it's safe to spend and if we do all of that then hopefully we will come through this dreadful economic cycle with a more sustainable set of public finances but importantly a better set of public services to go with it. So that's my message. I hope that's reasonably clear and across the board. There will be probably loads of detailed questions, some of which there will be massive similarities between particularly Britain and Ireland or other countries in Europe and some of them there will be very many differences. So can I throw it open now to questions and answers. Thank you very much.


So my son Prashant, you have won a very great award in the country, that is an E-4M company has instituted an award for those who influence the personal of the company to do the work. It's indeed a very great award and I think very few have achieved that award and I am very glad that my son Prashant Kumar has achieved this, I am very happy about it.