Lec01 Introduction
Lec01 Introduction
Fundamentals in Python
Lecture 1
Introduction to Algorithms
Images at http://bloggertowordpresstestblog.blogspot.com.au/2009/11/michael-hansmeyer-solids-at-smallspace.html:
COMMONWEALTH OF AUSTRALIA
Copyright Regulations 1969
WARNING
This material has been reproduced and communicated to you by or on behalf of Monash University pursuant to Part VB of the Copyright Act 1968 (the Act).The material in this communication may be
subject to copyright under the Act.Any further reproduction or communication of this material by you may be the subject of copyright protection under the Act. 1
Do not remove this notice.
What’s this unit about
Algorithms
Sequence of instructions to solve problem
Will cover variety of algorithms for different problems
Unit Objectives
Learn to develop and reason about algorithms
Be able to program them in Python
Start to understand the limitations of algorithms
2
Transferrable skills from this unit
“Hard” skills
• Python programming
• Algorithm design and analysis
“Soft” skills
• Teamwork (workshops and tutorials)
• Planning (assignments, workshops)
• Communication (workshops and tutorials)
Overall
• Problem solving…
3
Computer Science enables people to do
amazing things
Annie Easley;
Computer scientist, Mathematician, Rocket scientist with NASA for ~32 years
Helped develop the Centaur rocket system (got Cassini to Saturn!)
(left)
Ramanathan V. Guha;
Computer scientist, creator of RSS, worked on Google’s custom
search and adwords
(left)
Donald Knuth;
Computer scientist, mathematician, author. Developed the TeX
typesetting system, and wrote the widely read “The Art of
Computer Programming” (Turing award worthy)
(right)
Satoshi Nakamoto;
Computer scientist/cryptographer. Developer of the bitcoin; ???
(left) 4
…by improving their thinking
“This knowledge [on algorithms] […] is a general-purpose mental
tool that will be a definite aid to the understanding of other subjects,
whether they be chemistry, linguistics, or music, etc. The reason for this
[…]: It has often been said that a person does not really understand
something until after teaching it to someone else. Actually, a person
does not really understand something until after teaching it to
a computer, i.e., expressing it as an algorithm...”
Donald Knuth
5
Requires investment of time and
attention
Contact hours
Lectures (2h per week)
Tutorials (2h)
Workshops (2h)
Optional: Coding for insufficient recommended hardcore
Beginners (2h)
6
Recommended literature
Levitin, A. (2012) Introduction to the
Design and Analysis of Algorithms (3rd
Edition) Pearson
7
Where am I?
1. Introduction to unit
2. Unit structure and assessment
3. Getting help
4. What are algorithms
8
Staff
Mario Boley (Chief Examiner, Clayton and
Malaysia, and Lecturer, Clayton)
[email protected]
[email protected]
9
Conventional Lectures
http://www.pedagogygeek.com/category/uncategorized/
10
Quiz time
1. Visit https://flux.qa
2. Log in (your Authcate details)
11
Quiz time
1. Visit https://flux.qa
2. Log in (your Authcate details)
3. Touch the + symbol
4. Enter your audience code
◦ Clayton 1pm, 2pm: GISNZ3
◦ Clayton 4pm, 6pm: ZWE2WD
◦ Malaysia: 4SZI61
5. Answer questions
12
Assessment
In-semester Marks (max of 60%)
Assignment Part 1 (10%)
Assignment Part 2 (12%)
Workshops (19%)
Tutorial Preparation (8%)
In-tutorial test 1 (3%)
In-tutorial test 2 (8%)
14
Assessment:
Workshops (max 16% and 3%)
All about programming practice with Python
◦ Active learning
◦ Preparation for assignments
16
Assessment:
Tutorial preparation (max 8%)
Every tutorial from week 2 onwards contains a preparation
question (weeks 2-12)
◦ Tutorial prep n must be posted in the Moodle forum of your
tutorial by midnight on Tuesday of week n
17
Assessment:
In-semester tests (3%, 8%)
2x in-semester tests
In week 4, and week 9, on Moodle
Timed test, ~30 minutes duration
Covers content taught in first 3 and 8 weeks
respectively
Designed to give you a feeling for exam-style
questions
18
Assessment:
Final Exam (40%) (2 hours)
During Exam period
Extensions
Compelling and exceptional reasons only (must be unforeseeable
circumstances) via special consideration request
Send to [email protected] with supporting
documentations BEFORE deadline
Don’t stop working!
20
Quiz time
1. Visit https://flux.qa
2. Log in (your Authcate details)
3. Touch the + symbol
4. Enter your audience code
◦ Clayton 1pm, 2pm: GISNZ3
◦ Clayton 4pm, 6pm: ZWE2WD
◦ Malaysia: 4SZI61
5. Answer questions
21
Hurdles (see Unit Guide)
To pass this unit a student must obtain:
◦ 45% or more in the unit's examination, and
◦ 45% or more in the unit's total non-examination assessment, and
◦ an overall unit mark of 50% or more.
If a student does not pass these hurdles then a mark of
no greater than 45-NH will be recorded for the unit.
22
Week Lecture a Lecture b Assessment
1 Introduction to Algorithms Introduction to Python
2 Functions and Selection While-loops and Workshops due from
Sequences week 2-11 (excluding 7)
3 For-loops and Sequences Tables and Matrices
24
Help is Available
We want to help you succeed!
• Lecturer
• Tutors
• Consultations
• Coding for Beginners Workshop
• Moodle forums
• PASS
25
PARTICIPATE & ACHIEVE BETTER RESULTS
PEER-ASSISTED STUDY
SESSIONS (PASS)
§ Available for FIT1045
§ Receive support and mentoring from a senior
student successful in this unit
§ Weekly study sessions to keep you up-to-date
§ Learnthrough samples, teamwork, and group
study games
§ Fine-tune study skills
§ Make new friends
50%
40%
0%
N P C D HD
29
Disability Support Services
Do you have a disability, medical or mental health
condition that may impact on your study?
Disability Support Services provides a range of services for registered
students including:
§ Note takers and Auslan interpreters
§ Readings in alternative formats
§ Adaptive equipment and software
§ Alternative arrangements for exam and class tests
30
Special consideration
If something beyond your control is
affecting your performance on
assessment we might be able to do
something for you!
Please send requests with documentation
to the role account:
[email protected]
See special consideration policy
(https://www.monash.edu/exams/changes/
special-consideration)
31
Cheating, Collusion, Plagiarism
Cheating: Seeking to obtain an unfair advantage in an
examination or in other written or practical work
required to be submitted or completed for assessment.
http://infotech.monash.edu.au/resources/student/assignments/policies.html
32
Cheating, Collusion, Plagiarism
MOSS
http://lightonphiri.org/wp-content/uploads/2015/09/moss_sample-initial_result-masked-
021.png
33
Where am I?
1. Introduction to unit
2. Unit structure and assessment
3. Getting help
4. What are algorithms
Learning outcomes:
1, translate between problem descriptions and program
design with appropriate input/output representations
34
Image at: vindelz.wordpress.com/2009/11/algorismi1.jpg
What is an Algorithm?
Question: what is 653+274?
1 1 al-Khwarizmi
653 653 653 653 (c. 780 – 850)
Instructions:
write given numbers on top of each other
for each column:
find result digit for column
“carry over” potential overflow
35
Definition
[Levitin, p3]
“An algorithm is a sequence of instructions for solving a
problem.”
36
Definition
[Levitin, p3]
“An algorithm is a sequence of instructions for solving a
problem, i.e., for obtaining a required output for any
legitimate input in a finite amount of time.”
37
Quiz time
1. Visit https://flux.qa
2. Log in (your Authcate details)
3. Touch the + symbol
4. Enter your audience code
◦ Clayton 1pm, 2pm: GISNZ3
◦ Clayton 4pm, 6pm: ZWE2WD
◦ Malaysia: 4SZI61
5. Answer questions
38
But what is a problem?
A computational problem is a typically infinite collection of
questions (called inputs or instance), each of which has at least
one correct associated answer (called output).
Example: Addition
17+4 is an input (question) of the comp. problem Addition
The output (answer) to this instance is 21
(17, 4) 12
(43, 57) 100
inputs (0, 12) 21
problem outputs
(instances) (37294, 364026) 401320
… solves …
algorithm
executes
(17, 4) 12
(43, 57) 100
inputs (0, 12) 21
problem outputs
(instances) (37294, 364026) 401320
… solves …
algorithm
executes
What is an Algorithm?
Problem: 1203 + 98 = ?
al-Khwarizmi
1203 (c. 780 – 850)
98
Instructions:
write given numbers on top of each other
for each column:
find result digit for column
“carry over” potential overflow
41
Image at: vindelz.wordpress.com/2009/11/algorismi1.jpg
What is an Algorithm?
Problem: 1203 + 98 = ?
al-Khwarizmi
1203 1203 (c. 780 – 850)
98 98
1
Instructions:
write given numbers on top of each other (right-aligned)
for each column:
find result digit for column
“carry over” potential overflow
42
Image at: vindelz.wordpress.com/2009/11/algorismi1.jpg
What is an Algorithm?
Problem: 1203 + 98 = ?
1 al-Khwarizmi
1203 1203 (c. 780 – 850)
98 98 Instructions need
1 to be definite
Instructions:
write given numbers on top of each other (right-aligned)
for each column (from right to left):
find result digit for column
“carry over” potential overflow
43
Image at: vindelz.wordpress.com/2009/11/algorismi1.jpg
What is an Algorithm?
Problem: 1203 + 98 = ?
1 al-Khwarizmi
1203 1203 “computer” needs (c. 780 – 850)
98 98 to be able to
1 effectively carry
out instruction
Instructions:
write given numbers on top of each other (right-aligned)
for each column (from right to left):
find result digit for column
“carry over” potential overflow
44
Quiz time
1. Visit https://flux.qa
2. Log in (your Authcate details)
3. Touch the + symbol
4. Enter your audience code
◦ Clayton 1pm, 2pm: GISNZ3
◦ Clayton 4pm, 6pm: ZWE2WD
◦ Malaysia: 4SZI61
5. Answer questions
45
Definition
[Levitin, p3]
“An algorithm is a sequence of unambiguous instructions
for solving a problem, i.e., for obtaining a required output for
any legitimate input in a finite amount of time.”
46
Example: Greatest Common Divisor
18 3
=
24 4
gcd(18, 24) = 6
47
Example: Robbing a Museum
49
Before Next Lecture
Log onto the FIT1045/53 Moodle site
50