Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Question: Use pseudocode to write out the probabilistic primality test described in Example 16.

Short Answer

Expert verified

Answer

The probabilistic primality test is described as:

procedureprobabilistic primen,k

Composite: = false

i:=0

While composite = falseandik

i:=i+1

Chooseb uniformly at random withi<b<n

Apply Miller’s test to baseb

Ifnfails the test thencomposite = true

Ifcomposite = true then print{“composite”)

elseprint (“probably prime”)

return unknown

Step by step solution

01

Given information  

A permutation of the integers 1through nhas already been sorted (that is, it is in increasing order), or instead, is a random permutation.

02

Definition and formulas

The input to this algorithm is the integer n>1to be tested for primality and the numberof iterations desired.

If the output is “composite” then we know for sure thatnis composite. If we get the output as “probably prime” then we do not know whether or notnis prime, and of course it makes no sense to talk about the probability thatnis prime(either it is or it is not there is no choice involved). We only know that the chance that a composite number would produce the output “probably prime” is at most 14K.

03

Designing the probabilistic primality test

So, using the pseudocode we get the probabilistic test as given below:

procedureprobabilistic prime(n,k)

Composite: = false

i:=0

While composite = falseandik

i:=i+1

Choose uniformly at random withi<b<n

Apply Miller’s test to baseb

Ifnfails the test thencomposite = true

Ifcomposite = true then print{“composite”)

elseprint (“probably prime”)

return unknown

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Question: Suppose that we roll a fair dice until a\(6\)comes up.

a) What is the probability that we roll the dice n times?

b) What is the expected number of times we roll the dice?

Question: What is the probability of these events when we randomly select a permutation of{1,2,3,4}?

a)1precedes4.

b)4precedes1.

c)4precedes1and4precedes2

d)4precedes1and4precedes2and4precedes3

e)4precedes3and2precedes1

Question:

(a) To determine the probability that the player wins the jackpot.

(b)To determine the probability that the player wins 1000000\(, the prize for matching the first five numbers, but not the sixth number drawn.

(c)To determine the probability that a player win 500\), the prize for matching exactly four of the first five numbers, but not the sixth number drawn.

(d) To determine the probability that a player wins 10$, the prize for matching exactly three of the first five numbers but not the sixth number drawn, or for matching exactly two of the first five numbers and the sixth number drawn.

Question: A space probe near Neptune communicates with Earth using bit strings. Suppose that in its transmissions it sends a 1 one-third of the time and a 0 two-thirds of the time. When a 0 is sent, the probability that it is received correctly is 0.9, and the probability that it is received incorrectly (as a 1) is 0.1. When a 1 is sent, the probability that it is received correctly is 0.8, and the probability that it is received incorrectly (as a 0) is 0.2

a) Find the probability that a 0 is received.

b) Use Hayes theorem to find the probability that a 0 was transmitted, given that a 0 was received.

Question: Suppose that \(E, {F_1},{F_2}\,and {F_3}\)are events from a sample space S and that \({F_1},{F_2}\,and {F_3}\) are pair wise disjoint and their union is S. Find \(p\left( {\frac{{{F_2}}}{E}} \right)\)if \(p\left( {\frac{E}{{{F_1}}}} \right) = \frac{2}{7},p\left( {\frac{E}{{{F_2}}}} \right) = \frac{3}{8},p\left( {\frac{E}{{{F_3}}}} \right) = \frac{1}{2},p\left( {{F_1}} \right) = \frac{1}{6},p\left( {{F_2}} \right) = \frac{1}{2}\) and \(p\left( {{F_3}} \right) = \frac{1}{3}\)

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free