01 Lab Week1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Fundamentals of

Computational Intelligence
COMP8802

Laboratory Week 1
Schedule
Week Week Material Book Week Week Material Book
Beginning Beginning
1 February 27 An Introduction to Computer Level 1 Mid-Sem Break
Science - Algorithms & History
Mid-Sem Break
7 April 24 Computational Models Level 4 & 5
2 March 6 Algorithms continued Level 1
3 No Lecture Monday Public Holiday
8 May 01 Artificial Intelligence / Ethics Level 5 & 6
4 March 20 The Building Blocks / Computer Level 2 9 May 08 Databases / Data Analysis
Organization
Level 5

5 March 27 Languages / Compiler / Python 10 May 15 Networking / Security Level 3


Level 3 & 4
6 April 03 Python continued 11 May 22 Graphics / Human-Machine Level 5
Interaction

Mid-Sem Break 12 May 29 Guest Lectures: Applications at Level 5


Flinders University 1

Mid-Sem Break 13 June 05 Guest Lectures: Applications at Level 5


Flinders University 2
Assessment
• 2 Tests => hurdle task
• 3 Quizzes (in addition to unmarked weekly quizzes for practice)
• Test python
• Multimedia presentation on research topic
=> hurdle task
• Groups of up to 6 students
• Poster + Video production
• Literature review
Assessment - Schedule
Week Week Material Assessments Due Week Week Material Assessments Due
Beginning Beginning
1 February Computer Science Mid-Sem Break
27 Algorithms
History Mid-Sem Break
2 March 6 Algorithms cont. 7 April 24 Computational Models Practical test (Python)
8 May 01 Artificial Intelligence
No Lecture
9 May 08 Databases / Data Analysis
4 March 20 Building Blocks /
Computer
Organization 10 May 15 Networking / Security / Ethics Quiz 2
5 March 27 Compiler / Quiz 1
11 May 22 Graphics / Human-Machine Multimedia
Languages /
Interaction / Applications at Flinders Assignment
Python
University 1
6 April 03 Python continued Midterm test
12 May 29 Guest Lectures: Applications at Quiz 3
Mid-Sem Break Flinders University 2

Mid-Sem Break 13 June 05 Guest Lectures: Applications at Final Test


Flinders University 3
Information Portal
• Canvas

• Lecture slides
• Lecture recording
• Contact information
• Contact times
• Announcements
• Assignments
• …
Canvas Orientation

• Live
Learning Objectives
• Understand the definition of computer science

• Understand the definition of the term algorithm


• Write down everyday algorithms
• Determine if an algorithm is ambiguous or not effectively computable

• Understand the roots of modern computer science in mathematics and


mechanical machines
• Summarize the key points in the historical development of modern
electronic computers
Group Exercise
• Identify which type of algorithmic operation each one of the
following steps belongs to:
Group Exercise
• Get a value for x from the user.

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Group Exercise
• Get a value for x from the user.

• Sequential operations
• Carries out a single well-defined task
Group Exercise
• Test to determine if x is positive. If not, tell the user that he
or she has made a mistake.

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Group Exercise
• Test to determine if x is positive. If not, tell the user that he
or she has made a mistake.

• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
Group Exercise
• Take the cube root of x.

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Group Exercise
• Take the cube root of x.

• Sequential operations
• Carries out a single well-defined task
Group Exercise
• Do Steps 1.1, 1.2, and 1.3 x times.

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Group Exercise
• Do Steps 1.1, 1.2, and 1.3 x times.

• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Group Exercise - Multiplication
• One way to do multiplication is by repeated addition.
• For example, 47 × 25 can be evaluated as
47 + 47 + 47 + … + 47 (25 times).

• Sketch out an algorithm for multiplying two positive numbers


a and b using this technique
• Identify which type of algorithmic operation each one of the
following steps belongs to:
• Explain how it meets all of the criteria for algorithms presented.
Multiplication by Addition
a= 47
b= 25

Step 0. set c to 0
Step 1. set i to 0
Step 2. while (i < b) repeat instructions in steps 3-4
Step 3. add a to c
Step 4. add 1 to I
Step 5. print out c
Step 6. stop
Multiplication by Addition
Step 0. set c to 0

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 0. set c to 0

• Sequential operations
• Carries out a single well-defined task
Multiplication by Addition
Step 1. set i to 0

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 1. set i to 0

• Sequential operations
• Carries out a single well-defined task
Multiplication by Addition
Step 2. while (i < b) repeat instructions in steps 3-4

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 2. while (i < b) repeat instructions in steps 3-4

• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 3. add a to c

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 3. add a to c

• Sequential operations
• Carries out a single well-defined task
Multiplication by Addition
Step 4. add 1 to i

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 4. add 1 to i

• Sequential operations
• Carries out a single well-defined task
Multiplication by Addition
Step 5. print out c

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 5. print out c

• Sequential operations
• Carries out a single well-defined task
Multiplication by Addition
Step 6. stop

• Sequential operations
• Carries out a single well-defined task
• Conditional operations
• Ask a question and the next operation is then selected on the basis of the
answer to that question
• Iterative operations
• Looping instructions that tell not to go on but go back and repeat the
execution of a previous block of instructions
Multiplication by Addition
Step 6. stop

• Sequential operations
• Carries out a single well-defined task
Group Exercise - Multiplication
• One way to do multiplication is by repeated addition.
• For example, 47 × 25 can be evaluated as
47 + 47 + 47 + … + 47 (25 times).

• Sketch out an algorithm for multiplying two positive numbers


a and b using this technique
• Identify which type of algorithmic operation each one of the following
steps belongs to:
• Explain how it meets all of the criteria for algorithms presented.
Criteria to meet Formal Definition of an
Algorithm
Step 0. set c to 0 • A well-ordered collection of
Step 1. set i to 0
• unambiguous and
Step 2. while (i < b) repeat
instructions in steps 3-4 • effectively computable operations that,
Step 3. add a to c
Step 4. add 1 to I • when executed, produces a result and
Step 6. Print out c halts in a finite amount of time.
Step 5. stop
Individual Exercise / Homework
• Explore the Canvas page
• Do the Academic Integrity Quiz on Canvas / FLO

• Do the quiz for week-1 on Canvas


• Do the lessons of the Turtle Academy
https://turtleacademy.com/lessons

You might also like