(***********************************************************************
Mathematica-Compatible Notebook
This notebook can be used on any computer system with Mathematica 3.0,
MathReader 3.0, or any compatible application. The data for the notebook
starts with the line of stars above.
To get the notebook into a Mathematica-compatible application, do one of
the following:
* Save the data starting with the line of stars above into a file
with a name ending in .nb, then open the file inside the application;
* Copy the data starting with the line of stars above to the
clipboard, then use the Paste menu command inside the application.
Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode. Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).
NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing the
word CacheID, otherwise Mathematica-compatible applications may try to
use invalid cache data.
For more information on notebooks and Mathematica-compatible
applications, contact Wolfram Research:
web: http://www.wolfram.com
email: info@wolfram.com
phone: +1-217-398-0700 (U.S.)
Notebook reader applications are available free of charge from
Wolfram Research.
***********************************************************************)
(*CacheID: 232*)
(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[ 14459, 295]*)
(*NotebookOutlinePosition[ 15545, 330]*)
(* CellTagsIndexPosition[ 15501, 326]*)
(*WindowFrame->Normal*)
Notebook[{
Cell[CellGroupData[{
Cell[TextData["28. Review for Final"], "Title",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData["Last revision: October 13 1996"], "SmallText",
Evaluatable->False,
AspectRatioFixed->True],
Cell[CellGroupData[{
Cell[TextData["Review for Final"], "Section",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[
"There is no new material in this section; we simply list topics and \
functions with which you should be familiar, and we present ways in which you \
should tie the material together . "], "Text",
Evaluatable->False,
AspectRatioFixed->True],
Cell[CellGroupData[{
Cell[TextData["Topics"], "Subsection",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[
"Arithmetic Operations (+, -, *, /, ^, etc.)\nBoolean Operations (>, <, etc.)\
\nOperator Precedence and Associativity\nExact Values, Approximate Values\n\
Machine-Precision Integers, Machine-Precision Approximations, Bits\nData \
Types (Integer, Rational, Real, List, String, etc.)\nScientific Functions \
(Sin[ ], Cos[ ], etc.)\nPlotting (functions, lists of points)\nSource Code, \
Interpreted vs. Compiled Languages\nDefining Functions\nFormal and Acutal \
Parameters\nBottom-Up Analysis, Top-Down Analysis\nList-based Programming; \
Programming Paradigms\nIterators\nProgramming as Grammar: Nouns, Verbs, \
Adverbs\nStrings, String Functions, Special Characters in Strings\nModules, \
Organization\nLocal Variables, Side Effects, Scope, Initialization of \
Constants\nProgramming Style, Comments, Readability\nAnonymous Functions, \
Inline Functions\nData Type Checking, Pattern Matching in Arguments, \
Conditional Evaluation\nUsage Lines\nStructured Patterns for Conditional \
Evaluation\nConditional Structures\nRecursion\nDynamic Programming\nControl \
Structures: While, Do, For, with Error Handling\nShort-Circuit Evaluation\n\
Arrays: Sizes, Initialization, Modification\nFunctional Calls: \
Call-by-value, Call-by-reference\nCompilation: Speed, Data Type Checking, \
Inline Functions\nContexts, Packages, Declaring Names\nObject-Oriented \
Programming\nFiles: Directories, Opening, Reading, Writing, Checking File \
Correctness with a Flag\nThe C Language: Data Types, Function Definitions, \
Control and Conditional Structures, main(), File Access\nFits\nGraphics: \
Primitives and Directives"], "Text",
Evaluatable->False,
AspectRatioFixed->True]
}, Closed]],
Cell[CellGroupData[{
Cell[TextData["Functions"], "Subsection",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[
"Sin[ ], Cos[ ], Tan[ ], Exp[ ], Sqrt[ ], Arcsin[ ], Arccos[ ], Arctan[ ], N[ \
], Plot[ ]\nPlus[ ], Times[ ], Subtract[ ], Log[ ], Clear[ ], Expand[ ], \n\
Simplify[ ], Solve[ ], NSolve[ ], FindRoot[ ] Set[ ], Greater[ ], Less[ ], \
GreaterEqual[ ], LessEqual[ ], Equal[ ], NotEqual[ ], Not[ ], AddTo[ ], \
SubtractFrom[ ], MultiplyBy[ ], DivideBy[ ], Increment[ ], Decrement[ ], \
PreIncrement[ ], PreDecrement[ ], SetDelayed[ ], Part[ ], Random[ ], Table[ \
], Union[ ], Length[ ], Sum[ ], ListPlot[ ], Position[ ], Map[ ], Reverse[ ], \
Sort[ ], Transpose[ ], First[ ], Last[ ], Rest[ ], Partition[ ], List[ ], \
Range[ ], Take[ ], Drop[ ], Inner[ ], Outer[ ], Apply[ ], MapThread[ ], Join[ \
], Nest[ ], NestList[ ], Fold[ ], FoldList[ ], StringLength[ ], \
ToCharacterCode[ ], FromCharacterCode[ ], Characters[ ],\nStringJoin[ ], \
StringTake[ ], StringReverse[ ], StringDrop[ ], ToUpperCase[ ], TableForm[ ], \
Module[ ], With[ ], Select[ ], Trace[ ], Count[ ], RotateLeft[ ], \
RotateRight[ ], If[ ], Which[ ], Switch[ ], Dimensions[ ],\nFlatten[ ], ?, \
??, Append[ ], Prepend[ ], Intersection[ ], Complement[ ], \n<, >, <=, >=, \
==, !=, !, +=, -=, *=, /=, ++, --, ->, /., [[ ]], ; , +, -, *, / , ^, &&, \
||, \"\", []\nIntegerQ[ ], DigitQ[ ], Positive[ ], Insert[ ], UpperCaseQ[ ], \
LowerCaseQ[ ], NumberQ[ ]\nOddQ[ ], EvenQ[ ], PrimeQ[ ], MatchQ[ ] \nGCD[ ], \
Mod[ ], Quotient[ ]\nTiming[ ], Attributes[ ], Compile[ ]\n$Context, \
$ContextPath, Contexts[ ], Begin[ ], End[ ], BeginPackage[ ], EndPackage[ ]\n\
OpenRead[ ], OpenWrite[ ], Streams[ ], Read[ ], ReadList[ ], Write[ ], \
WriteList[ ], Close[ ], $Path, SetDirectory[ ], Directory[ ], FileNames[ ]\n\
Fit[ ]\nShow[ ], Graphics[ ], Polygon[ ], Circle[ ], Disk[ ],\nRectangle[ ], \
Points[ ], Text[ ], Line[ ], Dashing[ ], PlotStyle"], "Text",
Evaluatable->False,
AspectRatioFixed->True]
}, Closed]],
Cell[CellGroupData[{
Cell[TextData[{
StyleBox["Mathematica",
FontSlant->"Italic"],
" Programming Alternatives"
}], "Subsection",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[
"Repetition: List-based functions OR Recursion OR Iterative Loops\n\nArray \
handling: List-based functions for entire rows OR Iterative loops for single \
entry modification\n\nNames: Variables (\"Nouns\"), local or global OR \
Functions (\"Verbs\"), local, global, anonymous, compiled OR Parameters, \
call-by-value or call-by-reference\n\nConditional Choices: If-Then-Else, \
Which OR Pattern-matching in function definitions"], "Text",
Evaluatable->False,
AspectRatioFixed->True]
}, Closed]],
Cell[CellGroupData[{
Cell[TextData["General Programming Paradigms"], "Subsection",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[{
"You may find it useful to structure your thinking of the various topics we \
have learned around the following programming paradigms. Each is extreme in \
its own way, and typically a standard programming language will allow aspects \
of several paradigms, although rarely the full generality of a language such \
as ",
StyleBox["Mathematica",
FontSlant->"Italic"],
"."
}], "Text",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[{
"Functional programming: \n In functional programming each function is \
thought of as a \"formula\", which takes as input certain values in its \
parameters. The function, like a mathematical formula, cannot modify \
variables or parameters. Functional programs are then lists of definitions, \
together with function calls. No modifications to local or global variables \
are allowed; hence all function calls use \"call-by-value\". In fact, once a \
variable is defined with a value, it is no longer considered a modifiable \
variable but instead a defined function which always returns that value. In \
this sense values and functions are identified. In functional programming \
repetition is usually accomplished by recursion, and conditionals are \
implemented using If statements which return different values depending on \
the boolean test. At the very beginning of our course, we used \"functional \
programming\" to solve equations, plot graphs, and so on. Scheme and LISP \
are examples of functional programming languages.\n\nProcedural, Imperative, \
or Structured Programming\n Procedural programming is one of several \
names for a paradigm in which program units are thought of as little \
algorithms, or procedures, that are allowed to change the external \
environment\[LongDash]namely, global data in the form of variables---as well \
as their own internal environment\[LongDash]the local variables. Variables \
are not thought of as functions as in functional programming but instead are \
identified with memory locations, which may be changed, while procedures are \
compiled into machine code for execution and are not typically changed during \
execution. Procedures are allowed to use call-by-value or \
call-by-reference, since references to memory locations are allowed. \
Repetition is usually accomplished by iteration, say with a\nWhile construct, \
although recursion is sometimes employed; conditionals are implemented with \
If statements. C, Pascal, and Fortran are examples of procedural programming \
languages.\n\nList-based, or Array-oriented Programming\n This paradigm \
of programming could be functional or procedural in type, the difference \
being that repetition is usally accomplished by list- or array-manipulation \
procedures, say from a package, which allows the programmer to think in terms \
of processing entire arrays in one step. This sort of programming has \
advantages in parallel programming, where a programmer writes one program \
which has several computing units at its disposal and the challenge is to \
have the computing units work together to complete algorithms very quickly. \
If a package of array or list routines is developed which cleverly use the \
computing units together, the final programmer will have the advantage of \
speed without having the complexity of having to decide how to instruct each \
computing unit.\n\nLogical Programming\n In logical programming all \
program units are boolean-valued functions which return \"true\" or \
\"false\", and the program units are allowed to change the external \
environment. For conditionals, multiple definitions of one function are \
distinguished by different conditions on the arguments. Logical programming \
is uncommon but an interesting exercise in exploring the relationship between \
logic and computer science.\n\nSymbolic Programming\n Symbolic \
programming, which is the primary paradigm for ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" programming, is functional in nature, with names referring not directly \
to memory locations but to \"symbolic expressions\", which may occupy many or \
few memory locations. This distinction has been somewhat vague in our \
course, since ",
StyleBox["Mathematica",
FontSlant->"Italic"],
" performs the work of translating names which contain values into their \
particular memory locations; in C, however, the need to declare every single \
variable arises from the necessity of assigning particular memory locations \
to each variable. In symbolic programming, repetition can be accomplished \
not only by using iteration or recursion but also by employing \"repeated \
symbolic replacement\". Conditional expressions frequently use If or Switch \
constructs and can also use pattern matching.\n\nObject-Oriented Programming\n\
The paradigm of object-oriented programming, in its full form (as \
distinguished from the form we presented in the course) is primarily \
procedural but forces the programmer to bind together variables and the \
functions which will modify them into an \"object\". Thus, only certain \
functions are allowed to modify certain data, and only certain data are \
allowed to be used with certain functions; this distinction is supported by \
notions of \"public\" and \"private\" data and functions within a given \
\"object\". "
}], "Text",
Evaluatable->False,
AspectRatioFixed->True]
}, Closed]],
Cell[CellGroupData[{
Cell[TextData["Fundamental Concepts of CS"], "Subsection",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[
"What have we learned? What would you learn in the next computer science \
course? Here are a list of general concepts commonly covered in the \
introductory two- or three-course computer science sequence, with indications \
of which we've seen. The list is taken from \"A Revised Model Curriculum for \
a Liberal Arts Degree in Computer Science\", a panel of SIGCSE, the special \
interest group on computer science education of the ACM."], "Text",
Evaluatable->False,
AspectRatioFixed->True],
Cell[TextData[
"Algorithms and algorithmic problem-solving: YES.\nProblem-solving \
paradigms: procedural, object-oriented, functional, with examples: YES.\n\
Control structures, recursion, and iteration: YES.\nClassical algorithms: \
sorting, searching, and pattern-matching: NO. (We haven't written algorithms \
to do any of these algorithms.)\nTime and space analysis: SOME. (We've \
touched on the trade-offs.)\nConcepts of modularity, decomposition, \
procedural and data abstraction, program libraries: YES.\nFormal \
specification of abstract data types: NO. (We've seen lists and so on, but \
haven't discussed how to specify them.)\nMajor data structures (arrays, \
records, stacks, queues, lists, simple trees) and examples of their use: NO. \
(We've seen only arrays and lists.)\nSoftware development, including program \
specifications, design, coding, debugging, testing, verification, and \
documentation: SOME. (We've touched on several of these topics.)\nBrief \
introduction to internal representation of data: YES. (We've talked about \
machine-precision integers and approximate numbers, although further study \
would be\ndesirable.)\nSocial issues: intellectual property, liability, \
privacy, ethical behavior, access: NO."], "Text",
Evaluatable->False,
AspectRatioFixed->True]
}, Closed]]
}, Open ]]
}, Open ]]
},
FrontEndVersion->"Macintosh 3.0",
ScreenRectangle->{{0, 832}, {0, 604}},
WindowToolbars->{},
WindowSize->{520, 509},
WindowMargins->{{Automatic, 140}, {Automatic, 16}},
PrintingCopies->1,
PrintingPageRange->{1, Automatic},
PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}},
ShowCellLabel->True,
ShowCellTags->False,
RenderingOptions->{"ObjectDithering"->True,
"RasterDithering"->False},
MacintoshSystemPageSetup->"\<\
00<0004/0B`000003809T?o>old"
]
(***********************************************************************
Cached data follows. If you edit this Notebook file directly, not using
Mathematica, you must remove the line containing CacheID at the top of
the file. The cache data will then be recreated when you save this file
from within Mathematica.
***********************************************************************)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[1731, 51, 95, 2, 98, "Title",
Evaluatable->False],
Cell[1829, 55, 110, 2, 26, "SmallText",
Evaluatable->False],
Cell[CellGroupData[{
Cell[1964, 61, 93, 2, 50, "Section",
Evaluatable->False],
Cell[2060, 65, 261, 5, 46, "Text",
Evaluatable->False],
Cell[CellGroupData[{
Cell[2346, 74, 86, 2, 46, "Subsection",
Evaluatable->False],
Cell[2435, 78, 1688, 24, 622, "Text",
Evaluatable->False]
}, Closed]],
Cell[CellGroupData[{
Cell[4160, 107, 89, 2, 30, "Subsection",
Evaluatable->False],
Cell[4252, 111, 1879, 26, 298, "Text",
Evaluatable->False]
}, Closed]],
Cell[CellGroupData[{
Cell[6168, 142, 163, 6, 30, "Subsection",
Evaluatable->False],
Cell[6334, 150, 506, 8, 116, "Text",
Evaluatable->False]
}, Closed]],
Cell[CellGroupData[{
Cell[6877, 163, 109, 2, 30, "Subsection",
Evaluatable->False],
Cell[6989, 167, 457, 11, 51, "Text",
Evaluatable->False],
Cell[7449, 180, 4984, 72, 688, "Text",
Evaluatable->False]
}, Closed]],
Cell[CellGroupData[{
Cell[12470, 257, 106, 2, 30, "Subsection",
Evaluatable->False],
Cell[12579, 261, 516, 8, 64, "Text",
Evaluatable->False],
Cell[13098, 271, 1321, 19, 220, "Text",
Evaluatable->False]
}, Closed]]
}, Open ]]
}, Open ]]
}
]
*)
(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)