Talk:High School Mathematics Extensions/Mathematical Programming

(flattened this thread. Use horizontal rules between threads.) -- r3m0t 23:56, 7 Dec 2003 (UTC)

I'm glad you liked HSE so much! I'm trying my best to do a good job, but as so often is the case in my first drafts, glaring spelling and grammar mistakes seem to plague my work. Lucky you pick them out for me.

I do not know enough about Lisp, Prolog, Scheme (never heard of it) or Haskell to decide whether they are suitable for high school students or not. If you think a coherent course can be taught using one of those languages, then please go ahead! Create a new chapte if you have to. But I was thinking of teaching a more conventional language like Pascal. Anyway we are not just writing about programming, but mathematical programming. Haskell seems to be a good choice, but where can I find a good programming IDE/compiler for it? I simply haven't done the research.

And nice to meet you. How do you do?Xiaodai


 * Just being a stickybeak, but
 * If you want Haskell, the Glasgow Haskell Compiler is an excellent Windows/*nix based Haskell interpreter and compiler environment. Some systems may only run the Hugs system. I'm about to go to bed so I can't give you an exact link but I'm sure you can google it :)
 * Haskell is a good choice of language for pure, functional programming. It's not quite the best language for exploring mathematical concepts in since it's a strict functional programming language. You may want to concentrate on looking at programming in common Computer Algebra systems such as Maple and Mathematica (I do know both systems, but Mathematica's better) for stuff like numerical approximations and all that funky jazz. Haskell is nice for exploring recursion, but more conventional looping structures are easier taught in some other language. With teaching Mathematica (You guys should still have it at Sydney, right?) you get the best of both worlds, really.
 * HTH :) Dysprosia 11:59, 7 Dec 2003 (UTC)


 * Think free. Learn free. is the Wikibooks concept, but Mathematica seems to be a commercial thing. I wouldn't encourage people to use a propriety language on Wikibooks. Wikipedia: Lisp programming language Scheme programming language Haskell programming language Maple computer algebra system Mathematica Maxima Computer algebra system r3m0t 19:58, 7 Dec 2003 (UTC)


 * It doesn't mean we can't teach non-free software, at all. And it's not exactly proprietary software either - it's well used. I merely mention this to Xiaodai as an option. In any case, are we to forbid the creation of a Windows guidebook here because it is non-free software? We cannot be bigoted on the forbidding of teaching just because of its origins now, can we? Dysprosia 21:43, 7 Dec 2003 (UTC)


 * A Windows guidebook would be created for users of Windows who wish to (manipulate/configure/whatever) their installation. By teaching Mathematica in a textbook not created specifically for teaching Mathematica, that is encouraging people to use Mathematica. Lisp, Scheme, Ruby, Haskell seem different to me - it is hard to make any money out of them (plenty of compilers or interpreters are free already) so it's offering a choice of compiler, etc. r3m0t 21:55, 7 Dec 2003 (UTC)


 * That's fine, and I understand where you're coming from. However to simply restrict our choice of teaching tool because the product is commercial is not a necessarily good thing - Lisp, Scheme, Ruby and Haskell are fine programming languages, but they are just that -- programming languages. Haskell and other functional programming languages have mathematical groundings, but we aren't teaching lambda-calculus, we're teaching how to obtain numerical solutions to things. For this, Haskell and its ilk are not suited for this and an imperative language is better suited. Dysprosia 22:59, 7 Dec 2003 (UTC)

I think it's best not to use any commercial software, most high school students do not have access to them. The ideal choice would be something like Free Pascal, C++ or Java (something platform independent). Xiaodai


 * If you want to go down that path, C's your best choice. But to properly teach good C and not just C's nuts and bolts of C you really have to get into the details. I wouldn't suggest OO languages because it's just not necessary. Dysprosia 11:47, 8 Dec 2003 (UTC)


 * Agree 100%. Still think Pascal is a good choice though -- my first love. Let this be undecided until we decide to start writing it. Xiaodai


 * Pascal...not so sure on this one. I'll think of this some more, too. Dysprosia 12:24, 8 Dec 2003 (UTC)


 * We can't decide to start writing it until we decide what programming language to use! I think C is pretty complicated, with all the #includes and things before the code bulk. I prefer Scheme (simplified Lisp) because I can just type stuff in the top frame and execute it in the bottom. I could also type straight into the bottom. (I'm talking about DrScheme, which runs on Windows 95+, Mac OS Classic or X, and Linux). MzScheme, the core of DrScheme, can be run seperately. r3m0t 12:40, 8 Dec 2003 (UTC)


 * Okay, we know you like Scheme! :) C's not too complicated, really. It can be rote-taught. If one is trying to learn C proper it can be a bit more difficult.
 * The reason why I don't think Scheme is best here is because it's a functional programming language and is simply not best suited for performing certain tasks which this chapter will probably aim to try and tackle.
 * If you want to teach Scheme, why not start at Computer programming and start a new chapter? Dysprosia 12:48, 8 Dec 2003 (UTC)


 * I have no love for teaching any programming language proper, I don't think that's the way to learn programming. We will go into the practical aspects head first. And for that reason, I want to find a language with as few boiler-plates as possible. For C, we will only need #include and so I don't think that's a problem. As for Scheme, I haven't tried it yet(soon will). This is still a pretty much undecided matter.


 * On an aside note, I have soon come to realize that someone learning C by "osmosis", so to speak, means that they will only produce inefficient, buggy, and just plain bad code. Garbage in, garbage out, they say!... For reasons why this is so, I could write a short book, but anyway, that's beside the point :)
 * I was thinking we could teach GNU Maxima (I think the syntax is like Maple's), but I have no experience in Maxima whatsoever, yet I do with Maple, Mathematica and C.

R3m0t, you should wait till we have some sort of consensus on which language we are to use before we start writing the programming section here. We work by consensus at the Wikipedia, we should do so here. Dysprosia 02:01, 14 Dec 2003 (UTC)


 * I agree with Dysprosia on this one. Xiaodai

Teach C
We shall use C as the language for this chapter. Xiaodai 05:55, 14 Jul 2004 (UTC)

Heavy editing
I will have to heavily edit the intro to programming section, because i feel it has too many things that are potentially confusing and is giving to much irrelevant information to the reader. I want a minimalist approach to this chapter, we will not be attempting to teach the user how to program properly. They can read other materials if they want to do that. We want this chapter to have a mathematical focus, rather than a computer science/computing one. Xiaodai 06:02, 14 Jul 2004 (UTC)

Pseudocode?
It seems there has been a heated debate about which programming language to use, here's my two cents: Afterall, we're teaching the method of programming to study and explore mathematical problems, right? It's the technique, the algorithm that matters, not the programming language. Maybe we can use pseudocode here. And when later we've a majority opinion on which programming language to use specificlly, we can easily convert them back. --Lemontea 10:38, 12 August 2005 (UTC)

I think I've come up with a reasonable solution to this problem. Instead of choosing any one language why not use pseudocode in the body of the text, thus providing this information in a more general context in order to demonstrate how an algorithm might be written. Then near the end of the article, or after major examples a link can be given to a page where various code snippets from a variety of languages can be submitted for users to get a more specific example of a concept in the language they are comfortable with. This seems like it would solve any disputes and create a book that is not bounded by the constraints of teaching in any one language. Tell me what you all think. --Etscrivner 8:25, 27 November 2005 (UTC)

The Programming Language
If this is for High School Students, either an appropriate first programming language should be used or we should follow the AP Computer Science Standards. http://apcentral.collegeboard.com/apc/public/repository/ap08_compsci_coursedesc.pdf

AP Computer Science exam uses Java as their Language. That should a fine first language, but if others think that something easier should be used, than I would recommend using PHP. Or better yet, why not use PHP is relation to MediaWiki. Maybe this chapter's scope should be limited to how to setup a MediaWiki using PHP, MySQL, and Apache. For a project, pick a simple extension, it could even be one that is already written or just make one up that would be fun for a student to use. It is much easier to add onto an existing code base than to write something completely from scratch. The kids can be exposed to all of the basic programming structures, but actually accoplish something tangable at the same time.

I am a Software Engineer, and C is definitely NOT a first programming language. There is no safety in C, and it is very easy to get yourself into trouble really fast. Between PHP and Java, I personally feel that PHP is easier to learn, especially when it is the foundation language for many shareware products: MediaWiki, Moodle, WordPress, etc. So my final vote for a chapter in a high school math book, as opposed to a whole textbook is PHP. Zzmonty (talk) 05:15, 1 February 2009 (UTC)

The Case for Python
OK, here's my 2 cents worth on this issue. We should pick a language which allows students to focus on the algorithms without getting too involved in the nuts and bolts of software engineering.

C: is great for teaching people how computers actually work but is a bit too "close to the machine" to be ideal for teaching people how to use computer programs to explore mathematics. Students are likely to spend too much time on pointers, memory management and compilation/linking problems. Also the need to have separate header and source files is a distraction.

Java: is great for teaching OO programming but the fact that it is so Object Oriented means that students will have to spend too long getting to grips with Objects, Classes, Inheritence, Polymorphism etc. and not enough time thinking about the algorithms.

Lisp/Prolog etc: again are great for teaching predicate calculus but are difficult to use for purely functional programming.

Python: has a simple and consise syntax and scripts can be run directly without the need for the compilation stage. There is no need to consider pointers, type conversions, memory management etc. Likewise there is no need to be distracted by OO concepts but OO concepts can be introduced if needed. Also the interactive python shell can be used directly as a sort of massively powerful and expressive calculator. Also Python has the NumPy and SciPy modules that enable you to easily do graphs, statistics, linear algebra and much much more! Also it is free (as in beer) and Open Source....for what its worth my vote goes for Python.(Russell (discuss • contribs) 10:06, 19 July 2011 (UTC))

modulus examples
5%2 is 1 as far as I know ....--Billymac00 (discuss • contribs) 02:04, 26 September 2014 (UTC)