The Sieve of Eratosthenes and Prime Sums Exploration
Uncover the ancient mathematical algorithm of the Sieve of Eratosthenes and delve into exploring prime number sums. Dive into tutorials, Q&A sessions, and lab program details in this comprehensive recitation slide deck.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
COP 3502 Recitation 2 THE SIEVE OF ERATOSTHENES 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 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
Answers 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.
Announcements 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
Lab 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
Lab Program Prime Sums! Prime numbers: 2, 3, 5, 7, 11, 13, n 1 2 3 4 5 P(n) 2 2 + 3 = 5 2 + 3 + 5 = 10 2 + 3 + 5 + 7 = 17 2 + 3 + 5 + 7 + 11 = 28
Review of malloc and free int numPrimes = 10000; int* myArray = malloc(sizeof(int) * numPrimes); free(myArray);
The 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.
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3 5
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3 5
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3 5
The Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 3 13 5 7 11
Cumulative Frequencies Scores: 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5 Score Frequency Cumulative Frequency 2 7 11 13 14 1 2 3 4 5 2 5 4 2 1 https://www.mathsisfun.com/definitions/cumulative-frequency.html