Source code online books for professionals by professionals


Figure 3-4.  Passing n tokens down through the levels of a binary tree Tip



Download 4,67 Mb.
Pdf ko'rish
bet40/266
Sana31.12.2021
Hajmi4,67 Mb.
#213682
1   ...   36   37   38   39   40   41   42   43   ...   266
Bog'liq
2 5296731884800181221

Figure 3-4.  Passing n tokens down through the levels of a binary tree
Tip
 

  a geometric (or exponential ) series is a sum of ki, where i = 0...n, for some constant k. If k is greater  than 1,  
the sum will always be 
Q(k
 n+1
). The doubling sum is just a special case.
Subsets, Permutations, and Combinations
The number of binary strings of length k should be easy to compute, if you’ve read the previous section. You can, for 
example, think of the strings as directions for walking from the root to leaves in a perfectly balanced binary tree. The 
string length, k, will be the height of the tree, and the number of possible strings will equal the number of leaves, 2
k

Another, more direct way to see this is to consider the number of possibilities at each step: The first bit can be zero or 
one, and for each of these values, the second also has two possibilities, and so forth. It’s like k nested for loops, each 
running two iterations; the total count is still 2
k
.

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   36   37   38   39   40   41   42   43   ...   266




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