Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Методичка дискретка(англ).doc
Скачиваний:
2
Добавлен:
12.11.2019
Размер:
1.33 Mб
Скачать

Figure 1 example 4 (a) We will be interested in comparing the growth rates of familiar

sequences like log2 n, , n2,2n, n! and nn. Even for relatively small values of n it seems clear from Figure 1 that nn grows a lot faster than n!, which grows a lot faster than 2n, etc., although log2 n and seem to be running close to each other. In § 1.6 we will make these ideas more precise and give arguments that don’t rely on appearances based on a few calculations.

(b) We are really interested in comparing the sequences in part (a) for

large values of n. See Figure 2.11 It now appears that log2 n does grow [a lot] slower than , a fact that we will verify in the next section. The growth is slower because 2n grows [a lot] faster than n2, and log2 x and are the inverse functions of 2x and x2, respectively. ■

n

n2

2n

n!

nn

3.32

3.16

10

100

1,024

3.63 • 106

1010

6.64

10

100

10,000

1.27-1030

9.33 • 10157

10200

9.97

31.62

1,000

106

1.07.10301

4.02 •102567

103000

13.29

100

10,000

108

2.00 •103010

2.85 •1035659

1040000

16.61

316.2

100,000

1010

1.00.1030103

2.82 • 10456573

10500000

19.93

1000

106

1012

9.90 • 10301029

8.26 • l05565708

l06000000

39.86

106

1012

1024

big

bigger

biggest

FIGURE 2

So far, all of our sequences have had real numbers as values. How­ever, there is no such restriction in the definition and, in fact, we will be interested in sequences with values of other sorts.

example 5 The following sequences have values that are sets.

(a) A sequence (Dn)n of subsets of Z is defined by

Dn = {m Z: m is a multiple of n} ={0, ±n, ±2n, ±3n, ...}.

(b) Let be an alphabet. For each k N, k is defined to be the set of all words in * having length k. In symbols,

k = {w *: length(w) = k}.

The sequence ( k)k is a sequence of subsets of * whose union,

is *. Note that the sets k are disjoint, that 0 = {}, and that 1 = . In case = {a, b}, we have 0 = {}, 1 = = {a, b}, 2 = {aa, ab, ba, bb], etc.

The sets k appeared briefly in Example 7 of § 1.4 with the names L(k) where L was the length function on *. Henceforth we will use the notation k for these sets. ■

In the last example we wrote for the union of an infinite sequence of sets. A word is a member of this set if it belongs to one of the sets k. The sets k are disjoint, but in general we consider unions of sets that may overlap. To be specific, if (A k)k is a sequence of sets, then we define

This definition makes sense, of course, if the sets are defined for k in P or in some other set. Similarly, we define

.

The notation has a similar interpretation except that  plays a special role. The notation signifies that k takes the values 0,1, 2, ... without stopping; but k does not take the value . Thus

whereas

.

In Example 5 we could just as well have written * = .

Some lists are not infinite. A finite sequence is a string of objects that are listed using subscripts from a finite subset of Z of the form {m, m + 1, ..., n}. Frequently, m will be 0 or 1. Such a sequence is a function with domain {m, m + 1, ..., n}, just as an infinite sequence has domain {m, m + 1,...}.