 It's with great pleasure that I'm introducing Simon Payton-Jones to give us his perspective on the coming together of mathematics and computer science in education. Simon has made major contributions to the application of mathematical theory to practical computer language design. Simon has been a very good friend to those of us engaged in classroom research in continuum mathematics and functional programming. Over the years, ATM members have contributed extensively to computer-supported mathematical education. Accordingly, we look forward to a stimulating talk and discussion. Simon. Great, thank you Ian. Let me share a screen here and still be able to see chat. Yes, good. Well, it's a great pleasure and privilege to be here. Thank you for inviting me. It's a pleasure to be invited to address a bunch of teachers of mathematics is quite a privilege for computer scientists. So I'm not a teacher and I'm not a mathematician, though I did two years worth of a math degree at Cambridge. But nowadays, all research computer scientists are basically mathematicians in disguise anyway. Now, Ian tells me that I should not worry too much that you'll be sort of sit there like a quiet, polite audience that you're feisty, even argumentative. So please make comments or write questions in the chat, which I'll monitor and Ian will monitor as well and maybe interrupt me. It'll be more fun for me if this turned into some kind of conversation rather than just a monologue. I have plenty to say, but we will just cut and make sure that we get to the end and then we're going to divide into breakout groups at the end. Okay, so here's our starting point then. Computing has now become established as a foundational subject alongside maths and natural science that every child learns from primary school onwards. This is what the national curriculum says in so many words. It says that all children from primary school should understand and apply the fundamental principles of computer science and should be able to analyze problems in computational terms and have repeated practical experience of writing programs to solve such problems. So that's pretty direct, pretty black and white. It's moved computing from a kind of instrumental or perhaps even vocational subject that you might study for the purposes of being able to operate a computer well to a foundational subject so that you can understand the world that surrounds you. The reasons are exactly the same that we want to study maths and natural science for every child from primary school onwards, namely so that it equips children to understand and have agency in and be able to make informed choices about the natural and the digital world that surrounds them. That's why we teach children physics. It's not because they're all going to become physicists. It's because if you know nothing about physics you are disempowered and unable to make informed choices about the world that surrounds you and it's just the same with computing. So that's a pretty big shift of perspective and the question that we want to talk about today is how might that shift of perspective affect the relationship between computing and mathematics. And the suggestion I want to put you before you, which was exemplified beautifully by George's talk earlier today, was maybe we could think of it in a symbiotic way. So symbiosis means when two here biological organisms have a somewhat close intimate and long-term interaction that enriches them both. That's what I'm after here. So here's a little vignette that features Miles who is indeed here in this conversation in the audience here today. He was teaching a workshop using scratch in London several years ago and a teacher wrote to him subsequently and said this. He said this girl M realized that she could replace the repeated steps of a loop which was moving a turtle around and drawing a square. Instead of writing eight commands she could write two commands wrapped in a for loop that just did those two commands four times and she explained this to her colleagues in the class and she had the confidence to do that and nobody really told her how to do that. She hadn't had iteration explained to her. She just tried it out and it worked. But what I really like is what this teacher wrote about her subsequent experience. She says I have self-esteem going through the roof and she has associated her computing success with mathematics. Over the last couple of weeks she solved math problem after problem. She's met target after target. She's truly flying and she's doing this because she's had a positive experience of computing. Now for me this I find this quite touching. It makes my sort of heart feels good. It's that sense of agency and empowerment that I think that we seek both as mathematicians and as computer scientists and perhaps we're going to get even more by talking to each other. Before going there though I just want to highlight two related dangers. One is that we treat maths and computing as being in competition for limited timetable slots. That is we conceive of ourselves as competitors in the challenge of trying to get mindshare of children or teachers fighting each other. This is not good because it's a zero sum game and actually I think we can do better than that. We can hence the title of this talk. Maybe we can by working together we can enrich both of our subjects to the benefit of both. The other danger is that computing is perceived as a kind of useful, yes perhaps even you know trendy these days, decoration to the real subject which is of course mathematics. Here is a symbiosis between the bird that picks the ticks out of the hide of the buffalo and that is a symbiosis but it's slightly unequal partners here. I'd like to think of us as more equal partners in this game and another thing I picked up from George's talk earlier today was he's saying it's easy to sort of layer computing into the curriculum and just say well look you know they're doing some programming and they're engaged look it's exciting but his question was are they learning any mathematics? So rather than saying we'll do one thing and then we'll spend a bit of time doing something else and look it looks good they're engaged let's try to make the most of this interaction. So what I would like to the slogan I would like to suggest is that it's not just a way to do maths better but we might even think of it as a way to do better maths and perhaps to do better computing too but this is the ATM conference so let's concentrate So far so good. Let's just say a couple of things that I'm not talking about so one is of course there's a lot about how to use information and communication technologies of various sorts to teach all subjects better right to use distance learning and flip learning and use the internet and creative way that's all very good right it's all very it's and it is important it's just not what I'm talking about. Much closer to what I'm talking about was Alex talked earlier today about how to change mathematics teaching because of the availability of computers as a tool but here his emphasis was very much on you know we're teaching maths and we're going to change the way we teach maths because of computers and mine is a little bit more even handy so these are much closer but they're not not my primary focus. Okay so first we have to say a little bit about more a little bit about what we might mean by computing as a school subject remember in that words at that national curriculum it said computer science now when I was at university not so long ago no only only 40 years ago computing wasn't even a bona fide university subject at least at the University of Cambridge it is now and but it it's it's been quite a big step to think of it as a school subject rather than as a university specialist I think of computing as the the study of information computation and communication not notice data algorithms and networks right so these are I'm trying to stress the discipline aspect of the subject here and I put in sort of smaller writing some of the pieces of the that you might think of under these various headings and I put a box around them all to suggest that programming is a sort of cross-cutting concern it infuses and is everything is shot through with programming computing without programming would be like natural science without lab work it would just be hopeless but it's not the whole thing so it isn't just about why we should teach our kids the code it's about the underlying subject discipline and there are lots of common themes between the study of computer science as a foundational discipline and the study of mathematics so abstraction is a very obvious one right in Alex talk he was talking about abstracting from the real world to some kind of model of the real world and then doing some computation or some reasoning or some some calculation about a calculation was the word he used and then finally interpreting that back into the real world and of course that's what we do when we write programs all the time we are abstracting pieces from the real world into our programs programs deal in abstractions another very common theme is the idea of doing something once right with algebra instead of doing something many times we write some algebraic equations and we solve you know a million specific cases all in a single blow and if you write a function definition in scratch or in python you are parameterizing over the input parameters you're doing something once more than many times and the abstraction that is algebra is quite similar to the abstraction that is a function and you have variables that stand for values both disciplines encourage precision in thinking rather remorselessly actually and logic logic plays a very fundamental role in computer science as it does of course in mathematics so there's lots of commonality now but the the one that I'd like to stress most of all is that I think of computing as mathematics made incarnate that is mathematics takes flesh it becomes tangible it becomes concrete it becomes executable it becomes experimental and exploratory as some of george's example showed and often it becomes motivated by some kind of context I'll show you some examples of that later so here's a slightly you know perhaps this isn't a primary school example but maybe a secretary school example of what I mean by maths made incarnate if I write a for loop and I to add up the numbers between you know from one to n well then I've got something that looks very like a base case when I initialized the variable I've got something that very looks like an inductive step when I add i to it and then if in fact if I'm going to reason about the you know the total that this loop computes in any particular iteration that is what what what computer scientists would call the loop invariant all I'm doing is I'm doing a proof by induction so I think of loops as induction made executable if you like so what's the the idea of a proof by induction is a somewhat abstract thing somewhat sophisticated thing and yet primary primary school children are in effect doing not exactly proof by induction but they're doing inductive reasoning and execution from a very early stage nothing in the chat so far very ominous of course I'm not the only person to have thought these kind of thoughts right everybody is thinking about this the question is just how do you turn this into reality so let me just give a few pointers to the mother people who've done some brilliant work in this area one is Celia Hoyl and Richard Knoss's work on scratch maths which I think many of you will come across the url is here in the slides and I like this the way that they put it can we find a different language that is a language different to the language in which mathematics is usually expressed a different language and a set of ideas and approaches that is somehow more open and more accessible and more learnable and that somehow brings mathematics to life without you know downplaying the mathematics the mathematics is still the goal right but but it's maybe it just expressed in a different language in a different a different sort of way into that cognitive space here is a they have a very nice video on the scratch maths homepage and I love this quote for this young woman who's describing what she liked about participating in the scratch math project she said when what I really like about scratch is when you press that start button and you see your script come into action it's like magic in front of your eyes and here she didn't mean the sort of magic that Arthur C Clarke was thinking about when he said any sufficiently advanced technologies in disengagement from manage magic which I take to be a bad thing magic that is not under my control you know made by somebody else here she meant it's sort of miraculous that something that I did and that I understand does something so wonderful as draw these patterns it's sort of I found it very inspiring this little video you should watch it so scratch maths and scratch maths is back with a whole bunch of it's a primary school kind of level and there's a whole bunch of actual tangible materials that you can try out and I hope that you if you haven't come across it before I hope that you will here's another which is perhaps a little bit less well known in this country which is the bootstrap world project and it's some it has four major units on algebra reactive programming data science and physics and there they're using each of these is a pretty substantial strand and they're explicitly targeting learning maths they're not targeting learning computing they learn a lot of computing on the way and here you know they're explicitly exercising mathematical concept like coordinate planes ratio and proportional domain and range function composition that kind of thing okay so they're they're very explicit about the connection with mathematics and it's been extensively trial in schools these are all project these are not just academics you know polishing their fingernails these are people who are working in schools. Paul Kersen I wonder whether you all know Paul Kersen he's an amazing computer scientist works at Queen Mary College in London but does a lot of work with schools he has a wonderful magazine called Computer Science for Fun CS for Fun it's a website and magazine and he has a whole page here I give him the the the list above but that the URL here that describes how computer science and math maths and in particular numeracy has a lot of examples about numeracy can inter work with each other and then from this very conference George George's talk this morning I thought was a brilliant description about how if we think of computing and maths in symbiosis it might change how we think about teaching mathematics I picked this this little piece from one of his slides that you the learning is kind of it's kind of exploratory you write an executable program and you keep changing bits of it and you explore in ways that would be hard to do with a pencil and paper he described it as playful and also that there's a lot of incidental learning going on that rather than just you know teaching saying your learning objective is this you're just learning by by by trying things out not in the completely unconstrained way of of just you know be in a big room full of bits of kit and you know have fun it's quite directed but there's quite a lot of incidental learning going on I just put in this thing about immediate feedback but I think this is also pretty significant I'm not a teacher so you're better judges than me but computers are very pitiless about pointing out your mistakes they do not say oh I better put this tactfully that you have a right in a bug in your program no it just doesn't work but at the same time it's private and it's non-judgemental right the computer doesn't say you're a stupid person and and it's not it's not a public humiliation so it's you get a very tight feedback loop but in a very non-judgemental kind of way I'm not going to respond to it because question yet we can maybe do that in the panel discussion do you agree the computation is limited by mathematical logic and therefore artificial intelligence is not possible it's a very open-ended question thank you but maybe later yes and Pip I do agree scratch is tremendously useful in second jubilee up beyond we should not regard scratch as being oh just for babies just for primary school students it totally you know if you can do it scratch you should probably should do it in scratch it's so immediate now I wanted to give to bring this down to earth a bit by I was challenging myself really to come down from these airy aspirations to something more tangible so here are three tangible examples which I'll give in successive levels of detail just to give you another idea of what I from a computer science point of view I'm thinking about and but with the caveat of course that in unlike these other projects that I've described I'm not a school teacher I do not teach mathematics I do not work in a school and so you will just have to make of this what you will however this one comes from an interaction I had with my nine-year-old son Kenzie and who was doing some scratch programming and he said I want dad I want to make the rocket go towards the planet but as it gets closer I want it to slow down so this wasn't terribly hard we did it together here's a how you might do it you want to move the rocket successively there's the forever loop with a little gap in between that's the weight 0.2 seconds and we'd like to move it how many steps oh the number of steps we want to move is something to do with the distance between the planet and the rocket so we need to subtract the distance of the of the planet the exposition of the planet from the exposition of the rocket and then maybe to to choose how many steps we go we then have to scale it by something like in here I divided by 10 so of course you know this is kind of second nature to all of this but when I started to think about I realized that already in talking to Kenzie without having to talk to you know have learning objectives and things we'd already discussed coordinate geometry this was just in one dimension in fact we'd already discussed sort of grouping right that the subtraction occurs before the division and scaling but he had had some notion of proportion to scale it down and also if the rocket was on the other side of the planet I think this came up in George's talk then you'd have a negative difference you'd have so you'd the the numerator would become negative and it comes up it's almost as if the child begs you to allow negative numbers rather than us having to say negative numbers to the object what you're learning objective for this lesson right I would like mathematics to be something that children are begging us to say you know of course we must be able to do this and you say sure and you can here is one other piece that barely came up when I was talking to Kenzie which is that when the rocket gets close so that the the number of um uh the distance between the two becomes you know round about 10 or a bit more than 10 or a bit less than 10 then you have to start talking about well what is nine over 10 how many steps is that and can scratch talk about nine over 10 and will it round down or up and you get that you get the things which computer people think about a lot um now uh let me just look at these um uh there's lots of commentary here this is really good thank you very much um okay but I think I think I'll none of them look like formulating the form of questions so I think I'll carry on um so uh let's see then um then we try to do this in two dimensions and I realized again I was this was a learning journey for me actually that oh so now I've got to move on a diagonal way um but of course I know that I can just do the x and the y separately but it was a bit of a bit of a surprise to Kenzie I don't know whether he really got it but the idea that we can just think about the x displacement and the y displacement sort of separately and they'll add up in a in a sort of vector like way to the right thing that's quite a sophisticated idea I don't quite know what's the what when the right cognitive moment to bring this in but I just thought there was there was quite a lot of places you could go with this and indeed we didn't get on to all of this stuff but you can go a long way with this kind of game you could involve mass and velocity you could think about the inverse square law rather than going slower when you get closer you could have an inverse square law you could have a three oh that should be three body problems um and have planets orbiting around themselves and they can draw where they've been very easily um you could have a spreadsheet that gives a table of position velocity versus time things and graphs to visualize that there's a but what I like about all of these things is that things you can just try out you can just try it okay um I will by the way people who are interested in links I will I will post all these slides via Ian towards the end of the day so that was that's that's example number one primary school level example number two um this is more more of a sort of early secondary stage this is a um how would you estimate the value of pi we do areas of circles and pi r squared and all that but it all when I did it at school it all felt a bit abstract and remarkable and you know this is funny formula and you just operate the formula and low um I've become an excellent formula execution device right I'm the algorithm that executes pi r squared but I didn't really understand it at the time here's one way which you might understand it imagine drawing a unit square here well this is a um a sort of two unit square around the origin and a circle that is inscribed within it and throw darts at it well and what proportion of the darts fit inside the circle well of course the area of the green circle is if you just look at it intuitively it's going to be you know a bit less than four times r squared but four to four r squared is the area of the whole square so it's a bit less than four so you can see that pi is going to be kind of round about three um and then the proportion of the darts inside well it's going to be pi you'll have to know the formula for the area of the circle okay pi r squared divided by four r squared so that's pi over four so what how could I then calculate the um the area of the the um or maybe sample the area of the circle so I did um let's see I made this uh uh little spreadsheet took me about five minutes um here it is and uh and low oh so what did I do here with these um uh the um the uh the first column is the um x coordinate of my um uh dart the second column is the y coordinate they're both going to be random numbers between minus one and plus one and the inside circle column here is a formula that says is did the dart land inside the circle and then at the top here well I'm going to is is the um computed value of pi so I'll just show you the formulae uh here the formulae so rand in excel computes a random number between zero and one so to get it between minus one and plus one I had to double it and then subtract one so it's an interesting little piece there um so then I do lots of those and then this is my calculation this needs Pythagoras of course to um figure out whether the uh whether my dart landed inside the circle and in fact I decided I didn't need to use square root because if I take the square root of both sides square root of one is one um and uh then I just copied down and what's this formula up here that that formulae is just tells us some oh I'm going to count the number of times I get true right because it's true if it lands inside the circle and falls outside I'm going to count the number of truths in this you know in this hundred cells so I've got I've got you know c1 to a hundred I've just just copied down done a lot of them and divided by the number of rows in c4 to c100 um and then I multiply by four because that was the the pi over four bit um and low uh so now we go back to here and um every time I hit refresh I'm I'm secretly typing um uh f9 to recalculate every time every time I recalculate I get a different value oh that was not very close 2.96 um 3.17 2.96 uh 3.25 okay and then I might think well maybe I could get a better estimate if I used more rows so I think I copy pasted 800 rows uh I have to look down to check but I think I've got that right um and now when I recalculate I get value that quite a bit closer to the right answer you know more of the time um and I on the uh in this little visualization here I'm plotting or um you know at least the sample of the points that I've done and that also is a kind of very quick thing to do um if this whole thing takes about five minutes to put together so um what am I trying to uh to share here just that um let me go back to uh this game um just that there's there's a I'm I'm trying to illustrate a sense of symbiosis between computing ideas and mass ideas so you could think with a with a mass hat on you might think I'm trying to um learn about pi or perhaps about um about statistics actually um about how many how many values I might need to get how how close to pi um and uh but also from a computing idea I might like to think about I'm learning some incidental skills about how to use spreadsheets I was flipping between formulae and um uh and values there I don't know if you saw that but that's something that's quite useful to know um here in in this spreadsheet I've also got the column C has Boolean values so we're used to seeing well in scratch you're used to seeing things like if x is bigger than y then do this otherwise do that but here I'm computing the the um you know inside or outside as a Boolean value true or false right it's a first class values and indeed to computer scientists Boolean values are first class values um but I think it's some it takes a while even for you know university students to truly get a hold of that but there it is manifested as a cell as a value of a cell um so it's a lot there's a lot of you know stuff going on in this one little um exercise I think it's um um could go uh I think you could go fairly far with this um so that was a um uh a second example oh I'm going to I need to read this by the chat so I can see if anybody what everybody's saying if anybody um let's see uh uh Jeff we asked you're using geometric ideas how do you see geometry being part of computing um um I think I I think I'm probably the wrong person to answer that question I suppose I see um being able to visualize things seems super important right that's a uh I'm often asking people when they're you know in a research contest to draw a diagram or to give an example so and if you but I'm not sure that visualization is coterminous with geometry um if you mean specifically geometry I think you need to ask somebody other than me um uh Alison says this activity feels if belongs equally well in a math or computing classroom yes exactly that's the whole the whole point I am the hypothesis I'm exploring is that maybe we won't have maths classrooms and computing classrooms perhaps we should only have classrooms right and and at primary school of course that is the case already but maybe we think although today we're doing maths or today we're doing computing I would like to today we're just doing maths and computing and maybe at key stage three and all the way up to age 14 when we start to separate into GCSEs perhaps we could wouldn't it be great if we just had maths and computing classes we did not have maths classes and separately computing classes um uh even if it takes longer there's lots of learning going on when making it yes that so and the other question is will it really take longer uh I don't know the answer to that I think there's a lot of research to be done here my hope is that in the end it won't okay lots of good conversations going on here uh I'm going to carry on I want to give a third example so this third example is a very different I'm going to spend longer on this example because it's a less familiar one and and my first example was kind of primary school level second was probably secondary um uh well certainly secondary but um perhaps uh you know uh uh key state late key stage three early key stage four um this third one is perhaps more a level though I think a good key stage four class could totally go with it um so it's about machine learning now Alec gave a an example in his talk about using um uh willful mouth and its ability to build image classifiers so here he had a magic box and for him it was a magic box that will take images and spit out um you know classify them into who so here here I've got a really simple classifier that is only determining whether the input picture is a picture of Hermione right and it will say yes for the first and it will say absolutely not for the second because Alec looks nothing like Hermione um but the question is how does the magic box work and that's what I want to get at um for a little bit so I'm now I'm going to dive into a particular example that you may be much less familiar with and hope that you'll enjoy so here's a more uh a smaller example um suppose I want to make a magic box that predicts the quality of a biscuit recipe and my biscuits are going to be made very simply they consist of x kilograms of flour y kilograms of butter and the rest is sugar I mix them together and I bake them and I get biscuits right and then I'm going to feed them to my children and see what they say they're good or bad right so in the end I'm going to produce a sort of chart like this that says I'm going to have a table with um and on the right here is the the the data of my table amount of flour amount of butter and um you know the balance is sugar and the verdict is good or bad and then I'm going to plot the good or bad I can imagine plotting it onto two-dimensional plot and if I'm lucky they'll all cluster together like this and I want to learn from the data which are the good biscuits and which are the bad biscuits so if I have a new x y pair I can predict what the answer is going to be that's a simple version of um this right it's just it's uh let's scale up a bit and one way to do it the simplest way to do this kind of thing is just to suppose we could learn a line that separates these two clusters well um what does it mean to to learn a line well uh well we know that lines um we're mathematicians right we say what's the equation of line y equals ax plus b we could just learn a and b could we learn the values of a and b that um describes a line that separates these um clusters well that turns out not to work very well because it doesn't work very well with the lines at steep right or even vertical because then you know a gets too large so it's kind of better if you can define your line by this equation ax plus by plus c equals zero right that's a that's an equation that also defines a line it has three parameters but the none of the parameters go to infinity and in fact it's very nice because if a is zero you get horizontal lines if b is zero you get vertical lines and c sort of moves the line displaces the line around so this this turns out to be this is already an interesting observation that we can describe lines in more than one's more than one way um okay uh i'm guessing x plus y is less than one yes yes miles the uh i should have said x plus y the balance is sugar it's only one kilogram so x plus y better be less than one um so i'm going to try to learn a b and c um and the good biscuit's going to have the property that x plus by plus c is going to be bigger than zero and the bad ones there'll be less than zero and indeed um here's a uh uh uh yes there's indeed a possibility that you could find the distance from a point to the line right because you might hope that the further away the line for it the more confident you were and you could do a little bit of mathematics to determine the distance away but that's kind of optional but basically the idea is we're going to um make some kind of magic box that has parameters a b and c um that has the x and y coming in on the side and that spits out yes or no uh or a number uh because we're not spread out a scalar value the number which if it's positive good biscuit if it's negative bad biscuit the larger the number the further it is from the line the more confident we are in our prediction okay so the question is how can we adjust a b and c based on the data until we get as good answers as possible that's the question before the house so what do we mean by as good answers as possible well we want to minimize the number of mispredicted biscuits in the training data of course so training data might there might be some noisy data or just bad data so we might not be able to drive it to zero but we want to minimize mispredictions so here's what we might um uh uh imagine doing let me I'm going to show you this what we'd like to do is to um you could imagine starting with a line a random line perhaps and then sort of picking a mispredicted biscuit from the training set that is from the data of experiments that I did on my children and adjust a b and c to somehow tug the line to be mispredicting less much less than it was as we're tug the line towards the biscuit that's being mispredicted and then just keep repeating that and I want to show you um that uh in action this is a um uh this is something uh a little website that you can all go to and I hope you will I'll give you the URL in a second um it's called TensorFlow Playground and it's um it has a uh let's see if I um we start here here are the biscuits just as I showed you clustered in the way that I showed and you um uh it's got this little this little box here is the magic box the thing in the middle the one neuron in the middle and if I press this big play button at the top left here it then somehow does that procedure that I described and finds a line that separates the biscuit and if I can I can stop it and start it again and I'll get a slightly different line and you can see um uh there's a um it computes something called the test loss the test loss is the essentially the number of mispredicted biscuits the training loss which you'll see written just below that's it keeps some of the train some of the data aside so it tests with it trains on some data and then it has some data kept aside that it doesn't use for training and it used for testing to see did the training work out well that's what called training loss and if the loss is zero means no mis predictions that's really good okay so uh TensorFlow Playground let me give you I'll give you the URL back in the um in the slideshow but you can you can start off right now you can start off playing with this um what what if you get bored in any of this talk okay so I'm going to switch back where do we go uh yes so uh here is the URL um playground TensorFlow.org maybe somebody can put that in the chat so that um anybody who's missed this uh catches it okay um now how are we going to do the tugging business well um um uh we want to um if we got a mispredicted biscuit the output should be positive but actually it's negative and I want to adjust a b and c to make the output less negative more positive how do I do that well one simple idea would be um maybe we can um adjust the parameters most by choosing which parameters most strongly affect the result and remember the result r here is simply a x plus b y plus c that is the thing we're computing that's what the magic box does that all it does is compute a x plus b y plus c um you know it's it's uh yes in fact I do it inside the box that's it that's that's what the computation it performs and so how would we adjust a b and c um to drive the output a bit more positive it was supposed to be positive and it was actually negative so we want to think about how sensitive is r to changes in a right that is we want the partial derivative of this expression with respect to a and if we take the partial derivative I mean I've written it out in mathematical notation here but actually it's fairly obvious that the sensitivity of r to changes in a is simply x and the sensitivity of r to changes in b is simply um where was my uh here I want to be able to see the chat the sensitivity of r to changes in b is y and the sensitive r to changes in c is one does that make sense I hope that somebody's going to start asking questions if this um but you're a mathematician so I'm hoping this is uh like your mother's milk um so how could I turn this little piece of mathematical reasoning into well an algorithm uh well here it is um I want to adjust I'm going to successively each time around I'm going to adjust a by an amount by change a by an amount that is described by its sensitivity um uh to um uh to the output the sensitivity output with respect to changes in a so um since I decided I'm adjusting a in proportion to x b in proportion to y and c in proportion to one how much do I adjust them I need to have a something called the alpha which is the learning rate right so maybe alpha is a small number that would adjust things slowly if it was a bigger number it would adjust things fast maybe I want to start off with a big learning rate and decrease it that's a piece of black magic that goes into machine learning um and so this is what you do every time around the loop um this is the whole machine learning algorithm this is what is going on inside you know the classifier that alec presented with us with presented us with this morning we pick random initial values for a b and c we pick a mispredictive biscuit from the training set then we adjust a b and c using these equations right um with a particular fixed value of alpha and then we just iterate and that's it that is all of machine learning on one slide the core algorithm of machine learning this this um think this step three is called back propagation now of course the reality is always always a bit more complicated but this is the essence of it and it's incredibly simple um so uh if that was it then I mean you might think it has to be more complicated than that right oh what about um um uh if the data isn't separable by a line um like here's some data that is there's no line that separates these well you think maybe I could still learn to separate the good biscuits from the bad biscuits by using more lines so here's how I could use more lines I could maybe take two magic boxes to compute here p and q respectively each with independent parameters a one b one and c one a two b two and c two and somehow combine those p and q together um to make the final output are maybe that would somehow I mean so I've computed two lines here that's the the p line and the q line and then I said I said somehow vote didn't I right somehow vote together well how could I combine two things oh I've got boxes that do that um maybe we should use the same kind of box huh maybe that could just be another box and now I'm looking at the um at the chat in the hope that somebody is going to say uh something that is binding me obviously in retrospect was completely obscure to me in prospect why would this could not possibly work this cannot be an improvement over what we had we just have to use some mathematical reasoning look here's a big box that has it has sort of nine input parameters now but it's still a big box with two inputs and one output but if we compute what the outputs are just using you know ordinary algebra r is a three times p b three times q and then do this well look crumbs it's still something times x and something else times y plus something else it's that big box was the same as a little box a single box with three different parameters so anything I could learn with this three three thing box I could learn with a one box so you know total disaster you know doesn't this is this is not a not a step forward but I love the way that seeing that it's not a step forward just involves elementary you know key stage three level mathematical reasoning okay so what can we do well um in fact the the trick that you have to do and this is the second key trick of machine learning if you remember only two things from the store the first thing to remember is this is how back propagation works and the second thing to remember is this is why we need non non-linearity you stick on the output of these boxes you can stick a non-linear function a very popular one is called value which stands for rectified linear unit it's an incredibly simple function it's zero if its input is less than zero and it's linear otherwise hence the linear the linear part is for the greater than zero the rectified bit is the less than zero that's all value is and then you feed that into this other box and that turns out to be enough let me show you um let's go back to tensorflow playground now uh so let me show you some more things you can do then with tensorflow playground you can you can add layers here let me stop this and let me pick the more difficult example here and of course if I attempt to do it with this one layer it tries to learn a line but it's really not doing very well you can see the test loss the test loss is bad right point four of all the input test things are not being well predicted the training loss is for some reason slight oh sorry training loss is bad point four test loss unsurprisingly a little bit worse um so what to do well what I said was we add an extra layer so let's add a layer here let's add a layer um and let's have a couple of layers here and maybe one here so this is with only two two boxes right let's have a try with that oh well it's kind of spooky isn't it it gives somewhat better somewhat better and at this stage you start to play you think hey let me just add more you know how about adding more boxes here does that help um let's make oh spookily it does look at that and these little straight lines around the edge around the edges of this region in the middle those are each computed by one of these little guys look they're each computing a different sort of line across this one looks if it's not doing much good these ones are all computing lines and they're somehow voted together here isn't that cool you think ah um maybe what would happen if I um if I made this bit harder what would happen if it was like um this oh would that be good enough for this sort of um having a bit more trouble here aren't we um somehow uh the the the way the data split up is not so good maybe and this stage you can go wild you think maybe I should have some more layers and maybe there's going to have some more neurons in them and then you could just sort of press go um and I have to tell you folks this is what machine learning people do they do a lot of suck it and see um and miraculously it does pretty well training loss very very good um and this is you you now know everything you really need to know about machine learning and you can you've done it in 15 minutes flat um okay I'm going to wrap up just let me say that um up here learning rate do you remember that alpha parameter you can change the learning rate here that was that alpha guy um the value is one of the things you can pick here there are some others that you can pick tan h and sigmoid but linear I think is no uh is the one we started with where there's no um non-linearity and sure enough it doesn't learn a bean right as we discovered earlier okay um back to uh back to things but I'm going to wrap um oops yes okay um um right so I just want to um finish up I want to also be able to see the chat which I can't see at the moment yes I can um good uh oh ma'al says is there any way to automate the suck it and see it no ma'al there isn't actually all of my colleagues at Microsoft for search are doing a tremendous amount of sucking and vast amounts of um uh compute power getting taken just doing essentially experimental exploration of the design space of their various um neural networks it's quite I mean there is a lot of um systematic thinking of course a lot of systematic thinking but there is no um there's no completely systematic way of saying I know that the way to do it is this there's tremendous amount it's like the early days of experimental biology in which people were just discovering things in the natural world and classifying them arranging them into trees and figuring out a bit about how things work but hadn't yet figured out DNA um now I want to I want to wrap up because I do want to leave time for um discussion and questions and workout groups um so the opportunity as I see it then is to um try to see computing as a school subject not as a competitive upstart to mathematics but rather as a kind of distinctive lens a way to think about maths education that lets us see it in a new light um now um alex um examples used computing in the service of maths you might think this machine learning example is using maths in the service of computing and some of the earlier examples were perhaps more symbiotic um you know it was it was more even-handed I don't mind I don't think it needs to always be but I would love to have you know a single a single conceptual you know subject almost that in which you had examples in which the boot was on each foot alternately when you were always marching in in parallel that you will each was shedding new light on the other um uh and I don't think that needs upset maths education I think more and this is also in the um uh the theme of alex presentation about computer-based maths more helping maths education find its true identity find the essence of what a good maths education is really like um and so and this is my final slide then um to make one and one make three then would not will not be easy I think because it will inevitably reshape the curriculum of both subjects actually I think in George's talk and in Alex we saw ways in which we can't just take an existing maths curriculum and say we'll plow through it in the same order in the same things but we'll just you know put some computer decoration on the top we may need to change the sequencing and I'm not an educationalist I don't know you know what would be appropriate and what wouldn't but perhaps you know that when I was talking about negative numbers with my nine-year-old I want you know maybe negative numbers of coordinate geometry might occur earlier um than they would otherwise do uh because the computing applications that we're using to illustrate beg for them um so it may reshape the the order and the structure of our curriculum development I do think it needs classroom research something that I know that ATM is keen on and uh and does a lot of because it's no no point in us doing this in airy fairy ways in universities the lesson industrial research labs it has to start in the classroom if it doesn't make sense there it doesn't make sense right we're trying to actually produce the education that leads children feeling feeling excited and enthused about what they're doing um and most particularly it needs educators who are interested in both subjects and this is to me this is the biggest challenge right that um uh that uh uh it it's not hard to find educators have thought deeply about maths or to find or it's a bit harder to find educators who thought deeply about computing and computer science it's really hard to find people who thought deeply about both and yet we want actually every teacher ultimately to have that sort of joined interest and that is a place where I hope I think and hope perhaps that ATM as a group might play an important and helpful role because you already geared up on um uh on all of this stuff um and I just want to finish with um to remind us that it's not this is all not so much about education it's about our children right that we want them to be engaged and curious and creative and playful about um you know our subjects and we want them to see them as exciting and enriching not as a dull treadmill so let's let's stay connected with that um but I'll go back to this uh and invite um more questions and feedback um Ian have you been gathering any questions um well there are some which I think we should perhaps take in the panel John had a question about generality which um it's probably more than more than a second to answer um but if we refer questions now to the panel and I can briefly introduce the breakout notes yes okay should we just just see if anybody who's some uh let me see how I'm going to stop sharing um so I can get my um very well has anybody um got anything they'd like to add um or comment on indeed us just just um quickly now before we switch to a break breakout sessions you know you could just unmute yourself and drive in okay well maybe we should do breakout sessions but I'm shocked by that Ian assured me that it would be difficult to keep the ATM audience down okay Ian over to you um just to introduce the the breakout notebook that you hopefully download it now what we did was we took a high level view 50 000 foot view of mathematics and computer science having common as John points out um the search for generality continues in the higher and higher levels of abstraction and then we brought it down to key stage one to three with algebra encoding key stage two to four with data science and modeling key stage three to four with reasoning about diagrams and key stage five to college with reasoning about matrix algebra and its applications for people who refer to engage with the material through a puzzle this is a tiling puzzle that we've used with key stage one children and um it is a set of puzzles but it it takes you on a journey through problems that have algorithmic solutions to problems which have mathematical solutions but not algorithmic solutions to make the distinction between mathematics and computing clearer the notebook also has activities which we selected from the sessions in the CTM strand and there's a question in it which Simon would like you to consider yes um so this is this is really the question that I was um uh sort of was running right the way through my talk I would love your help in um fleshing out examples of I gave you three examples uh a different uh sort of different age ranges for how I could imagine computing and maths existing in a sort of richer symbiosis but I would love to have more examples um because I think it's it's all very well-being aspiration we need to be concrete um so if you could um talk you know individually or talk among yourselves to develop um examples or contexts or um in which you could explore true symbiosis between maths and computing that would be really helpful I think we have a big gallery of such examples such examples will make the whole story much easier to tell um and I think um Ian and I wanted to because we're in um in breakout groups and we don't have an easy way to get back together um we wondered if you'd be willing this isn't something that as I understand you normally do in the in-person ATM conferences but if each breakout group was willing to um send uh you know one member of each breakout we was willing to send an email to um Ian to summarize a bit about what what went on in that group that would give us some way to connect ourselves back up and also perhaps to provide some raw material for the panel discussion that's taking place at four o'clock so this isn't a formal requirement it's a very informal one but we'd love you to to take advantage of it if you if you were willing um so see if you can find a willing rapporteur thank you okay you've got eight breakout groups with a dozen people also in each one uh I look forward to seeing you at 1600 in i5 or getting emails if you can't attend thank you again Simon and thanks um for um joining us