Cumulative Frequency Note to anybody seeing this These slides are slightly different from what was used in the recitation to reflect the most accurate information Answers to students questions ID: 794051
Download The PPT/PDF document "COP 3502 Recitation 2 The sieve of Erato..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
COP 3502 Recitation 2
The sieve of Eratosthenes
Cumulative Frequency
Slide2Note to anybody seeing this
These slides are slightly different from what was used in the recitation to reflect the most accurate information
Slide3Answers to students’ questions
Can I wait until the end of Week 4 to submit the lab program for Week 1?
No – If you choose to submit Week 1’s lab program, it’s due this Friday
Can I leave recitation early if I want to work on the program elsewhere?
No
Is there lab next week for Monday recitation people due to Labor day?
All labs next week are cancelled
If I got the okay from Dr. ___ to attend a different lab section than the one I signed up for on
myUCF
, what do I need to do?
Just sign the attendance sheet for the lab section you’re attending
Slide4Answers to students’ questions
Do I submit the lab program on
webcourses
? When is it due?
Yes. Friday.
Can I use the
isPrime
() function from C’s math library?
No
If I use an algorithm other than the Sieve of Eratosthenes, is that okay?
Yes, but it might be too slow.
Can I work on the lab program with a person in different lab section?
No, only people in your same lab section. See Dr.
Guha
or Dr.
Szumlanski
if you want to change lab sections.
Slide5Announcements
Lab
programs
located at http
://www.cs.ucf.edu/courses/cop3502/fall2015/lab
/
Attend your assigned lab section
Why? Keep lab sections balanced.
Need professor’s approval to switch sections
TA office hours have been published
Slide6Lab Program Details
Work in pairs or individually – need laptop
Exactly 2 programs / semester
If you submit this week’s program
Due date: this Friday
Put both partners’ names in header comment
Submit separately
Slide7Lab Program – Prime Sums!
Prime numbers: 2, 3, 5, 7, 11, 13, …
n
P(n)
1
2
2
2 + 3 = 5
3
2
+ 3 + 5 = 10
4
2 + 3 + 5 + 7 = 17
5
2 + 3 + 5 + 7 +
11 = 28
Slide8Review of malloc
and free
int
numPrimes
= 10000;
i
nt
*
myArray
=
malloc
(
sizeof
(
int
) *
numPrimes
);
…
free(
myArray
);
Slide9The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Note: Code this up yourself. Don’t
look it up.
Slide10The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide11The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide12The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide13The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide14The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide15The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide16The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
Slide17The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
Slide18The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
Slide19The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
Slide20The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
Slide21The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
Slide22The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
Slide23The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
5
Slide24The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
5
Slide25The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
5
Slide26The Sieve of Eratosthenes
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
5
7
11
13
Slide27Cumulative Frequencies
Scores: 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5
Score
Frequency
Cumulative Frequency
1
2
2
2
5
7
3
4
11
4
2
13
5
1
14
https://www.mathsisfun.com/definitions/cumulative-frequency.html
Slide28