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

On page 38, we claimed that since about a 1nfraction of n-bit numbers are prime, on average it is sufficient to draw O(n)random n -bit numbers before hitting a prime. We now justify this rigorously. Suppose a particular coin has a probability p of coming up heads. How many times must you toss it, on average, before it comes up heads? (Hint: Method 1: start by showing that the correct expression isi=1i(1-p)i-1p . Method 2: if E is the average number of coin tosses, show that E=1+(1-p)E).

Short Answer

Expert verified

1ptimes the coin must be tossed on average before it comes up heads.

Step by step solution

01

Explain the given information

Consider that,P is the Probability of a coin to show up heads. Let,X be the number of times the coin should be tossed before outcome is head. The following equation is used to find the average number of coin tossed:

E(X)=I=1i×P(i)

02

Calculate, how may time the coin must be tossed on average, before it comes up heads.

Consider that i-1times the coins were thrown , and the ith throwis a head. The probability of this event occurring is ,

pi=1-pi-1p

The number of time the coin must be tossed on average can be calculated as follows,

E=i=1i×PIE=i=1i1-pi-1p1-pE=i=1i1-pip

Simplify further,

localid="1659237715633" E-(1-p)E=p+i=11-pip=p+(1-p)pp=1

Find as follows,

E-1-pE=1E-E+pE=1pE=1E=1p

Therefore, 1ptimes the coin must be tossed on average before it comes up heads.

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

Let[m]denote the set{0,1,,m1}. For each of the following families of hash functions, say whether or not it is universal, and determine how many random bits are needed to choose a function from the family.

(a) H={ha1,a2:a1,a2[m]}, wheremis a fixed prime and

ha1·ha1,a2(x1,x2)=a1x1+a2x2modm

Notice that each of these functions has signatureha1,a2:[m]2[m]that is, it maps a pair of integers in[m]to a single integer in[m].

(b) His as before, except that nowm=2kis some fixed power of.2

(c) His the set of all functionsf:[m][m1].

Show that log(n!)=θ(nlogn)

(Hint: To show an upper bound, compare (n!) with nn. To show a lower bound, compare it with (n2)n2).

1.37. The Chinese remainder theorem.
(a) Make a table with three columns. The first column is all numbers from 0 to 14. The second is the residues of these numbers modulo 3; the third column is the residues modulo 5. What do we observe?
(b) Prove that if p and q are distinct primes, then for every pair (j, k) with 0j<qand 0k<q, there is a unique integer 0i<pqsuch thatijmodp andikmodq. (Hint:
Prove that no two different i's in this range can have the same (j, k), and then count.)
(c) In this one-to-one correspondence between integers and pairs, it is easy to go from i to (j, k). Prove that the following formula takes we the other way:
i={j.qq-1modp+kpp-1modq}modpq
(d) Can we generalize parts (b) and (c) to more than two primes?

What is the least significant decimal digit of (1717)17? (Hint: For distinct primesp,q, and any a is not equal to role="math" localid="1658726105638" a0(modpq), we proved the formula role="math" localid="1658726171933" a(p-1)1(modpq)in Section 1.4.2.)

Show that if a has a multiplicative inverse modulo N, then this inverse is unique (modulo N).

See all solutions

Recommended explanations on Computer Science 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