 Okay, I know I have like the afternoon slot, but it's like 250, and we got like two more talks after this, and I have 88 slides, so no pressure, no intimidation, it's gonna be fine. Hi everyone, let's do that again, okay. My name is Vaidehi, you can find me most places on the internet as at Vaidehi Joshi, just to move you, and I come to you from sunny Portland, Oregon where I work at a company called Tilda. I think today is the last day that I can say sunny Portland, Oregon, because it's supposed to start raining tomorrow, and then it's gonna rain for six months, but rainy Portland, Oregon just doesn't have the same ring to it, so sunny Portland, Oregon, and at Tilda I work on a product called Skylight, which is your favorite Rails profiler, so if you work on a Rails app and you're looking for a profiling service, you can come talk to me afterwards, but when I'm not working on Skylight, I like to spend my free time writing. My background is not in computer science or tech, my background is in writing, and I try to fuse the two together by doing some sort of yearly project every year, so I do a thing where I write once a week every year, and this is year three, and this year I decided that I was gonna teach myself computer science, which is really big, and I didn't know that in January, but the project is called BaseCS, and it covers the basics of computer science. I write every Monday, and that means I think a lot about abstraction, and I think a lot about theory and applying it to practice. Again, my background is not in CS, so I'm kind of teaching myself this stuff as I go, but the interesting thing is if you come across a concept enough times, you start to see it everywhere, and when Jeff asked me to talk about trust, I was like, aha, I have to figure out how to connect this to computer science, and I think I found a way, and it turns out that the story of trust, as we know it in computer science and software and in our entire tech industry, actually is a pretty old story, and to tell the story, we have to go back in time to the year 1735, so I mean really back in time, and we need to go back to a town that was in medieval Prussia. This town is called Konigsberg, and it's not called Konigsberg anymore, so you will have a hard time finding it on a map, but it used to be in medieval Prussia, and it actually used to be four different settlements. The way that this town was structured, there was a river that went through it. It was called the Pragal River, and there were four settlements, but as time went on, those four settlements got turned into a single city. Now, it was really hard for people in the city to go from one side of the river to the other, so they built some bridges. They actually built seven bridges. I don't know why seven, but it ended up changing the course of history forever. So, the town of Konigsberg eventually turned into the city of Konigsberg, and the residents of the city would go on these long walks in the evening, and they would cross these bridges, because I guess that's what you did for fun in 1735, and they came up with this really interesting game. The game was that you had to try to cross each of these seven bridges once and only once, and the reason that this game was so interesting was because nobody in the town could seem to do it, and word spread to like a neighboring town, another neighboring town, and other people started hearing about it, and there was a mathematician of two towns away named Carl Gottlieb Ehler, and he heard about this, and he was like, oh, this is interesting, very interesting bridge problem, and he started thinking about it, and he got kind of obsessed with it, and he got so obsessed with it because he couldn't solve it, and he was a mathematician, so it drove him mad, not literally, he just started obsessing over it, and so then he was like, okay, who else can I rope into this? And he had a friend, Carl's friend's name was Leonard, you might know him as Leonard Euler, and I'm just going to call him Carl and Leonard, because Ehler and Euler is not going to work for the next 30 minutes, so Carl sends a letter to Leonard, and he's like, hey man, this is a really interesting problem, like, do you think you could solve it? Like, I think you should spend some time, you're smart, I guess, I don't know what the letter said, but something along those lines, and Euler was like, dude, this is like, I don't really think it's worth my time, it's not really a math problem, like, it's just a bridge, like a bridge problem, and let the people of Konigsberg figure it out. However, Euler started thinking about it, and he realized as he thought about it, he couldn't come up with any easy solution, and being the mathematician that he was, he also started obsessing over it. And he actually said, this question is so banal, but seemed to me worthy of attention in that neither geometry nor algebra nor even the art of counting was sufficient to solve it. So he writes back to his friend and he's like, I know I said no, but this is really interesting, why can't I figure this out? So, Leonard Euler took his obsession and put it on paper, and this is actually one of his drawings, and he sketched out Konigsberg and the land masses and the bridges, and he did something really interesting. He kind of abstracted the problem of the bridges out into something that was more mathematical. This is my drawing, it is not as pretty as Leonard's, but you know, it's colored, so at least I got that. So what he did was, he took the land masses and he took the bridges and realized that the path and the route that you took from one land mass through a bridge didn't actually matter. So he reconfigured it, and in reconfiguring it, he basically invented a new branch of mathematics. Today, we know it as graph theory, and some of you might know what the things on this image are called, which we'll get into in a second. But in order to solve Euler's problem, there are a couple important terms that we need to know. So I'm going to present to you for the first time ever in my conference history. Vaidehi's super fast and exceedingly friendly guide to graph theory. It's not actually been trademarked yet, I should probably help on that. No PhD required. So some important things to know about graph theory. These days, when we talk about graph theory, we're generally talking about two parts of a graph. We talk about nodes, which are two points, and sometimes nodes are called vertices, and edges, which are what connect nodes. There are two different types of edges that we'll generally run into. They can get more complex, but for today, this should be enough. There are directed edges and undirected edges. So an undirected edge basically means that you can go from one node to another. So if you think about it in Euler's terms, if you can cross from one bridge from one end of the bridge to the other and back the other direction, that's kind of like an undirected edge. A directed edge has a sense of flow. You have an origin and a destination, and you can only go from one node to the other. The way that we represent graphs mathematically is just as ordered pairs. Graphs represent networks, but they're really nothing more than ordered pairs when you talk about them mathematically. So most of us are familiar with ordered pairs as what we learned in probably like high school algebra, X and Y. Same thing, just looks a little bit different. In a graph, we're dealing with sets of ordered pairs. So you have vertices and edges. So the formal mathematical definition for a graph is just g equals v comma e. So when we talk about the definition of a graph, what we're talking about is the set of vertices that make it and the set of edges. So if we have a simple graph like this, there are three nodes, three edges. How can we describe it in mathematical terms? Well, we have a set of vertices, ABC, and we have a set of edges. You'll notice that this graph is undirected, which means there's no flow. You can go either direction from one node to another. So the edges are unordered pairs. By the same token, if the graph was directed, the edges would have some directional flow. You can only go from node C to node A. So when you represent it, C needs to come first when you're describing that edge. Another important thing with graphs is how to get from one node to another. And usually when we talk about this, we're talking about the degree of a node. It's basically like you going over to a node and be like, hey, who are your neighbors? A fancier definition, if you want to impress people, is you can tell them that it's the vertices that are adjacent to one another. It's a fancier definition, but I like my friendly one. And in this example, we have a graph with five edges, or five nodes, and all of them have different degrees. So for example, node A is connected to four other nodes, has a degree of four. E is only connected to one other node, has a degree of one, and D is connected to two other nodes, it has a degree of two. Now what Euler was really concerned about, and what most graph problems are concerned with, are finding paths. And a path is just finding a way to get from an origin to a destination. It can be very different depending on what type of graph you're dealing with, but that's really all it is. But what Euler really wanted was, he wanted a simple path, which is getting from an origin to a destination without repeating any vertices. He wanted to cross all the bridges, and by proxy touch all of the land masses without ever crossing a bridge twice. So a simple path in this situation would mean hitting every single vertex and by proxy every single edge, but never repeating yourself. So, back to Euler's problem. How did he solve this? He did something very clever. He solved it by proving that it couldn't be done. He disproved it by proving what type of path can be taken in order to create a simple path and what the rules are for that. And this is what we know today as an Eulerian path. So the first rule is pretty simple, maybe a little bit obvious. All of the vertices in order to find an Eulerian path, they have to have a non-zero degree node in order to be connected. Which basically means if you have a land mass over here and a land mass over here and you don't have anything connecting them, you can't find a path. Obvious but important. The second rule is that two vertices in any graph must have an odd degree because they can act as either the starting point and the ending point of your path. Or, alternatively, all of the vertices in the graph must be of an even degree. And if you think about it, if all of them are even, then you can start from one place and end back where you started. Euler did what probably many mathematicians envy him for. He proved something was impossible by proving what was possible. And in the process, he created something that he called the geometry of position that we know today as graph theory. So Euler's problem was cool. It was like back in 1735, what happened to it? He created this whole branch of mathematics. Did anything ever come from it? Well, yes. A lot of things came from it. And the best examples, I think, come from computer science. So graph theory is all over computer science. And over the past hundred years in particular, you can start to see some really interesting examples of it. And some of you might have already encountered them. One of the really fun examples of graph theory is something called the night's tour. And this is actually a problem that was in a different form that was researched by Indian mathematicians back in the ninth century. But the way that most of us know about it today is imagine you have a chessboard and you have only a single night. And the objective of this puzzle is to try to move the night so that you touch every single square in the board without repeating yourself. This is also a really good one. I've watched a lot of MIT videos recently, like learning about graphs. And they love to talk about Rubik's cubes. They're always like, let's solve a Rubik's cube with this thing. So anyways, mathematicians love it. Computer scientists love it. They're fun. I still, despite the fact I've watched so many videos, I still can't solve this. So I don't know what that means. So a Rubik's cube is something that you can actually turn into a graph representation. So if you think about it, every single time you have a Rubik's cube and you change something about it, you change its state. If you represent the state of a Rubik's cube as a node in a graph, you can see all of the possible states that you can change something to. There's a name for this. It's called the Cayley graphs. It's really interesting. You should Google it. Basically, it's creating a graph representation of the different states of a Rubik's cube. I think ten years ago or so, there were some computer scientists who basically mapped out the entire, all the permutations of a 2x2 Rubik's cube. They did that so they could find the optimum path. That is to say the shortest number of steps you have to take in order to solve a 2x2 Rubik's cube. Nobody has done a 9x9 one because it is so big. So that's like one of the unsolved problems of mathematics and computer science that is still unsolved today. So maybe you could solve it. I can't solve a Rubik's cube, so I don't think that's what I'm going to be working on. Another one that all of us are probably familiar with is Google's page rank algorithm. This was the algorithm that put Google on the map and made it what it is today. But really, it's just a graph. What Google does and what their page rank algorithm does is look at how many links external links link to a web page and the quality of those links, which is to say if a certain website is linked to many times, the importance of that website goes up. So when you search for Rocky Mountain Ruby, Rocky Mountain Ruby's website goes to the top because it's weighted the most. It has the most importance. And this is a type of graph called a weighted graph, which is also pretty common in computer science, but it's really just graphs with another added piece of data. If you start googling and if you start reading about this stuff, you'll find that graph theory is all over the web. But it also just literally is the web. What I mean by that is every single time you navigate to a URL and go to a website, you are basically hopping from one node to another. And those hyperlinks are the edges that connect those nodes. So Euler's problem fed into computer science in its own way. But it turns out it's present in bioinformatics too. Bioinformatics is the field that's involved in taking data and interpreting and using it for the sake of biology. And probably the most influential example of this was in sequencing the human genome. So the way that the researchers who wrote about this in 2001 when they finally finished sequencing after 20 years, the way that they approached this problem was taking elements of graph theory. And the problem with sequencing the human genome is that you get all of this DNA jumbled up together and you need to pull it apart into its separate individual parts. The only problem is because it's so jumbled up, you often have repeated sections. So you have to not repeat yourself and find the unique parts of the DNA as you sequence it back together. So they use something called the De Bruijn graph which was named after a Dutch philosopher who also borrowed his theory from Euler and they sequenced the human genome by reading segments of it, turning it into a graph where they looked for overlaps, pulling out the overlaps, and then reading the entire sequence of DNA all together. I guess the human genome has a lot of DNA in it, which is probably why it took them 20 years and a lot of people tried and it was only when they started using graph theory that they could actually get to a solution that worked. So genome sequencing also learned from Euler. But another interesting thing happened in 2001 too. A Harvard sociologist and professor named Nicholas Christakis got really obsessed with the idea of trying to understand how human beings are influenced by their friends and family. Basically, he wanted to study networks. So he said that we're all embedded in massive social networks that have massive influences on our well-being. And he proved the connections and the power of interconnected graphs through his research. One of the things that he studied was someone's propensity to be obese. So he studied obesity clusters and he found that someone who has connection, who also has a certain disease or a genetic predisposition, was more likely to experience it themselves. On the flip side, he did something similar with happiness. He found that when he graphed out the happiness of people that he surveyed, people who were on the further end of the cluster were generally less connected to happier individuals. And so they ended up being more unhappy. He also studied the spread of influenza. And he saw that people who were in the center of the graph were more likely to either catch the disease or spread it because they were far more connected than people on the external parts of the graph. He realized that if humans are nodes, then we're connected by edges and our connections can influence each other in positive or negative ways, depending on the context. So sociology also borrowed a tool from computer science and from Euler. But it turns out pop culture has too. Specifically from this guy. Back in 1994, three college kids were like, it was like there was like snowstorm and they didn't have anything to do. And it was 1994. So they watched Footloose. And they started this inside joke. They were like, how many actors or actresses do you think can connect back to Kevin Bacon? And what started out as an inside joke ended up like getting them on The Daily Show with John Stewart. And they actually like started turning this into an interesting game and thought experiment. It turns out Kevin get bacon gave a Ted talk about this. And he was like, I did not like being the butt of someone's joke. He was not a fan. But the six degrees of Kevin Bacon has turned into a pop culture phenomenon, but it's just a graph. And what's interesting about this is that after Kevin Bacon got like put on the map again after Footloose or whatever. And like he started getting interviews and he got excited about it. He eventually came around to it and he has a nonprofit organization called six degrees dot org. So I guess he's down with graph theory also. So apparently Kevin Bacon is also connected to computer science. Guess what? It's not just Kevin Bacon. All of us have our own six degrees of separation, too. When you add me to your professional network, you're just adding an edge in an undirected graph. And when I follow you on Twitter, I'm adding a directed edge to a directed graph. If you follow me back, then it'll be mutual. But this is to say we're all connected and we all have nodes in our metaphorical virtual graphs that connect us to certain people and by proxy certain ideas. And I think where this starts to get really powerful is when you start thinking about interconnectedness and how it has applied to our economy, particularly the sharing economy. So the idea with the sharing economy is that it's enabled people to either connect with people who are in their networks or create connections based on a mutual need. So sometimes that need might be some sort of good or item. It might be transportation. It might be housing. It might be some sort of service. It might be monetary or financial. It also could be a skill or something that's educational. But it's creating connections that either existed and may not have been that strong or might not have existed before but can find a mutual need to. And the interesting thing with the sharing economy is that it's changed a lot about how we relate to each other as humans. Everything that we do in terms of transactions with other people, even though it's through software, it's really based on trust. The sharing economy leverages our interconnectedness, sometimes successfully and sometimes not so successfully. And it's changed how we relate to one another. Airbnb did an interesting thing where they started looking at their user groups and they were trying to measure how to make people more open to the idea of a stranger coming into their house. So they started measuring and evaluating trust to make someone more likely to create a connection that might not have happened before. It's also changed how we navigate careers. Just before this talk, we heard about how we hire people who are like us. We're more likely to hire someone that we are connected to. Interestingly, last year, LinkedIn, their data team, they started analyzing their data and they shared the results. And they found that in terms of people getting jobs through LinkedIn, people were more likely to be referred for jobs by their second and third degree connections rather than their first, which is really interesting since most people would probably focus a whole lot more on their first degree connections. But it turns out third degree and second degree connections will get you a job. They also found that men typically have much larger professional networks and connections, but women have higher quality ones. That would be interesting to research more. I don't feel comfortable making any claims about anything. And it also turns out that connections to get jobs was incredibly powerful and mattered the most in technology related sectors, which applies to all of us in this room. But I think the interconnectedness of graphs and how it applies to us today ties in directly to how we choose our government. So about a month ago, The New York Times wrote an article about how fake accounts based in Russia purchased about $100,000 worth of ads on divisive issues leading up to the 2016 presidential election. If Facebook is just a giant graph, what does that say about finding connections between people? ProPublica, after that came out, they they did an investigative journalism piece about how hard it is to find a group of people on Facebook and spend money in ad targeting them. So they looked up search words like Jews and burning Jews, just to see how quickly they could find people who align with those terms on Facebook. Turns out it took them $10 to spend on advertising. And in 15 minutes they had already found a targeted group. Facebook has 2 billion monthly users, but they only have about 20,000 employees. So if you imagine a graph with 2 billion nodes, that's a lot of data. They have approximately one employee. If you did the math to oversee about 97 thousand users, but obviously not all those employees are doing the overseeing and what Facebook has done is automated searching through that graph. And it makes sense in a lot of ways. Once you've figured out the math of how this works, you can use algorithms like breadth first traversal or a depth first search. And you can trust in the mathematics of how you've built that graph. Or can you? The problem with using mathematics and relying on it so heavily is that it can be really easy to trust the algorithms that we rely on to automate our world. But it's not always wise to trust mathematics so blindly. Trust as it turns out is a very hard math problem. And we need humans to intervene. We need them to step in and keep an eye on the math behind this and reevaluate it. We need humans to pick up where the math ends to evaluate whether the math is fair to everyone, whether it's reliable. And if it's not, we need them to innovate better approaches to the really hard problems. And if you think about it, that's exactly what Euler did. He saw that all of the tools at his disposal, geometry, algebra, the basic math of counting, those weren't reliable enough tools to solve the problem that he had faced. So he created something that he based on other ideas and slightly on intuition and a little bit of luck. And he created a solution that did work for the problem he had. And that's been iterated on. So that leaves us with one last question. Whatever happened to Konigsberg? Well, history has a really ironic sense of humor, it turns out. After Prussia fell and was dissolved, Konigsberg became part of Russia. And in World War II, it became occupied by Nazi Germany. As a result of the war, there were many bombings and Konigsberg ended up being kind of a central point for both the Nazis and the Soviet Union. I guess there are a lot of different groups that were in that area at the time and it was very much destroyed. And there are a lot of bombs that were dropped on Konigsberg. And as a result of those seven bridges, two of them were completely wiped out. So this is a map of Konigsberg today, except it's not called Konigsberg, it's called Kaliningrad. And it is still in Russia. And you'll notice that there are five bridges instead of seven. And the really, really ironic part about all of this is that now it's possible to make a Eulerian path. And for all of the irony and history's great sense of humor, I like to think that Euler would have gotten a kick by that. Thank you.