0% found this document useful (0 votes)
26 views

1 Intro

This class provides an introduction to computer programming in C++ for mathematicians, covering basic syntax, compiling, debugging, and design. It aims to familiarize students with programming concepts to transfer to other languages and gain hands-on experience with an external project, while noting that one class alone cannot make one an expert programmer.

Uploaded by

ashodhiya14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

1 Intro

This class provides an introduction to computer programming in C++ for mathematicians, covering basic syntax, compiling, debugging, and design. It aims to familiarize students with programming concepts to transfer to other languages and gain hands-on experience with an external project, while noting that one class alone cannot make one an expert programmer.

Uploaded by

ashodhiya14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

MAT 685: C++

for Mathemati-
cians

John Perry

What this class


is about

Computer
programming MAT 685: C++ for Mathematicians
Words I
shouldn’t have Introduction
to say

Summary

John Perry

University of Southern Mississippi

Spring 2017
MAT 685: C++
for Mathemati-
cians
Outline
John Perry

What this class


is about

Computer
programming
1 What this class is about
Words I
shouldn’t have
to say

Summary
2 Computer programming

3 Words I shouldn’t have to say

4 Summary
MAT 685: C++
for Mathemati-
cians
Outline
John Perry

What this class


is about

Computer
programming
1 What this class is about
Words I
shouldn’t have
to say

Summary
2 Computer programming

3 Words I shouldn’t have to say

4 Summary
MAT 685: C++
for Mathemati-
cians
Description
John Perry

What this class


is about

Computer
programming

Words I
shouldn’t have
Mathematically-centered introduction to computer
to say programming for mathematicians
Summary
MAT 685: C++
for Mathemati-
cians
Description
John Perry

What this class


is about

Computer
programming

Words I
shouldn’t have
Mathematically-centered introduction to computer
to say programming for mathematicians
Summary
• introduction: there is a huge world beyond this
• mathematically-centered, as opposed to computer
science-centered
• focus on numbers, computation — not strings, I/O
MAT 685: C++
for Mathemati-
cians
Outline
John Perry

What this class


is about

Computer
programming
1 What this class is about
Words I
shouldn’t have
to say

Summary
2 Computer programming

3 Words I shouldn’t have to say

4 Summary
MAT 685: C++
for Mathemati-
cians
Desired outcomes
John Perry

What this class


is about

Computer
programming

Words I
1 Familiarity with programming
shouldn’t have
to say
• transferability to other languages
Summary 2 Experience with C++
• basic syntax
• preprocessing, compiling, linking, debugging
• “gcc toolchain”
3 Introduction to design
4 Hands-on experience with external project
MAT 685: C++
for Mathemati-
cians
Required caveats
John Perry

What this class


is about
Programming like writing proofs
Computer • one class is not enough
programming

Words I
• breaking task into pieces
shouldn’t have
to say • solving difficult problems
Summary • somewhat steep learning curve
• generalizing and creating abstractions
• advanced problems require advanced techniques
• cannot learn without doing and struggling
MAT 685: C++
for Mathemati-
cians
Required caveats
John Perry

What this class


is about
Programming like writing proofs
Computer • one class is not enough
programming

Words I
• breaking task into pieces
shouldn’t have
to say • solving difficult problems
Summary • somewhat steep learning curve
• generalizing and creating abstractions
• advanced problems require advanced techniques
• cannot learn without doing and struggling

The point
One course will not make you an expert programmer. In fact, it
will not even make you a particularly competent one. But you
will get out of this what you put into it!
MAT 685: C++
for Mathemati-
cians
For example
John Perry

What this class


I’ve been doing this for 30+ years
is about
ca. 1983 BASIC (self-study, unsuccessful)
Computer
programming ca. 1989 Pascal (university: also, advanced concepts)
Words I
shouldn’t have ca. 1991 C (self-study, internships)
to say

Summary
ca. 1999 Java (self-study)
ca. 2003 Eiffel (self-study, research)
ca. 2008 Python (self-study, research)
ca. 2013 C++ (self-study, research)
MAT 685: C++
for Mathemati-
cians
For example
John Perry

What this class


I’ve been doing this for 30+ years
is about
ca. 1983 BASIC (self-study, unsuccessful)
Computer
programming ca. 1989 Pascal (university: also, advanced concepts)
Words I
shouldn’t have ca. 1991 C (self-study, internships)
to say

Summary
ca. 1999 Java (self-study)
ca. 2003 Eiffel (self-study, research)
ca. 2008 Python (self-study, research)
ca. 2013 C++ (self-study, research)

The point
• requires self-study
• understanding concepts make self-study possible
• you will probably need this in the future
MAT 685: C++
for Mathemati-
cians
Why program?
John Perry

What this class Programming bridges gap between humans, computers


is about

Computer • Control over computer


programming
• Deeper understanding of computer technology
Words I
shouldn’t have
to say

Summary
MAT 685: C++
for Mathemati-
cians
Why program?
John Perry

