[MUSIC] So far we've seen why computational thinking is important and what it can do, and we've learned about the four pillars. In this lesson we'll see how we can apply computational thinking to solve problems by working through our two case studies. But first let's do a quick recap of the four pillars of computational thinking. The four pillars are decomposition where we break down a complex problem or system into smaller parts that are more manageable and easier to understand. Pattern recognition, where we find the similarities or patterns amongst small or decomposed problems so that we can solve more complex problems. Data representation and abstraction, where we describe data in a structured manner and generalize details about data and processes so that they're reusable. In algorithms, which are sets of finite step by step instructions for solving this and similar problems. Keep in mind that when we use computational thinking, we don't have to apply all four pillars. For instance, it may not be possible to break down a fairly simple problem into even simpler ones using decomposition. But we can use these pillars as tools for developing a solution to a problem in such a way that it can be carried out by a computer. Let's do a quick review of the running example we've seen so far where Sue was using the pillars of computational thinking to solve her gardening problem. For decomposition, she can break this into smaller problems. Purchasing the mulch, then mulching each flower bed separately. For pattern recognition, she noticed that there is a process that is repeated for each flowerbed. First she needs to clean and weed it, then she lays down the appropriate amount of mulch. For data representation and abstraction, she represents each flower bed just using some identifying name and its square footage and can ignore other details. Finally, she could use computational thinking to develop an algorithm that allows her to follow step by step instructions for completing this task. After doing some initial steps, she repeats these steps here for each unmulched flowerbed. And when there are none left, then she's done. As we saw in the first lesson of this course, computational thinking involves using concepts from computer science to develop solutions to problems. But it also involves expressing those solutions in such a way that they can carried out by a computer. And admittedly, Sue might not need a computer to help her once she's figured out this algorithm. But in our first lesson we introduced two case studies where they would want to use a computer to carry out their solutions. We saw that Erin from the Penn LGBT Center who's trying to figure out how to schedule meetings with all the groups her center supports. And Cindy from the PennVet working dogs center wanted to be able to make predictions about a dog based on its similarity to other dogs. So let's revisit those two cases studies and have Erin and then Cindy explain how they would use the pillars of computation of thinking to solve their problems. >> I'm Erin Cross, and I'm the director of Penn's LGBT Center. The LGBT Center supports Penn's LGBTQ plus students, staff, faculty and alumni through education support and advocacy. Center staff have difficulty scheduling meetings with the 27 students groups we support. And we want to make sure we can meet with all the groups in a timely fashion. By scheduling meetings with student groups more effectively, we can meet with the groups more often, therefore better supporting them, which in turn helps these groups better serve Penn's queer and transgender students. This is really just two smaller problems we need to do repeatedly. Schedule a meeting with one of the groups, then remove any meeting request conflicting with the one we just scheduled. There a repeating pattern of scheduling meeting and removing conflicting requests. So when choosing which one to schedule, there a pattern of looking at all unscheduled requests and picking the best one. For the purposes for this problem, we can represent each requests as proposed start and end time for the meeting. And we need to keep track of the group name, so we know whom we are meeting. But we can remove details such as the number of students in the group or the purpose of the meeting since those don't factor into the scheduling. The algorithm we'll use continues repeatedly until we're out of meeting request to schedule. First, I'll look at the meeting requests one by one and find the one with the earliest starting time so I can start the meetings as early as possible. That's the one I'll schedule. Then I'll look at all the other meeting requests one by one and remove any requests overlapping with the meeting I just scheduled, which basically means their start times are before the end time of the meeting I just scheduled. And then I'll continue by looking for the next remaining earliest meeting starting time and so on. Now that we have a computing solution for scheduling group meetings, we're able to choose meeting times that work best for both our groups and staff without having to email back and forth to set up times. It also allows us to more fairly determine meeting times and saves us a lot of time and aggravation. It also allows us to increase communication between the center and all our groups, while better supporting our groups and students. Which, in turn, enables them to better serve the queer and trans community, and indeed, the entire Penn Community. >> Hi, I'm Dr. Cindy Otto, and I'm the Director of the PennVet Working Dog Center. The Penn Vet Working Dog Center is a research and training facility, in which we raise and train detection dogs to help save lives. Our staff have a challenge in determining which area of focus and which type of training is best suited for a new dog. We want to be able to predict if that dog can be successful particularly in disaster search and rescue. We want to look at how that dog is similar to other dogs that have succeeded in this area so we can focus our attention and our training for the new dog. To evaluate our dogs for their competency in search and rescue, we generally look at three types of tests. The catwalk test is a test in which we see if a dog is able to traverse an elevated plane. It tells us about how confident and brave the dog is. The surface test is a test in which we evaluate how comfortable a dog is when they move across different types of flooring like slippery surfaces or uneven surfaces. It tells us if the dog is willing to explore and if it's cautious in new environments. The conflict test is a really challenging test. In this test, we toss a toy and ask the dog to retrieve it. But they have to first pass a bowl of food or water. This test tells us how focused the dog is on that toy, and if it will ignore something as exciting and interesting as food or water. By more efficiently, putting dogs into the appropriate area of focus, the center can increase its graduation rate and produce more dogs that will have an impact in rescue and national security efforts. We realize that this is really just three smaller problems. First, determine how similar the new dog is to other dogs using the results of the catwalk, surface, and conflict test. Second, find the three most similar dogs. And third, conduct a majority vote based on whether those dogs ended up being suitable for disaster search and rescue. One of the patterns in the process is that determining the similarity is done for each dog. Also, in determining similarity, there's a pattern of comparing individual test results. That's done the same way for each test. And in finding the most similar dogs, there is a pattern of comparing each dog to the other dogs, and seeing if it is one of the most similar. For purposes of this problem, a dog can be represented as a collection of its test results and whether or not it was suitable for disaster, search, and rescue. We don't actually care about things like its name, color, and other things that don't affect how we determine similarity. The algorithm we'll use consists of three parts. First, for each of the other dogs, we'll determine the similarity to the new dog based on the three test results, one dog at a time. Then we need to find the three most similar dogs. We can look at all the dogs' similarities, look for the largest value, and add that to the list of similar dogs. Then we can look for the second largest value, and so on. Finally, once we have the three most similar dogs, we can see whether the majority ended up being suitable for disaster, search and rescue, and use that for the prediction for the new dog. Now that we have a computing solution for this, we're able to focus our limited resources in a way to ensure that the dogs that are most likely to be successful in search and rescue receive the advanced training necessary to make them superstars. And allows us to let the dogs that won't be great search dogs develop the skills necessary to help them be successful, in a different, but important career like explosive detection or even cancer detection. >> As we said at the beginning of this course, you don't have to be a computer scientist to think like a computer scientist. Through these examples, we've seen how Erin and Cindy can use computational thinking to solve their real problems. And by solving these problems, Erin's organization is able to support more groups that support more students, and Cindy's organization is able to more effectively train dogs to help with disaster search and rescue efforts. Computational thinking really can and does have a positive impact on our world. So now that we've seen the four pillars of computational thinking, you might think, all right, we're ready to start writing some code. >> But hold off a bit, although we've developed algorithms for these two examples, we're not quite ready to write the code. First we need to think a bit more about algorithms in general, look at some common approaches that we can use to solve lots of different problem, and then understand a bit about the efficiency of algorithms. We'll see that in the next part of the course. Right, Chris? >> Right, and then before we start coding, we need to know what a computer is capable of doing, and start thinking about how to express algorithms in a more structured way. And then finally, we'll use a language that the computer can actually understand in order to implement these algorithms, and that's what we call programming. >> Then let's take a closer look at that next step, understanding more about algorithms. See you soon.