Introduction to Algorithms, Third Edition



Download 4,84 Mb.
Pdf ko'rish
bet82/618
Sana07.04.2022
Hajmi4,84 Mb.
#534272
1   ...   78   79   80   81   82   83   84   85   ...   618
Bog'liq
Introduction-to-algorithms-3rd-edition

pseudorandom-number
generator
: a deterministic algorithm returning numbers that “look” statistically
random.)
When analyzing the running time of a randomized algorithm, we take the expec-
tation of the running time over the distribution of values returned by the random
number generator. We distinguish these algorithms from those in which the input
is random by referring to the running time of a randomized algorithm as an
ex-
pected running time
. In general, we discuss the average-case running time when
the probability distribution is over the inputs to the algorithm, and we discuss the
expected running time when the algorithm itself makes random choices.
Exercises
5.1-1
Show that the assumption that we are always able to determine which candidate is
best, in line 4 of procedure H
IRE
-A
SSISTANT
, implies that we know a total order
on the ranks of the candidates.
5.1-2
?
Describe an implementation of the procedure R
ANDOM
.a; b/
that only makes calls
to R
ANDOM
.0; 1/
. What is the expected running time of your procedure, as a
function of
a
and
b
?
5.1-3
?
Suppose that you want to output
0
with probability
1=2
and
1
with probability
1=2
.
At your disposal is a procedure B
IASED
-R
ANDOM
, that outputs either
0
or
1
. It
outputs
1
with some probability
p
and
0
with probability
1
p
, where
0 < p < 1
,
but you do not know what
p
is. Give an algorithm that uses B
IASED
-R
ANDOM
as a subroutine, and returns an unbiased answer, returning
0
with probability
1=2


118
Chapter 5
Probabilistic Analysis and Randomized Algorithms
and
1
with probability
1=2
. What is the expected running time of your algorithm
as a function of
p
?

Download 4,84 Mb.

Do'stlaringiz bilan baham:
1   ...   78   79   80   81   82   83   84   85   ...   618




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish