100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Computer Science 144 4.1 summary

Rating
-
Sold
-
Pages
4
Uploaded on
27-09-2023
Written in
2023/2024

Detailed summary of Chapter 4.1 - performance in Python for CS144 at Stellenbosch University. All you need to study from Chapter 4.1 for the A1.









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Summarized whole book?
No
Which chapters are summarized?
Chapter 4.1 - performance
Uploaded on
September 27, 2023
Number of pages
4
Written in
2023/2024
Type
Summary

Subjects

Content preview

Chapter 4.1 PERFORMANCE:
Mantra for this chapter: Pay attention to the cost
We apply mathematical analysis to derive concise models of the cost - the experiments we
design must be reproducible and falsifiable
How are the experiments done? We can simply run a program on various inputs, measuring
the amount of time to process each input.
Observations:
1. is a problem size that characterizes the difficulty of the computational task.
Normally, the problem size is either the size of the input or the value of a command-
line argument. Intuitively, the running time should increase with the problem size –
interested in how much it increases by.
2. Running time is relatively insensitive to the input itself; it depends primarily on the
problem size
Proper analysis involves:
- Detailed understanding of the program
- Detailed understanding of the system and the computer
- Advanced tools of mathematical analysis
Doubling hypothesis -> What is the effect on the running time of doubling the size of the
input?
Mathematical analysis:
the total running time is determined by two primary factors:
- The cost of executing each statement (property of the system)
- The frequency of execution of each statement (property of the algorithm)
We write ~f(n) to represent any quantity that, when divided by f(n), approaches 1 as n
grows. We also write g(n) ~ f(n) to indicate that g(n)/f(n) approaches 1 as n grows.
We focus on the instructions that are executed most frequently = inner loop
For many programs: the running time satisfies the relationship T(n) ~ cf(n) where c is a
constant and f(n) is a function known as the order of growth of the running time = simple
but powerful model of running time. With these approximations, the particular machine
that you are using does not play a significant role in the models—the analysis separates the
algorithm from the system (algorithm determines the order of growth)
R70,00
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
jaidendutoit

Document also available in package deal

Thumbnail
Package deal
Computer Science 144 A1 summarized content
-
4 2023
R 280,00 More info

Get to know the seller

Seller avatar
jaidendutoit Stellenbosch University
View profile
Follow You need to be logged in order to follow users or courses
Sold
5
Member since
2 year
Number of followers
2
Documents
14
Last sold
1 year ago

0,0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions