Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1. Prime Numbers Design an algorithm to determine if a number is prime, and present it in: a) pseudocode; and b) a flowchart. Write

Part 1. Prime Numbers

Design an algorithm to determine if a number is prime, and present it in:

a) pseudocode; and b) a flowchart.

Write the corresponding code in Python.

Present screen shots of the results in which you test that code with 2 numbers that are not prime and 2 numbers that are prime.

Embed that code in a loop to print out all the prime numbers between 1 and 200.

(I HAVE ANSWERED PART 1, I JUST NEED HELP ON PART 2!)

Part 2. Riemann zeta function

Write the code in Python to evaluate the Riemann zeta function (of some input value called s) from its infinite series form truncated to some upper limit called M. Test the convergence of your calculation to known value at s=2 for various M. What is the smallest value of M for which the truncated sum gives the right answer within 1% ?

Write the code in Python to evaluate the Riemann zeta function (of some input value called s) from its infinite product form truncated to some upper limit called P. Note that the product form is over the prime numbers so you will need to use some of the code you wrote in part 1 to do this. Test the convergence of your calculation to known value at s=2 for various P. What is the smallest value of P for which the truncated product gives the right answer within 1% ? Again present screen shots of the Python code you wrote to do these calculations.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions