Você está na página 1de 19
THE ART OF MODELING WITH SPREADSHEETS Management Science, Spreadsheet Engineering, and Modeling Craft STEPHEN G. POWELL KENNETH R. BAKER SY CD-ROM included BASIC PROBABILITY CONCEPTS “ INTRODUCTION Probability isthe Zanguage of risk umd uncertainty, Since risk and uncertainty are essential ‘clement of business life, a basic understanding of this language is essential for the bu: ness analyst. In this appendix, we prescnt some of the elements of prohability as they are used in business modeling. We begin by describing probsisility distributions for uncertain parameters; then we discuss expected values, variances, and tail probabilities, describing ‘why they are generally appropriate measures for decision making. Finally, we deseribe the ‘elements of sampling theory. in order to provide the background for the text's coverage of data analysis and simulation The orientation in this appendix is not toward a broad introduction to probability th ‘ory. Instead, we focus particularly on the knowledge that an analyst might want to draw on during a model-building project. PROBABILITY DISTRIBUTIONS For any parameter in a model, we should give some thought to how precisely we know its value. Very few parameters are really known for certain, especially in models that predict the future. In various chapiers of the book, we discuss ways to take this uncertainty into account. The simplest approach is sensitivity analysis. in which we vary one or more parameters to determine how sensitive the model results are to changes in the parameter values. For example, we might determine that if sales ure high next year (50 percent above, this year’s level), our profits will be $5 million. while if sales are low (25 percent below this year’s level), our profits will be only SI million, With just this kind of information— an optimistic alternative and a pessimistic alternative—we have the beginnings of a prob ability model for the parameter in question. In Chapter 8, we forge an important link between sensitivity analysis and uncertainty. However, to appreciate this link, we need some basic concepts related to probability distributions. A probability distribution is simply « description of an uncertain event or parameter. AA simple and familiar prohability distribution is based on tossing two coins and counting, the number of heads. The distribution can be deseribed in a table as follows: Number of Heads ° 2 Probability 025 050 0.25 The same distribution can be described in a chart, as shown in Figure A.1. Both the {uble and the chart depict the outcomes of the coin toss and the probabilities of each out- come. Any probshility distribution must describe these two aspects of an uncertain event. A random variable is a numerically-valued outcome of an unceriain event. In the case of tossing two coins, we could have described the outcomes qualitatively (vith the ist HH, HT, TH, und TT), and we could still associate probabilities with those outcomes. 373 374 APPENDIXA BASIC FROBAAILITY CONCEPTS FIGURE A.1 Probability Distribution for Coin Tous However, when we describe the outcome as the number of heads, we are using @ numeri cal value to deseribe the outcome, In this sense, we ean look at « numerical parameter (our models as if it were a random variable. Our thtee-outeome table is thus the probabil- ity distribution for the random variable “number of heads.” ‘When we can convenienily fist the possible outcomes of « random variable or ide tify them with integers, as in the coin-tossing example, we refer to the random variable, and the probability distribution, as diserete. We can describe a discrete probability distri- bution (or, more simply. a discrete distribution) with # table like the one in our example: a list of outcomes together with a list of corresponding probabilities, Since the outcoms are mutually exclusive and exhaustive, the probabilities must sum to 1. Conceptually, we use a discrete distribution when we are describing a quantity that involves measurement by counting, such as the number of heads or the number of customess or the number of defects. A discrete distribution might not be suitable, however, if we were ‘measuring a time interval or the length of an object. When we deal in intervals, especially sshere fractions o? any size are possible, we refer to the random variable, and its probability dlistribucion, as continuons, In such a case, we describe a continuous probability distribution (or, more simply, « continuous distribution) not with a table but rather, with a function—one thal we might depict in a graph. The function gives the relative likelihood of various out- comes, and, conceptually, there could be an infinite number of outcomes. V'or example, how long will it take to drive to the airport? The graph of the function labeled fia) ia Figure A2 shows « continuous distsiburtion for the length of the airport ip. Tn the graph, x-values for ‘which the function is high are more likely to occur than x-values for which the function is low. In addition, the probability that the length of the trip will Hic between two values a and { corresponds to the area under the curve between x = a and x = b, as shown in the figure. ce probabilities correspond to areas, the area under the entire funetion must be equal t0 | What if we were dealing with an event that hats a vast number of discrete: outcome ‘Suppose we want to model the number of light bulbs that will be sold in our hardware chain next month. Although we could use a discrete distribution and enumerate the individual possibilities for sales quantity, the list of outcomes could fe unmmageably long, It would be more convenient to use a continuous approach, ignoring the fact that fractions are not possible (because we carinot sell a fraction of a light bulb). Thus, the graph resembling Figure A.2 could represent a continuous distribution used as a madel for light bulb sales. Alternatively, we might describe the outcomes with ranges of values. We might clas- sify next year’s sakes into three outcome ranges: sales below 50,000, sales between 50,000 ‘and 100,000, and sales between 100,000 and 150,000. One way to simplify the ranges is to substitute their midpoints as a single outcome representing the entire range. Thus, the FIGURE A.2 Probability Distribution forTime to Airport FIGURE A.3 Probability Distribution for Sales PROBABILITY OISTAIBUTIONS 375 first outcome would be sales of 25,000; the second outcome, sales of 75.000; and the third ‘outcome, sales of 125,000, Figure A.3 shows a distribution for these events in which the probability of sales in either the middle or high range is twice thal of sulex in the low range. This is a discrete distribution with three distinet outcomes and three corresponding probabilitics. For some purposes, this model would be a sutficient representation of the possibilities for next year’s sales, even though it involves a good deal of simplification These two examples show that phenomena in the real world are not intrinsically dis- ‘erete or continuous. Rather, we can choose to use discrete or coutiquous models to repre sent those phenomens. The choice sometimes comes down to what is convenient for modeling purposes and what is plausible for the user. ‘A frequency distribution, or histogram, is a commonly encountered chart that shows how members of a population are distributed according to some criterion. Figure A.4 shows how grades are distributed in a certain class of 100 students. Note that the bars depict the number of students whose grades fall in the given ranges (for example, from 85 to 89). To construct a histogram in Excel, we can use the Histogram function in the Data Analysis tools. We select Tools—+Data Analysis and then select Histogram from the win- dow of options presented. The Histogram tool draws on two types of information: one is an array of raw data: the other is the set of “bins” defining the columns of the histogram, For example, suppose that we have the scores for the 100 students entered in cells B20:K29 and that we list the upper lintt for cach of the bins in column A of the first work. sheet. (The entries in column B are simply used as labels for the x-axis of the chavt.) Then, wwe can invoke the Histogram function in order to produce the result in Figure A.4, where we have edited the charts format. 376 APrENOIXA BASIC PROBABILITY CO’ FIGURE A.a A Histogram for Student Grades. cist imaalex. Koh POD Ses Dh adnieuanane. aah PEPECECe if This histogram can also he interpreted as a probability distribution. For exanmple, the chances are 21/100 = 0.21 that a randomly selected student's grade will fall in the range 81-85. Similarly, by adding up the heights of the relevant bars, we can determine that the chances are 52 percent that a randomly selected student's grace will fall between 66 and 80, EXAMPLES OF DISCRETE DISTRIBUTIONS. Although we can specify any discrete distribution by constructing a table of outcomes and probabilities. as we did for the coin-toxsing example, there are some specific distributions that correspond to particular real-world phenomena. For example, the Poisson distribu- tion descrihes a random variable that counts the oecurtences of random events. In partic- ular, suppose we wish to know the number of tines our computer system will break down next week. The possible outcomes are the numbers 0, 1, 2... , and so on. If we know that breakdowns occur at an average rate of 2 per day, chen the number that oveurs next ‘week (seven days) can be modeled as following a Poisson distribution with a mean of 1. We need only one purameter—the mean value—to specify a Poisson distribution, Another example is the binomial distribution, which describes « random variable ‘that counts the mumber of successful outcomes in a series of nm independent experiments (rials), each with a success probability of p. The possible outcomes are the numbers 0, 1, 2,....m, Suppose we are counting the umber of defective chips in a production batch of = 100. (As is often the case in quality control, we can represent a defective as a “'sue- cess) If we know that there is a S percent chance than an individual chip is defective, then the number of detectives in the batch can be modeled as following a binomial distr bution with parameters m= 100 and p= 0.05. We need two parameters—the number of ti als and the success rate—to specify a hinomial clstriby A third example is the geometric distribution, which describes a random variable thal counts the number of experiments needed tw generate the first success, ina series of inde: pendent experiments like the one we described above, each with a success probability of p. EXAMPLES OF CONTINUOUS DSIRIEUTIONS 377 “The possible outcomes are the numbers 1, 2, 3, . .. and so on, without an upper limit, Suppose we are counting the number of days until our computer system will break down, (Here, a “success” is a breakdown.) If we know thet there is an 80 percent chance that there will be a breakdown on a given day, then the number of days until a breakdown occurs can be modeled as following a geometrie distribution with parameter p= 0.8. EXAMPLES OF CONTINUOUS DISTRIBUTIONS FIGURE A.5 A Uniform Distribution Three continuous probability distributions are particularly useful in modeling uncertainty in business situations: the uniform, triangular, and normal distributions. There are many ‘more types of distributions, but these three provide us with a zoo deal of flexibility in eap- turing the kind of variability we usually encounter in decision problems. The uniform dis- tribution describes an outcome that is equally likely to fall anywhere between a prescribed minimum and a preserited maximum. It is pasticularly appropriate when we can make reasonable guess about the smallest and largest possible outcomes but have mo reason to suspect that any values in belween are more likely than others. The triangular distribu- tion describes an outcome that has a minimum and maximum valve but is most likely (0 ‘occur af an intermediate point. The triangular distribution is more flexible than the uniform because it can have a pesk anywhere in its range. It is well suited to situations where we can identify a most fikely outcome as well as the smallest and largest possible outcomes, Finally, the normal distribution describes an outcome that is most likely to be in the mid dle of the distribution, with progressively smaller likelihoods as we move away from its most likely value. This distribution, which is familiar to many analysts, can deseribe a sym- ‘metrical uncertain quantity using only two parameters (the mean and standard deviation). The uniform distribution is often the first distribution we use when prototyping, model, because itis so easy to specify, requiring only a minimum and maximum value Figure A.S shows a uniform distribution whose outcomes lie between $0 and 150. The mean for a uniform distribution is midway between the minimum and maximum values (100 in this case), The eritical property that defines the unifiorin distribution is that every ‘outcome between the minimum and the maximumn is equally likely. Often, this is a near sonable assumption, especially when fist resting the effects of uncertainty in a model and when no data or other information are available to suggest cilfrent likelihoods, A somewhat more flexible tamily of continuous distributions is the triangular, These distributions are specified by thee parameters: the minimum, maximum, and most likely values. Figure A.6 shows a triangular distribution from 50 to 150 with « most kely value of 125. Nove that the mean of this distribution is not 100 but somewhat higher, because val- tues above 100 are more likely than those below it. The mican of a triangular distribution is always one-third the sum of the minimum, maximum snd most likely values (108.3 in this case.) Triangular distributions are particularly useful for representing subjective uncertainty, Very few managers ean specify offhand a probability distribution for an uncertain quanti but most can give reasonable estimates for the minimum, maximum, and most likely values. The normal distribution is a symmetrical distribution specified by its mean and standard Zoom com. mand can be used to increase or decrease the mumber of cells displayed. Increasing the Zour setting, which decreases the number of cells displayed, makes cach displayed cell larger and easier to read. For example, when Zoom is set to 100 percent, a typical config- uration, such as the one in Figure B.1, might show 22 rows and 11 columns, or a total of 242 cells, Set Zoom to 75 percent, and 450 cells are displayed: 30 rows by 15 columns, Set Zoom to 150 pervent, and 98 cells are displayed: 14 rows by 7 columns. EDITING CELLS 389. The Window command makes it possible to simultaneously display more than one spreadsheet on the screen. These sheets may be from the seme workbook or from diffes~ cent workbooks. This command! can be particularly useful when we are building formulas in a second sheet using cells located in the first. Select Window—sNew Window to add a spreadsheet window; then select Window—- Arrange to display multiple windows side-by- side or in some other fashion, Excel provides an option to display two sets of rows or columns in the same spread: sheet. If, for example, we wish to enter formulas in row 100 that reference cells in rows 1-10, we can select the Window Split box that lies just above the row scroll har on the right side of the spreadsheet, If we click and druy this box down ten rows, Excel will open a second pune of ross with its own scroll bar, splitting the window horizontally. We can then display row 100 in the lower pane while displaying rows 110 in the upper pane. The ‘window can also be split vertically, using, a Window Split box that lies just to the right of the column scroll bar. The window can even be split both horizontally and vertically. SELECTING CELLS _ EDITING CELLS ‘There are many ways to select some or all of the cells in a spreadsheet. Here are the essentials: Selecting all cells: Click on the box immediately to the left of column A andl above row 1. Selecting a column or a row: Click on a single row label or coluaun label (for example, A or 1). To select several adjacent columns or rows, click an the first Tabel and drag. the cursor to the last Selecting rectangular ranges: Any rectangular range of cells cun be selected by selecting any one of its four corner cells und dragging the cursor across to the diagonal comer. The same effect can be achieved by selecting a conier, dragging across the row to the opposite comer and then to the diagenal comer, or vice versa. Selecting noncontiguous ranges: ‘To select two distinct rectangles of cells, select the first range, hold down the Control key, and select the second rar ‘There are several wuys to cdit the information in cells. Here are the most useful alternatives: Formula bar: The simplest way is to click on the Formula bar. A vertical cur- sor will appear in the Formula bar, and formiulas eam be entered or modified using all the normal Windows typing options. If the selected cell is not empty, its contents will appear in the Formula bar. Clicking on the text there will make the editing cursor appear. Double-click: A handy altemative approach is to double-click on a cell, of, equivalently, to press the F2 key. This allows editing in the cell itself. Ifthe selected cell is not empty, any eclls referred to in the formula will be bigh- lighted in color, a useful debugging device. We can then enter modifications by placing the cursor and typing directly into the cell or by moving the vertical ‘cursor to the forrnula bar und typing there. Alternatively, we can alter any cell reference in a formula by dragging the highlighted outline to another location. This option provides a visual device for editing, which is convenient when the formula is based on distinctive reference patterns, 390. ArrENDIXH EXCEL IGOLS HOH MODELING ENTERING TEXT AND DATA FORMATTING Equals tool: Yet another handy device is to click on the Equals tool (the icon immediately to the left of the Formula bar) during formula editing. ‘This will ‘open a window in which the formula will be explained briefly and evaluated, thus providing helpful feedback on whether the formula being entered is giving the expected results, In addition, «list of most recently used fimetions is avail- able from the pull-down menu at the triangle to the left of te Equals too Function Wizard: An alternative for editing a formula is the Function Wizard (the f, icon on the Standard toolbar). If we click on this wizard when the cursor is om a cell that does not contain a function, it will bring up the Paste Function ‘window, which lists all available functions. Ifa specific function is then selected, it will be entered into the formula, and its own window will appear, ‘which facilitates entering the inputs properly. If we click on this wizard when the cursor is on a cell that already contains a function, it will bring up the eor- responding funetion window, allowing the definition of the function to be veri fied or the arguments of the function to be revised, Absolute and rekative cell references: These are useful primarily to make copying of complex formulas easy and reliable, Rether than typing in the appro- Priate dollar signs, it can be easier to enter all addresses in relative form (with. ‘oul dollar signs), highlight one or more addresses, and then press F'4 repeatedly until the desired combination of absolute and relative addresses appears. ‘To copy a formula from one cell to adjacent cells, first enter the formula, and then either use the Fill handle and drag the formula to adjacent cells, or else use Fulit>Fill sRight (or Edit-9Fill Down). We often need to enter a series of mumbers or dates. Examples include the numbers of successive customers (1, 2, 3, 4, ...) or suevessive quarters in a year (QI, Q2,Q3, . Excel provides alternative ways (o enter these series quickly. ‘The Edit-sFill-»Series con rmand will enter various kinds of series. The same effect can be accomplished hy enteri the frst two cell entries, highlighting them, and copying to the rest of the range using the Fill handle, Hxcel can usually guess the pattern correctly. For example, enter 1 and 2 in one column, Highlight the two cells. Copy down to the next eight eells using the Fill handle, and the remainder of the series (3, 4.5.6. 7, 8,9, 10) will appear, To enter the numbers between 10 and 50 in steps of 5, enter 10 and 15 in adjacent cells and fil down until 50 is reached We can change individual column widths and row heights by moving the vertical or hor- izontal lines between the column and row labels. Widths or heights of multiple colurnns ‘or rows can be set using the Format—sRow (or Column) command. Any range of cells can be formatted by selecting the range and then selecting FormatCells. This opens a window with the following six tabs: Number: Choose a type of formatting—for example, Currency or Date—and. specify paramerers such as the number of decimal places displayed. Alignment: Align text horizontally and vertically, and choose Wrap Text to fit long text labels into cells. Font: Specify font, size, color, and superseript or subscript for the cell contents. Border: Set various borders around a range of cells, NAMING CELLS WIZARDS warps 391 Patterns: Set a background pallem or a color shade for the cell (not its contents), Protection: .ock or hice cells for safety. Many of these options are also available on the Formatting toolbar. ‘The most fre quently uscd tools are Increase Decimal and Decrease Decimal, which change the number ‘of decimals displayed in selected cells by one decimal place each time they are clicked, Tndividual cells and ranges of cells can be given names, and these names can be used in formulas to make them more readable, This approach to model building is highly recomi- mended in corporate settings for models that are used by many people over many years However, for the solo modeler, itis an open question whether the additional complexity of range names justifies their us ‘The simplest way to define a range name for a single cell is to place the cursor on that cell and noe that the address of the cell appears in the Name box abave column A. Click in the Name box and enter the name of the cell there. To define several range names it is more convenient to access the Define Name win- dow by selecting Inscrt—>Name—sDefine. This window makes it possible to enter range ames and their cell addresses (in the Refers to: box). Names can be entered for single cells, consccutive cells in a row, consecutive cells in a column, or rectangular ranges. Enter a name for the range, and it will appear in the Name box, where clicking on it will highlight the named range in the spreadsheet, Likewise, selecting the named range will highlight its name in the Name box. Press F3 and all the named ranges will appear in the Paste Name box. Two of the many wizards in Excel are particularly useful for modelers: the Function Wizard and the Chart Wizard. The Function Wizard (the f, icon on the Standard toolbar) brings up list ofall functions in Fxcel, including those in add-ins such 2s Crystal Bull or Solver. Select one of the functions, and a window opens that displays the syntax of the function (which inpots need to be eatered and in what order), as well as the results of th formula when sufficient inputs are entered. ‘The Chart Wizard is the standard means of creating graphs. First select the data to be ‘charted, and then select Chart Wizard from the Standard toolbar. The Chart Wizard con- tains four steps in which a chart is designed. Each step contains tabs to visit, and each tab ‘contains design options to select. Progress along the four step design path is controlled by the Next and Back options available at each step, until the Finish is reuched. To use the samc four-step path in editing an existing chart, selcet the chart and click on the Chart Wizard icon. This will open the window from the first step of chart design. At each step, the open window will display the design choices that were mace in the construction of the ing chart, for possible revision. Develop state-of-the-art modeling skills Successful business modeling is much more thon a technical disciplines its an art. And asin most professional disciplines, you can tell the experts apart from the novices by the creativity they bring to the craft, Now with Steve Powell and Ken Baker's Tite Art of Modeling with Spreadsheets, you cai master the technical knowledge as well as those ‘essential crait skills needed to develop real expertise in business modeling. You'll learn: + Effective niethods for designing, building, ane testing models. and for pertorming model-based analyses; ¢ Non- technical. craft skills that expert modelers commonly employ, such as abstracting a situation, debugging a model, and translating model results into managerial insights; and + Standard statistical and! management science techniques used in business today, such as data analysis, simulation. and optimization. Get the tools of the trade! ‘The CD-ROM packaged with this text features all Of the spreadsheets referred to in the ext, as well as three software tools of special importance to business analysts: © Premium Solver © Crystal Ball # Sensitivity Toolkit (Featuring four sensitivity tools) AEG www.wiley.com/college/powell

Você também pode gostar