If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:11:49
AP.MICRO:
PRD‑1 (EU)
,
PRD‑1.A (LO)
,
PRD‑1.A.4 (EK)
,
PRD‑1.A.5 (EK)

Video transcript

we hear the Khan Academy are working on some type of a software project and we need to think about what's the optimal number of programmers we should hire at least think about how much how much productivity we're getting per programmer when we are working on this software project and so what I've done over here this is a spreadsheet so I'm not going to be able to write I'll only be able to type this is a Microsoft Excel right over here in this column I have the different numbers of programmers and then let's say based on other studies or industry studies or past experience this tells us how many lines of programming code we can get per month and obviously lines of code isn't maybe the best way to measure things because someone can write good lines or bad lines of code but let's just say this is one way of measuring productivity for software engineers so the first thing I'm going to think about is what am i what are my fixed cost so what am I going to spend no matter how many software engineers I hire for this project and for the sake of this video my fixed cost will be the office space and the electricity and let's assume I just have an office that can accommodate any number of these programmers so that's a fixed cost that's not going to change depending on the number of programmers that I have and then the other fixed cost let's say I have a product manager for this project and I'm going to pay her salary to essentially help spec out what this brought what this what the software should should actually do so her salary is let's say ten thousand dollars a month and then another five thousand dollars a month in office space for everybody so it's going to come out to fifteen thousand dollars a month and that's not going to change regardless of however many programmers I have so I'm going to go into Excel I'm going to this little bottom right right over here and I'm going to drag that down and so it's going to be fifteen thousand dollars in fixed costs no matter how many programmers I end up hiring now the variable costs let's assume that the full is sometimes people well let's just say that the full compensation for a programmer is ten thousand dollars a month so if you include if you include the cost of their salary if you include the cost of their health insurance you include you know the extra goodies that they will eat from the company kitchen whatever it might be so it's going to be ten thousand dollars a month so my variable my total variable costs are going to be ten thousand dollars times the number of program murmurs so here I'm going to write equals equals and I'm going to write it's going to be $10,000 per programmer times that little snowflake guys pressed shift eight to get that snowflake times and I could say times whatever is in that cell so you see it's cell d7 and actually let me scroll this over so that you can see so you can actually see the cells so that is cell d7 and let me press ENTER so that's cell so it's $10,000 times d7 which is this one right over here and I just selected that and I can press ENTER and right now that's nothing let me scroll over so we can see everything a little bit a little bit better let me scroll over a little bit to the there you go I'm having trouble okay there you go now what are going to be my total cost my total costs are my fixed cost plus my variable costs so that's going to be equal to and I'm just using my I'm just using my arrow keys right now it's going to be equal to f7 right that's lf7 f7 plus this one plus my variable cost my total costs are my fixed cost plus my variable costs and so it's $15,000 and actually I can make this true for every row over here and this is one of the really useful things about a spreadsheet is I defined this I defined this cell as being $10,000 times whatever this cell or times whatever this cell is right over here and so what I can just do is I can just scroll take that drag that all the way down and for every one of these is going to take $10,000 times the cell that's essentially three to its left so now this is going to be 10,000 times d8 this will be 10,000 times d9 or and look look at that so that's we could see right there 10,000 times d9 and you could if you click on there you can actually see what the formula is 10,000 times d9 so by dragging that I was able to get the right formula all the way down now the total cost for every row here is going to be 2 to the left plus 1 to the left and so if I drag that down it will do that for every row over here so now this is 25 is the 15 plus the 10 five is 15 plus 90,000 our total costs are fixed costs plus variable costs now let's think about the average fixed costs and the average fixed cost we're going to think about it in fixed costs per line of code produced and over here line of code produced is zero so we're going to get you're going to divide by zero which is undefined so we could leave that blank but we could fill this one in so our total fixed cost this is going to be our total fixed costs which is cell f8 I just use the arrow keys to select f8 divided by divided by our total lines of code per month so divided by our total lines of code per month and so that gives me three dollars and seventy five fixed costs per line of code and then I can scroll I can do the same thing that I've been doing before I can drag this down and then we see what the fixed cost is so at any given point if I take the fixed cost $15,000 divided by the lines of code I get a dollar 38 and this actually makes sense because the more the more programmers I add on to this project the more lines of code I get I'm using the same fixed costs I'm using the same project manager I'm using the same office space so the cost of that project matter that office space gets spread out amongst or along more and more code so the cost the fixed cost per line of code goes down as we add more and more programmers now what is the what is the average variable cost so once again the variable cost is going to be whatever the variable cost is per lines of code per month so we're when we're talking about average time what average cost per line of code and maybe I should so this is per line of code per let me write it over here per line of code and I can even say per month per line of code per month actually I wanted that to spread out more but the way I've set it up so let me scroll down whoops let me I'm having issues here all right well these are all per lined average average lines of code per month and so let's think about what happens with our variable costs so I'm also going to start here because I don't want to divide by 0 so in this month our total variable costs were $10,000 and our total lines of code are going to be $4,000 g8 / e8 and so average variable cost per line of code is two dollars and fifty and then what happens so let's do that for every row over here so when we do it for every row something interesting happens our average fixed cost went down because we're taking the same cost and we're spreading it out amongst more code but our average variable costs went up as we added more programmers per line of code it actually costs us a little bit more on average per line of code and that's actually if you look here as we add the incremental lines of code we get programmer is actually going down that first programmer by themselves she can write 4,000 lines of code but then that second programmer is only not you're not getting to 8,000 you're getting to 3,000 and probably because they have to coordinate with each other they have to plan a little bit more it's not all in one person's head and then when you have the third one you're not even adding three thousand lines of code you're only adding two thousand lines of code and this is actually a real phenomenon that actually happens in companies the more people you add on to a product project obviously they can maybe do more work but there's also more coordination there's going to be more meetings there's going to be more interruptions and so each person's individual productivity is going to go down and this isn't to say that this third coder is somehow worse than the first coder all of their on average all of them are now only going to produce 3,000 code 3,000 lines of code a month when maybe individually they could have each perused 4,000 lines of code but they have to spend some of their energies now coordinating it and so that's why our average variable cost per line of code is going up as we add more and more people's getting us incremental e it's getting it's becoming more and more expensive on average to write that line of code and if we look at average total cost that's going to be and this is once again this is per line of code it's going to be our total costs h8 h8 divided by the total lines of code per month so on if we just hire one engineer we're going to have six dollars and 25 spent per line of code and that's because a lot is spent on and these are this is actually just the sum of these two right over here and then let me get let me make that true we set that formula for every row and so we see something interesting when we start to hire you engineers were able to spread out our fixed cost even though our average variable cost per line of code or going up our fixed costs are going down so we're it's actually we're getting a little bit of a benefit because we're spreading our fixed cost per line of code but then it starts to get expensive again because as we said the more people you have working on the project they're going to have spend more time coordinating with each other and and maybe even undoing each other's work or redoing each other's work as opposed to just writing the actual software and now let's think about the marginal cost the marginal cost the best way to think about is what is the incremental cost of that next set of line of code so one way to think about it so this is going to be how much more you're spending divided by how much more code you're getting so how much more so for example how much more and this is going to be once again per line of code so once again so we're getting we're spending when we go from zero programmers to one programmer we're going from $15,000 of total costs to 25,000 dollars of total cost so we're going from we do in parentheses 25 if we're going from 15 to 12 to 25 that means we're increasing our expenditure by 25 minus 15 and so that's why I'm doing H 8 minus H 7 so that's how much more we're spending in expenditures and then how much more code are we getting well we're getting we're getting four thousand minus zero lines of code and the reason why I'm doing the formula this way so that when we drag it down on all the rows the formula will be right because it's relatively taking the right cells into account and the reason why I'm saying it's average is because this is saying what's the incremental cost per line of code for this first 4,000 lines of code and then we can go from there and we can drag it down and now this tells us the incremental cost per code for the next 3,000 lines of code and once again it got a little bit more expensive because we're getting a little bit less efficient as we add more and more people and there's something very interesting that happens here and you might have even noticed it in these numbers over here we actually get a negative marginal cost and this isn't meaning that when we add more lines of code somehow we're getting money it's actually saying that as we spend more money or actually we're actually killing lines of code because at some point if you have too many people on this one project team they actually start killing each other's productivity and you can even see it right here in the numbers when we had seven people were able to add eleven thousand four hundred lines of code but then the eighth person because of coordination it's not that this eighth person is incompetent it just when you have eight people in a team everyone's productivity goes down so that you're only able to produce eleven thousand two hundred lines of code and that's why you had this negative marginal cost now when you get to eight people all of a sudden buy at spending more dollars you're actually destroying some of what you are actually trying to produce so what I wanted to do here is just to really get you behind the numbers and really maybe give you a little sense of how you can actually do this with a spreadsheet and get you thinking a little bit about how a firm's cost structure might actually work