# What math textbooks are "CS-friendly": criteria?

206 messages
1234 ... 11
Open this post in threaded view
|

## What math textbooks are "CS-friendly": criteria?

 As some readers know, I'm more likely tohang out with computer scientists than math teachers, though I used to be a high schoolmath teacher.  For example, with me tonightwas Steve Holden, not a PhD but with lotsof letters after his name if he wants to usethem all, and PB, of Portland Energy Strategies.[1] So my question for them was this:  I don'tget to look at many K-12 textbooks thesedays, mathematics or any other.  Lets limit it to the place / stratum where the concept of "function" is introduced.  Is that still done, formally?  And if it is, what textbooks give examples of functions with non-numeric domains?For example, a function upper() might take'a' to 'A', 'b' to 'B' and so on.  It operates on a non-numeric type, a character, in some "alphabet" with defined lower and uppercase.Or a function might add "s" to a word:addS("word") -> "words".  Do we ever see that in mathematics textbooks?Because such functions, with a string typeinput, would be what I'd call "computer sciencefriendly" whereas a textbooks that always / onlyuses numeric types for input and output would be what I'd call "CS-hostile" and/or "CS-unaware".So now I'm thinking of a list of titles, textbooksfor 8th and 9th grade, and I'm asking which ofthese introduce non-numeric examples when introducing the concept of "function" -- which inmy day was contrasted with "relation".  A function might be injective, bijective or surjectivebut the New Math era texts I was exposed to had different terms for those as I recall, but I don't recall what they were just now, not important to this thread.So, to pose the question again:  of all commercialmath textbooks that introduce "function" as a formal concept, what percentage of those include examples of function that are not operations on numbers?For example + might mean "concatenation" where strings are concerned:  "a" + "b" == "ab" in the domain -> range of strings.  In such a world, + is not commutative in that "a" + "b" isnot equal to "b" + "a".  [2]Which textbooks mention that "+" (addition) has meaning relative to the "type" that it works with?  Any?Mark those as CS-friendly.KirbyPS:  wish us luck as Portland has its first publicteacher strike in its history.  That's set to commence on Thursday, barring any breakthroughs.
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In the above essay, posted last night to math-teach / Math Forum, I ask the question:  what K-12 math textbooks might be considered the most computer science friendly? http://mathforum.org/kb/thread.jspa?threadID=2620194That brings up the question of what criteria to apply, andthe example I give is:  introduces the concept of "function" with some examples that include operating with strings(characters) or other non-numeric inputs.One hallmark of CS is its algorithms are often only "semi-numeric" i.e. numbers enter into it, but so do other types of object.  Tradebooks like 'Godel, Escher, Bach' make itclear that mathematics is not strictly confined to "numbers"where concepts such as "function" are concerned. I'm imagining a listing of mathematics textbook titles with several columns of criteria, either with a check oran X, measuring how friendly this textbook's way ofteaching mathematics is to computer science, meaning it provides smooth segues, jumping off points, topics,for going back and forth between them etc.  What else?Another criterion:  programming and programming languages are at least mentioned, perhaps only in a side bar.  Actually using a programming language wouldbe another column.  And so on.I'd say there are three levels of sophistication we walk students through in early mathematics learning:(a)  arithmetic:  operations with numbers(b)  early algebra:  letters standing in for numbers (c)  later algebra:  the letters may stand for things besides numbers Obvious examples of "things besides numbers" that we do operations on:  vectors and matrices.  But these are still numericin nature.  A more developed (c) introduces "string type operations" i.e. operations on strings.  No, not the strings of string theory but the strings as alphanumeric symbols, characters, ideograms,anything Unicode. Reversing a string, for example. Or returningTrue or False depending on the presence of some character or even "pattern" in a string.  These  would be "CS-friendly" examples of "operations" and/or "functions" to include in a mathematics textbook.New Math (1960s) introduced set operations in the early grades (union, intersection) and sets typically had non-numericelements, perhaps pictures.  You could intersect "things considered fruits" with "things considered vegetables" for example, and maybe get a "tomato".  That's getting more towards (c):  algorithms that are only semi-numeric or evennon-numeric.  I think textbooks should be studied for how deeply they get into (c)-level awareness.  Showing how binary operators such as "+" change meaning depending on "the type of operand" and using "concatenation" (of strings) as an example, would be an unusually CS-friendly topic for a high school mathematics text in 2014, don't you think?  Most early 21st century K-12 mathematics textbooks seemed peculiarly "CS-unaware" (or am I misguided in that assessment?).Kirby
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 On Feb 19, 2014, at 10:34 PM, kirby urner <[hidden email]> wrote: > A more developed (c) introduces "string type operations" Mathematical functions are mappings and have inverses. Most subroutines in CS, especially string manipulating subroutines, are not “mappings” or “functions” and cannot be reversed. Subroutines are a totally different animal. You would have to first thoroughly teach what a mathematical function is (in mathematics), then what a subroutine is in CS, and then discuss subroutines that model mathematical functions. In short, you cannot gain an appreciation for mathematical functions by studying subroutines, unless those subroutines are strictly mathematical. Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 On Wed, Feb 19, 2014 at 7:51 PM, Robert Hansen wrote: On Feb 19, 2014, at 10:34 PM, kirby urner <[hidden email]> wrote: > A more developed (c) introduces "string type operations" Mathematical functions are mappings and have inverses. Most subroutines in CS, especially string manipulating subroutines, are not “mappings” or “functions” and cannot be reversed. Subroutines are a totally different animal. You would have to first thoroughly teach what a mathematical function is (in mathematics), then what a subroutine is in CS, and then discuss subroutines that model mathematical functions. I didn't mention "subroutine" anywhere.  I don't think it's necessary to dig up old fossil vocabulary in order to be CS friendly.  Students can unearth the meanings of such terms on their own time. I'm talking about formal mathematics and the formal definition of a function as a set of domain and co-domain (image)  pairs, i.e. a "mapping" as you say, of (x, f(x)) tuples where x need not be a number. {("a", "A"), ("b","B"),("c","C")} is a subset of the function {s: upper(s) -> s'} where the domain (s) and range (s') are both "the letters of the alphabet".  This function has an inverse (reverse all the pairs) but this isn't an essential / necessary quality of a function in the formal mathematical sense, as taught in Algebra 1 and like that.What differentiates a function from a relation is functions can't have the same domain value paired with two or more different range values.  I'm sure you know that.  Many different domain values, all of them even, mapping to the same range value:  that's not a problem (no inverse function in that case though).   In short, you cannot gain an appreciation for mathematical functions by studying subroutines, unless those subroutines are strictly mathematical. Bob HansenI'm fine with making them "strictly mathematical", these functions, and not even using the word "subroutine" anywhere (we don't in Python, so that comes naturally to me as a teacher). However, I still think the formal / core / basic mathematical concept of "function" can be introduced in more or less CS-friendly ways.  The sooner we get away from purely numeric algorithms / functions / procedures and start processing semi-numerically, the better, in terms of weaning students off the notion that "mathematics" is purely about "number crunching".  Computer science isn't either.  Lets drive that point home in the textbooks, as we consider "best of breed" (most CS friendly).Kirby
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 On Feb 19, 2014, at 11:15 PM, kirby urner <[hidden email]> wrote: > I didn't mention "subroutine" anywhere. Of course you didn’t. That would have made the distinction between “procedure” and “function”. On Feb 19, 2014, at 11:15 PM, kirby urner <[hidden email]> wrote: > The sooner we get away from purely numeric algorithms / functions / procedures and start processing semi-numerically, the better, in terms of weaning students off the notion that "mathematics" is purely about "number crunching”. Now you are applying “subroutine” to mathematics. The mathematical notion of “function” IS mathematics. It is like gravity, always there. The very reason that a child can even learn to add is because of the notion of function. Without it, there would be no determinism. Computers are procedural and that has its place as well. What you are proposing here isn’t teaching mathematics through programming. It is not teaching mathematics at all, just programming. And knowing hundreds of programmers and the prevalence of mathematical topics in their high school and college careers, I don’t see teaching programming without mathematics even capable of producing decent programmers. Just the prevalence of math love in programmers should be enough of a clue that mathematical endeavor just for the sake of mathematical endeavor is highly important to programming. You seem to have this idea of replacing mathematical endeavor (school mathematics) with programming, but without a reason. Since all of us programmers are doing so well WITH mathematics under our belt as well as programming, what is it that you think you will gain by removing mathematics from the curriculum? Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by kirby urner-4 On Feb 19, 2014, at 11:15 PM, kirby urner <[hidden email]> wrote: > I'm fine with making them "strictly mathematical", these functions, and not even using the word "subroutine" anywhere (we don't in Python, so that comes naturally to me as a teacher). And how are you going to teach them to program without understanding subroutines and procedure? That would be worse than trying to teach them music without rhythm or tempo. And it isn’t the word, it is the notion. Programming involves subroutines and math involves functions. You need to spend some time un-fuzzing these two domains (mathematics and programming). Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by kirby urner-4 On Feb 19, 2014, at 11:15 PM, kirby urner <[hidden email]> wrote: > and not even using the word "subroutine" anywhere (we don't in Python, so that comes naturally to me as a teacher). You realize that just because you call it a “function” it is still a subroutine, just with a different label. If I show my son an apple and say “peach” over and over, I don’t make apples into peaches. You get this, right? If I say “subroutine” or you say “function”, we are still talking about the same procedural piece of code and not a mathematical function. Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by Robert Hansen On Wed, Feb 19, 2014 at 8:43 PM, Robert Hansen wrote: << SNIP >>  What you are proposing here isn’t teaching mathematics through programming. It is not teaching mathematics at all, just programming. And knowing hundreds of programmers and the prevalence of mathematical topics in their high school and college careers, I don’t see teaching programming without mathematics even capable of producing decent programmers. Just the prevalence of math love in programmers should be enough of a clue that mathematical endeavor just for the sake of mathematical endeavor is highly important to programming. You seem to be in denial that upper-casing a letter is an example of a function in a formal mathematical sense, all talk of computers and programming aside.  Those are separate columns on my check list (whether programming is mentioned, or a language even used). Here, I'm simply asking if functions are ever non-numeric in the examples (I'm ranking textbooks).  It says a lot about the mindset of the authors if the answer is "no".  You seem to have this idea of replacing mathematical endeavor (school mathematics) with programming, but without a reason. Since all of us programmers are doing so well WITH mathematics under our belt as well as programming, what is it that you think you will gain by removing mathematics from the curriculum? Bob Hansen I'm sorry you have it all wired up in such a tangle and I hope as you gain in experience you gradually overcome these hobbling perspectives, or cultural baggage or whatever it is. A function might map pebbles on a beach to balloons in a circus, it doesn't matter.  We get to isomorphism versus "lossy" or homeomorphic functions later (some functions "lose dimensions" cast shadows whereas others "encrypt" with full-restore capability (they're reversible)). In Mathematica-based curricula, it's quite normal to introduce a JPEG picture file as an argument to a function, defined as formally and mathematically as you like, and what you get is perhaps a grayscale version of the photo.  Some algorithm was applied, not difficult to describe.  It's a function, not a "subroutine".  It's a mapping.  It's also CS-friendly to think in this way, but then we'd expect that from Wolfram. Kirby
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by Robert Hansen On Wed, Feb 19, 2014 at 9:11 PM, Robert Hansen wrote: On Feb 19, 2014, at 11:15 PM, kirby urner <[hidden email]> wrote: > and not even using the word "subroutine" anywhere (we don't in Python, so that comes naturally to me as a teacher). You realize that just because you call it a “function” it is still a subroutine, just with a different label. If I show my son an apple and say “peach” over and over, I don’t make apples into peaches. You get this, right? If I say “subroutine” or you say “function”, we are still talking about the same procedural piece of code and not a mathematical function. Bob Hansen I write:  def f(x):  return x * x  # multipy x by itselfwhereas a textbook has something like:  {f: x-> x*x} or whatever notation (lots of variants). Console conversation:>>> def f(x):  return x * x>>> domain = [1, 2, 3, 4, 5]>>> map(f, domain)>>> list(map(f, domain)) [1, 4, 9, 16, 25]You say:  "oh no no, "def f(x):  return x * x" is just a 'subroutine' no matter what *you* call it whereas '{f: x-> x*x} or whatever notation' is really math and never the twain shall meet or mix? Is that what you're saying?  Doesn't seem that coherent.  I'd just say "it's the same idea either way but in one case we have machine executability and in the other case we do it in our heads only, or maybe with pencil and paper or... drum role, we end up 'programming' it".   Programming:  that's just following an algorithm, by a machine or human who cares?  People have called that "mathematics" since Al Khwarizmi (or in his case "al jabr").  To "program" is to "work an algorithm".  They already call them "the arithmetic algorithms" what we teach in (a) (see above) e.g. the "long division algorithm"-- and that's CS-friendly by the way. We've always followed "programs", we just didn't call it that way (except in theater, with its "programmes", and in church).Kirby
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 On Feb 20, 2014, at 12:50 AM, kirby urner <[hidden email]> wrote: > I write:  def f(x):  return x * x  # multipy x by itself > > whereas a textbook has something like:  {f: x-> x*x} or whatever notation (lots of variants). > > ... > > You say:  "oh no no, "def f(x):  return x * x" is just a 'subroutine' no matter what *you* call it whereas '{f: x-> x*x} or whatever notation' is really math and never the twain shall meet or mix? > > Is that what you're saying? I am saying that a “program” is not the same as a mathematical “function". Just because programming uses similar notation means nothing. Rather than comparing boxes based on what is written on their outside, you should open the boxes and look inside. If you look inside the box labeled “def f(x)” you are going to find a very different set of pieces than you will find in the box labeled “f(x)”. The pieces in the former are used to create iPhone apps while the pieces in the later are used to create calculus. > I'd just say "it's the same idea either way but in one case we have machine executability and in the other case we do it in our heads only, or maybe with pencil and paper or... drum role, we end up 'programming' it”. Algorithm and procedure are just a facet of mathematics, unlike in programming where algorithm and procedure are the whole point. Think of mathematics as a long running drama with many characters and plots. And then think of programming as a successful spinoff from that drama, based on a couple of its interesting characters, developing their story into something much larger than just the subplot it was in the original drama. Algorithm and procedure were certainly born in mathematics but when they went off to become “programming” they pretty much started their own history at that point. Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by kirby urner-4 R Hansen says: >The mathematical notion of ?function? IS mathematics. It is like gravity, always there. The very reason that a child can even learn to add is because of the notion of function. Without it, there would be no determinism. I'm not sure exactly what you are trying to say here but the typical way functions are treated in math today has not always been around, like gravity. http://en.wikipedia.org/wiki/History_of_the_function_concepthttp://www.maa.org/sites/default/files/pdf/upload_library/22/Polya/07468342.di020738.02p00875.pdfAll this refinement was hardly needed before children could learn to add. I assume you mean the concept of a function as a set of ordered pairs. (And what are ordered pairs? They have their own history and niggling problems!) I agree that it should be distinguished form the concepts of step-by-step execution of algorithms, procedures, etc., in short calculation, computation, symbol crunching. One of the problems with CS terminology is it doesn't tend to make the very subtle distinctions that can be found in math, and its terms are very often parochial or provincial. Even within CS its good to have a way to speak of the expected correspondence between inputs and outputs (more or less the function) and the procedures by which such answers are computed, which can be vastly different in complexity and efficiency, if they can be carried out at all.   Nevertheless, Kirby seems preoccupied with injecting into the math curricula manipulations on symbols that are not to be interpreted as numbers. That would seem to be entirely appropriate if one is trying to teach the set theoretic meaning of "function", (which does not depend on the notion of "number",) as long as one is careful to distinguish the set of ordered pairs (or bubbles and arrows if you prefer) from any computational actions. Here Kirby seems perfectly willing, or perhaps eager, to muddy the waters. I would say he even goes off the charts when he wants to include the CS notion of operator overloading into his notion of "function". (I'll say in Kirby's defense that even Keith Devlin seems so deeply bothered by inert sets of ordered pairs that he invents "process" [his word] that are the real function, and he is not the first mathematician to be drawn to that way of thinking.) I think the "set of ordered pairs" concept will be around for a long time. The conflations that Kirby wants to attach to it will not take root, and people will enjoy for a long time the delicious ironies of "non-computable functions" and the like. Cheers, Joe N
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by Joe Niederberger Joe N says: >Even within CS its good to have a way to speak of the expected correspondence between inputs and outputs (more or less the function) and the procedures by which such answers are computed, which can be vastly different in complexity and efficiency, if they can be carried out at all. Oops! I meant to say its good to be able to *distinguish between* the abstracted correspondence per-se (or set of ordered pairs in set parlance) and any procedures used to produce values given an argument. The correspondence is one thing, the procedure, if any, another. Without that crucial distinction we can't even speak in general of different algorithms that calculate the *same* function, such as different algorithms for multiplying integers. Cheers, Joe N
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by Joe Niederberger On Thu, Feb 20, 2014 at 7:04 AM, Joe Niederberger wrote: << SNIP >>  I think the "set of ordered pairs" concept will be around for a long time. The conflations that Kirby wants to attach to it will not take root, and people will enjoy for a long time the delicious ironies of "non-computable functions" and the like. Cheers, Joe N Thanks for all the culturally literate allusions e.g. to Devlin's "process" nomenclature.Coming from a Wittgensteinian background (I was a philo major, not a CS major, not a math major, at Princeton (where we call these "areas of concentration")), I think in terms of "rule-following" where a "rule" could be anything from a "natural law" to a "human law" to anything interpretable as rule-following (such as the act of reading). Some functions come pre-packaged, as it were, with an explicit rule that gives information over and above simply a set of ordered pairs.  Thanks to the rule, you know how to "generate" ordered pairs yourself, by "following" that rule (assuming you are able to decipher / interpret the rule as presented -- there may be no "machine" in this picture except you). When you talk about me conflating different notions of function, I think you're suggesting my pro-CS bias causes me to see all functions as computable i.e. rule-following, and hence your waving of the flag for "non-computable functions" and what not. But you may remember from earlier discussions that I'm somewhat pro-Penrose in accepting our "non-computational problem solving ability" as a human trait (corresponding to what I might call "high MQ") something we (some of us) hope will be emergent in our "machine learning" ala the movie 'Her' (she's replacing HAL in the popular mindset).[1] Re my "pro CS" bias: I'm very much in favor of replacing tiny / cramped calculator surfaces with more colorful and mentally enriching surfaces, am amazed how the decades fly by as living standards stay so stagnantly low in the average math classroom. I tend to agree with William Bennett that our current education system is as if a hostile enemy power had us in its grip and were trying to make us a true idiocracy.  In that, the enemy hath largely succeeded.  Taxpayers whine and complain how expensive education is, but "the gummint" seem to have a *lot* of money left over for V2s er cruise missiles.  Am I implying "the enemy" has a Nazi-like mindset?  That's for some other thread perhaps.[2] Kirby[1] http://www.imdb.com/title/tt1798709[2] http://mathforum.org/kb/thread.jspa?threadID=2618955
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by Joe Niederberger On Feb 20, 2014, at 10:04 AM, Joe Niederberger <[hidden email]> wrote: > R Hansen says: >> The mathematical notion of ?function? IS mathematics. It is like gravity, always there. The very reason that a child can even learn to add is because of the notion of function. Without it, there would be no determinism. > > I'm not sure exactly what you are trying to say here but the typical way functions are treated in math today has not always been around, like gravity. > > http://en.wikipedia.org/wiki/History_of_the_function_concept> http://www.maa.org/sites/default/files/pdf/upload_library/22/Polya/07468342.di020738.02p00875.pdf> > All this refinement was hardly needed before children could learn to add. I didn’t mean the formal notion of function. My point is that some essences, like functions and gravity, are so prevalent and intrinsic to their particular domain that when we operate in that domain, we cannot but become acutely and intuitively aware of these essences, whether we formally recognize them or not. For example, one does not require a formal understanding of gravity to have a very good intuitive understanding of gravity. The reason being is that gravity is everywhere and affects everything. Our thoughts and experiences are shaped by gravity whether we understand gravity or not. Likewise, everything we attempt to do in mathematics, starting all the way back at the beginning with counting, is based on mapping numbers in a particular, repeatable and deterministic way. Even though we don’t call this “mapping essence" out till later (high school algebra) it is always there, part and purpose of every step, and always shaping our intuition. Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

 In reply to this post by kirby urner-4 On Feb 20, 2014, at 10:33 AM, kirby urner <[hidden email]> wrote: > What I'm suggesting is we can / should rank high school mathematics textbooks according to how well they prepare a student to "think like a computer scientist".  High school math is about preparing people for many walks of life. That’s simple. All of the rigorous honors books. That is the common thread you will find with top notch programmers and computer scientists. Most of them love math. I have been interviewing candidates for 10 years and you learn which subjects they cherish. But that isn’t what you want to know because you could have easily just went to Google, Facebook, Microsoft, Apple etc and asked real programmers and computer scientists what courses they cherished. Your approach to math education reform is like every other reformer’s approach. Q: When have you ever seen a study devoted to high achieving mathematics students as a means to understand how math education really works? A: Never That is because math education reform is not about how math education works. It's about other agendas. Bob Hansen
Open this post in threaded view
|

## Re: What math textbooks are "CS-friendly": criteria?

Open this post in threaded view
|