What this class Programming bridges gap between humans, computers


is about

Computer • Control over computer


programming
• Deeper understanding of computer technology
Words I
shouldn’t have
to say
• Computers don’t understand human languages
Summary
• Humans intuitive, poetic; computers literal,
mechanical
• Computers only understand on or off (“machine
code”)
MAT 685: C++
for Mathemati-
cians
Why program?
John Perry

What this class Programming bridges gap between humans, computers


is about

Computer • Control over computer


programming
• Deeper understanding of computer technology
Words I
shouldn’t have
to say
• Computers don’t understand human languages
Summary
• Humans intuitive, poetic; computers literal,
mechanical
• Computers only understand on or off (“machine
code”)

• (Most) humans don’t understand computer’s language


• Those that do prefer not to use it
• Mathematics literal and precise, but
(most) humans don’t understand it, either!
MAT 685: C++
for Mathemati-
cians
Programming v. “math systems”
John Perry

What this class


is about • Pros of programming
Computer
programming
• faster execution time (modulo various caveats)
Words I • more control
shouldn’t have
to say
• more flexibility
Summary (employment, ability to solve problems)
• lower cost
(most compilers free; most math systems $$$)
MAT 685: C++
for Mathemati-
cians
Programming v. “math systems”
John Perry

What this class


is about • Pros of programming
Computer
programming
• faster execution time (modulo various caveats)
Words I • more control
shouldn’t have
to say
• more flexibility
Summary (employment, ability to solve problems)
• lower cost
(most compilers free; most math systems $$$)

• Cons of programming
• longer development time
• generally inconvenient
• can be difficult to maintain/extend
MAT 685: C++
for Mathemati-
cians
Programming v. “math systems”
John Perry

What this class


is about • Pros of programming
Computer
programming
• faster execution time (modulo various caveats)
Words I • more control
shouldn’t have
to say
• more flexibility
Summary (employment, ability to solve problems)
• lower cost
(most compilers free; most math systems $$$)

• Cons of programming
• longer development time
• generally inconvenient
• can be difficult to maintain/extend

• Can often mix the two


MAT 685: C++
for Mathemati-
cians
Outline
John Perry

What this class


is about

Computer
programming
1 What this class is about
Words I
shouldn’t have
to say

Summary
2 Computer programming

3 Words I shouldn’t have to say

4 Summary
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry

Student comments, Fall 2016:


What this class
is about If a student went to his office hours
Computer
programming
for help, he would often tell
Words I students to look over something again
shouldn’t have
to say
but not take time the time to explain
Summary what he meant or what was said in the
book. Sometimes he would explain what
he meant but those were few and far
between. I would not recommend anyone
taking a class from him.
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry

Student comments, Fall 2016:


What this class
is about If a student went to his office hours
Computer
programming
for help, he would often tell
Words I students to look over something again
shouldn’t have
to say
but not take time the time to explain
Summary what he meant or what was said in the
book. Sometimes he would explain what
he meant but those were few and far
between. I would not recommend anyone
taking a class from him.

Dr. Perry is tougher than the other


professors but he teaches every thing
we will need in the future where
others donot.
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry

Student comments, Fall 2016:


What this class
is about If a student went to his office hours
Computer
programming
for help, he would often tell
Words I students to look over something again
shouldn’t have
to say
but not take time the time to explain
Summary what he meant or what was said in the
book. Sometimes he would explain what
he meant but those were few and far
between. I would not recommend anyone
taking a class from him.

Dr. Perry is tougher than the other


professors but he teaches every thing
we will need in the future where
others donot.
(guess which one was written by a math major)
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry
“High” expectations (this is grad school, after all)
What this class
is about
• read the text
Computer • do the assigned work
programming

Words I
• don’t cheat
shouldn’t have
to say • ask questions… but not “dumb” questions
Summary
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry
“High” expectations (this is grad school, after all)
What this class
is about
• read the text
Computer • do the assigned work
programming

Words I
• don’t cheat
shouldn’t have
to say • ask questions… but not “dumb” questions
Summary Objection: “There’s no such thing as a dumb question”
Oh, really?
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry
“High” expectations (this is grad school, after all)
What this class
is about
• read the text
Computer • do the assigned work
programming

Words I
• don’t cheat
shouldn’t have
to say • ask questions… but not “dumb” questions
Summary Objection: “There’s no such thing as a dumb question”
Oh, really?
• Definitions, grading information, important dates
• you can look them up (index, syllabus, final exam date)
• caveat: not dumb if I forget to define/assign/record it
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry
“High” expectations (this is grad school, after all)
What this class
is about
• read the text
Computer • do the assigned work
programming

Words I
• don’t cheat
shouldn’t have
to say • ask questions… but not “dumb” questions
Summary Objection: “There’s no such thing as a dumb question”
Oh, really?
• Definitions, grading information, important dates
• you can look them up (index, syllabus, final exam date)
• caveat: not dumb if I forget to define/assign/record it

