这个作业是完成集合、概率相关的数学问题

Compsci 120  Assignment 2

1.(字符串,集合)
(a)列出集合{{∅},∅,{∅},∅}的所有不同子集。
(b)假设A,B和C是集合,并且A∩B = A∩C和A∪B = A∪C。证明
B = C
(c)令j =“ java”,r =“ ruby​​”和p =“ python”为字符串。考虑字符串R =
jr,S = rp,T = jp。
一世。列出j的所有前缀。
ii。列出p的所有子串。
iii。令| i |表示字符串i的后缀数。 | R | + | S | + | T |是
等于?显示你的工作。
2.(关于计数的谎言)
(a)关于计数问题的索赔,以及与此索赔相对应的“证明”,
如下所示。该证明在逻辑上存在缺陷。发现所有逻辑错误1
在这个
证明,并解释您所识别的错误为什么会引起争论。
声明:在标准的52张卡片堆中,抽出5张卡片的概率为
至少有3个是黑色的

26
3
</ s> </ s> </ s>
·

49
2
</ s> </ s> </ s>
525

证明。抽出5张至少3张为黑色的牌的概率为
使用以下方法计算:
积极成果的数量
所有结果数=
获得5张手中的3张黑牌的结果数
所有结果数
1逻辑错误是推理中的错误,而不是结论。也就是说:如果您想解释为什么有人
论据是错误的,您不能只说“您的论据是错误的,因为其结论是错误的;”你在说的人
只能说结论是真实的,并且他们已经证明了这一点!相反,您想找到一个缺陷
他们的推理;即他们将A =⇒B换为B =⇒A的地方,或者混淆了“每个”和“有”的地方,
或在归纳证明中忘记了重要的基本案例,或类似的东西。
outcomes所有结果的数量是通过有序重复的有序选择来计算的
式。那是
阳性结果数= 525

“任务“在5张纸牌中准确获得3张3张黑卡”可以分为
两个子任务:
子任务1:找到选择3张黑卡的方法数量
子任务2:找到其余2个职位的可能结果数量。
子任务1:在标准的52张纸牌中,一半(26)是黑色。所以:
用三张黑牌做牌,首先从26张黑牌中选出三张
牌。这属于无重复问题的有序选择类别,并且
因此,有
26
3
</ s> </ s> </ s>
做到这一点的方法。
子任务3:要完成任务,我们只需要从49张卡片中再选择两张
剩下的这可以在
49
2
</ s> </ s> </ s>
方法。
因此,使用加法原理,有
26
3
</ s> </ s> </ s>
·

49
2
</ s> </ s> </ s>
很多这样的手。
最后所需的概率是
获得5张手中的3张黑牌的结果数
所有结果数=

26
3
</ s> </ s> </ s>
·

49
2
</ s> </ s> </ s>
525
(b)从(a)中找到索赔的实际可能性
3.(计数)
如果您不得不搬家,新西兰邮政会提供有用的重定向服务,
提供。您可以花一点钱,让他们在您的旧公寓中转发所有发送给您名字的邮件
到您的新公寓几个月。
但是,他们对“您的名字”的解释有些棘手。根据NZPost网站,
致“先生先生”的消息如果您给他们唯一的名字,“ J Smith”将不会被重定向
重定向是“先生。约翰·史密斯。”同样,给“博士约翰·史密斯”或“
史密斯,约翰”或“先生。除非您告诉了约翰·史密斯,否则不会全部重定向。
这些名字也是如此。因此,他们要求您列出所有可能的名称变体
重定向。
(a) Suppose that Professor Albus Brian Dumbeldore was moving to Hogwarts, and wants to
ask the NZ Post office to redirect mail to him.
ˆ Prof. Dumbeldore has three possible titles (Headmaster, Prof., Professor) that can
go in the front of his name. Any one of these titles can be listed, or no title can be
listed.
ˆ His name can then be listed in any of the formats “First Middle Last”, “Last, First
Middle”, “First Last”, “Last, First”, or just “Last”. Each time a name is used, it
can either be written out in full (“Brian”) or just given by a first initial (“B”).
ˆ Finally, suppose that he has four possible honorifics (O.M, X.J(sorc), Grand Sorc,
D.Wiz), that can go on the end of his name. Any subset of these can go on to the
end of his name, and the order matters here (i.e. listing them in a different order
technically yields a different “name.”)
ˆ Any possible combination of title-name-honorifics is valid.
How many title-name-honorific combinations would he need to list with the New Zealand
Post Office, to ensure that mail sent to any of these names would go to him?
(b) Suppose that the order in which the honorifics is listed does not matter. How does this
change your answer to (
(c) What is the probability that the letter is addressed as “Professor Albus B Dumbeldore”
or “Prof. Albus Brian Dumbeldore”, assuming that the order in which the honorifics is
listed does not matter, and all combinations of title-name-honorifics occurs with equal
probability? Justify
4. (Functions)
(a) Let X = {1, 2, 3, 4}. State with reason which of the rules defined below is (or is not) a
function with domain and codomain both equal to X.
i. f(2) = 3, f(1) = 4, f(2) = 1, f(3) = 4,f(4) = 1,
ii. g(3) = 1, g(4) = 3, g(1) = 2,
iii. h(2) = 1, h(3) = 4, h(1) = 2, h(2) = 1, h(4) = 3
(b) i. Define f : R → R by the rule f(x) = 2x
4 + 4x
2 + 1 for every real number x. Let
g : {∗, +, %, ×} → R be a function defined by the rule: g(∗) = 1, g(+) = 2, g(%) =
−1, g(×) = −2. Find the domain and range of f ◦ g.
ii. Let f : R → R and g : R
≥2 → R be functions defined as follows2
:
f(x) = √
x and g(x) = p
(x − 2)
Does g ◦ f exist? Justify
(c) Define a function f : {1, 2, 3, 4, 5, 6} → {1, 2, 3, 4, 5, 6} by the rule f(1) = 3, f(2) =
4, f(3) = 6, f(4) = 2, f(5) = 5, f(6) = 1.
For any positive natural number n, let f
n
(x) = f ◦ f ◦ f ◦ . . . ◦ f
| {z }
n times
(x). Calculate f
1000(x)
and f
1001(x) for every x in {1, 2, 3, 4, 5, 6}. Justify your answer
2R
≥2 denotes all real numbers greater than or equal to 2
3