• Any question I’ve answered 8,587,245 times already


• turn off phone, log off Facebook
• pay attention
MAT 685: C++
for Mathemati-
cians
Yes, this is a “Dr. Perry” class
John Perry
“High” expectations (this is grad school, after all)
What this class
is about
• read the text
Computer • do the assigned work
programming

Words I
• don’t cheat
shouldn’t have
to say • ask questions… but not “dumb” questions
Summary Objection: “There’s no such thing as a dumb question”
Oh, really?
• Definitions, grading information, important dates
• you can look them up (index, syllabus, final exam date)
• caveat: not dumb if I forget to define/assign/record it

• Any question I’ve answered 8,587,245 times already


• turn off phone, log off Facebook
• pay attention

• A question you could answer yourself in 5 seconds


MAT 685: C++
for Mathemati-
cians
What is not a dumb question?
John Perry

What this class


is about
Most questions!
Computer
programming • “Can you make the screen text bigger?”
Words I
shouldn’t have • “Can you go back to the previous slide?”
to say
• “Can I get a hint on this problem?”
Summary
• “What you typed isn’t working for me. Can you check what
I have?”
• “What does this error mean?”
• “Why isn’t my program working?”
(but be ready for questions from me)
• “Will you be in your office today?”
• “What’s your website again?”
MAT 685: C++
for Mathemati-
cians
On the other hand…
John Perry

What this class


is about

Computer
programming
The following comments help no one
Words I • “I don’t understand.”
shouldn’t have
to say • “This is complicated.”
Summary
• “My program isn’t working.”
• “Other classes don’t have to work so hard!”
MAT 685: C++
for Mathemati-
cians
On the other hand…
John Perry

What this class


is about

Computer
programming
The following comments help no one
Words I • “I don’t understand.”
shouldn’t have
to say • “This is complicated.”
Summary
• “My program isn’t working.”
• “Other classes don’t have to work so hard!”
Common misconceptions
• “I can’t do this.”
• “I’ll never learn.”
• “Programming’s not for me.”
MAT 685: C++
for Mathemati-
cians
Has cheating been a problem?
John Perry

What this class


is about Yes
Computer
programming
MAT 305
Words I
shouldn’t have • every one of the last 5 years, probably more
to say

Summary • at least one Honors student involved


• at least one degree denied
• half of a 2016 class was dishonest in one way or another
MAT 685: C++
for Mathemati-
cians
Has cheating been a problem?
John Perry

What this class


is about Yes
Computer
programming
MAT 305
Words I
shouldn’t have • every one of the last 5 years, probably more
to say

Summary • at least one Honors student involved


• at least one degree denied
• half of a 2016 class was dishonest in one way or another

The university now has an XF grade.


MAT 685: C++
for Mathemati-
cians
Has cheating been a problem?
John Perry

What this class


is about Yes
Computer
programming
MAT 305
Words I
shouldn’t have • every one of the last 5 years, probably more
to say

Summary • at least one Honors student involved


• at least one degree denied
• half of a 2016 class was dishonest in one way or another

The university now has an XF grade.

I am not afraid to use it.


MAT 685: C++
for Mathemati-
cians
Has cheating been a problem?
John Perry

What this class


is about Yes
Computer
programming
MAT 305
Words I
shouldn’t have • every one of the last 5 years, probably more
to say

Summary • at least one Honors student involved


• at least one degree denied
• half of a 2016 class was dishonest in one way or another

The university now has an XF grade.

I am not afraid to use it.

You have been warned.


(You are graduate students, so this won’t be a problem… right?)
MAT 685: C++
for Mathemati-
cians
“What, me cheat?”
John Perry

What this class Definitely cheating:


is about

Computer
• using someone else’s solution to the same problem
programming
• pretty much any online search
Words I
shouldn’t have
to say
• looking up a solution to a similar problem online
Summary
• adapting an online solution to a similar problem
• do not use online help sites
MAT 685: C++
for Mathemati-
cians
“What, me cheat?”
John Perry

What this class Definitely cheating:


is about

Computer
• using someone else’s solution to the same problem
programming
• pretty much any online search
Words I
shouldn’t have
to say
• looking up a solution to a similar problem online
Summary
• adapting an online solution to a similar problem
• do not use online help sites
Definitely not cheating:
• asking the professor for help
• I will help you, though it may not be fun
• reading the book
• adapting a book/class program to a similar problem
• discussing program design/implementaiton with others
• just don’t copy or have them tell you what to type
MAT 685: C++
for Mathemati-
cians
Outline
John Perry

What this class


is about

Computer
programming
1 What this class is about
Words I
shouldn’t have
to say

Summary
2 Computer programming

3 Words I shouldn’t have to say

4 Summary
MAT 685: C++
for Mathemati-
cians
Summary
John Perry

What this class


is about

Computer
programming

Words I
shouldn’t have
to say
• Class on mathematical problem solving with computers
Summary
• programming via C++
• High expectations
• hopefully not scared you out of the class

You might also like