首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导COMP9020编程、讲解web,HTML,CSS程序语言 辅导Python程序|辅导Web开发
项目预算:
开发周期:
发布时间:
要求地区:
COMP9020 Assignment 2 2021 Term 2
Due: Monday, 19th July, 12:00 (AEST)
Submission is through WebCMS/give and should be a single pdf file, maximum size 2Mb. Prose
should be typed, not handwritten. Use of LATEX is encouraged, but not required.
Discussion of assignment material with others is permitted, but the work submitted must be your
own in line with the University’s plagiarism policy.
Problem 1 (15 marks)
Let S be a set.
(a) Show that for any set T and any function f : S→ T, the relation R f ? S× S, defined as:
(s, s′) ∈ R f if and only if f (s) = f (s′)
is an equivalence relation. (9 marks)
(b) Show that if R ? S× S is an equivalence relation, then there exists a set T and a function fR : S → T
such that:
(s, s′) ∈ R if and only if fR(s) = fR(s′)
(6 marks)
Problem 2 (34 marks)
Let R ? S× S be any binary relation on a set S. Consider the sequence of relations R0, R1, R2, . . ., defined
as follows:
R0 := I = {(x, x) : x ∈ S}, and
Rn+1 := Rn ∪ (R; Rn) for n ≥ 0
Suppose there exists i ∈N such that Ri = Ri+1.
(a) Prove that Rj = Ri for all j ≥ i. (6 marks)
(b) Prove that Rj ? Ri for all j ≥ 0. (4 marks)
(c) If |S| = k, explain why Rk2 = Rk2+1. (4 marks)
(d) Let P(n) be the proposition that for all m ∈ N: Rn; Rm = Rn+m. Prove that P(n) holds for all n ∈ N.
Hint: Use results from Assignment 1 (6 marks)
(e) If |S| = k, show that Rk2 is transitive. (4 marks)
(f) If |S| = k, show that (R ∪ R←)k2 is an equivalence relation. (6 marks)
1
(g)? If |S| = k show that (R ∪ R←)k2 is the minimum (with respect to ?) of all equivalence relations that
contain R. (4 marks)
Remark
The relation at the limita as n tends to infinity, R? = limn→∞ Ri, is known as the reflexive, transitive
closure of R, and is closely connected to the Kleene star operator.
aBecause Rj ? Ri ? S× S for all j ≤ i, the Knaster-Tarski theorem ensures this limit always exists, even for infinite S.
Problem 3 (20 marks)
Let B = {0, 1} and consider the function f : N→ B given by
f (n) =
{
1 if n > 0,
0 otherwise.
(a) Show that for all a, b ∈N:
(i) f (a + b) = max{ f (a), f (b)}
(ii) f (ab) = min{ f (a), f (b)}
(6 marks)
From Problem 1, we know that R f ?N×N, the relation given by:
(m, n) ∈ R f if and only if f (m) = f (n)
is an equivalence relation. Let E ? Pow(N) be the set of equivalence classes of R f , and for n ∈ N, let
[n] ∈ E denote the equivalence class of n.
We would like to define binary operations, and , on E as follows:
[x] [y] := [x + y]
[x] [y] := [xy].
The difficulty is that the operands [x] and [y] can have multiple representations (e.g. if z ∈ [x] then
[x] = [z]), and so it is not clear that such a definition makes sense: if we take a different representation of
the operands, do we still end up with the same result? That is, if [x] = [x′] and [y] = [y′] is it the case that
[x + y] = [x′ + y′] and [xy] = [x′y′]? Our next step is to show that such a definition makes sense.
(b) Define relations , ? E2 ×E as follows:
((X, Y), Z) ∈ if and only if there is x ∈ X and y ∈ Y such that x + y ∈ Z
((X, Y), Z) ∈ if and only if there is x ∈ X and y ∈ Y such that xy ∈ Z
(i) Show that is a function.
(ii) Show that is a function.
(6 marks)
2
Part (b) shows that the informal definition of and given earlier is well-defined, so from now we will
view and as binary operations on E, that is , : E×E→ E.
(c) Show that for all A, B, C ∈ E:
(i) A [1] = A
(ii) A B = B A
(iii) A (B C) = (A B) (A C)
(8 marks)
Remark
Objects that have a concept of “addition” () and “multiplication” () where:
addition and multiplication are associative,
both operations have identities (see (c)(i)),
addition is commutative (see (c)(ii)), and
multiplication distributes over addition (see (c)(iii))
are known as semirings. We have already seen a number of semirings in this course:
The natural numbers with usual addition and multiplication,
Integers modulo n with addition and multiplication modulo n,
Subsets of a set X with union and intersection,
Languages with union and concatenation,
Binary relations with union and relational composition (see Assignment 1),
Matrices with matrix addition and matrix multiplication.
Problem 4? (6 marks)
Let f (n) be defined recursively as follows:
f (0) = 0 f (n) = f (bn
3
c) + 3 f (bn
5
c) + n for n ≥ 1
Show that f (n) ∈ O(n).
Problem 5 (20 marks)
A binary tree is a data structure where each node is linked to at most two successor nodes:
3
If we include empty binary trees (trees with no nodes) as part of the definition, then we can simplify the
description of the data structure. Rather than saying a node has 0, 1, or 2 successor nodes, we can instead
say that a node has exactly two children, where a child is a binary tree. That is, we can abstractly define
the structure of a binary tree as follows:
(B): An empty tree, τ
(R): An ordered pair (Tleft, Tright) where Tleft and Tright are trees.
So, for example, the above tree would be defined as the tree T where:
T = (T1, T2), where
T1 = (T3, T4) and T2 = (T5, τ), where
T3 = T4 = T5 = (τ, τ)
That is,
A leaf in a binary tree is a node that has no successors (i.e. it is of the form (τ, τ)). A fully-internal node in
a binary tree is a node that has exactly two successors (i.e. it is of the form (T1, T2) where T1, T2 6= τ). The
example above has 3 leaves (T3, T4, and T5) and 2 fully-internal nodes (T and T1). For technical reasons
(that will become apparent) we assume that an empty tree has 0 leaves and ?1 fully-internal nodes.
(a) Based on the recursive definition above, recursively define a function count(T) that counts the number
of nodes in a binary tree T. (4 marks)
(b) Based on the recursive definition above, recursively define a function leaves(T) that counts the number
of leaves in a binary tree T. (4 marks)
(c) Based on the recursive definition above, recursively define a function internal(T) that counts the num-
ber of fully-internal nodes in a binary tree T. (4
marks)
(d) If T is a binary tree, let P(T) be the proposition that leaves(T) = internal(T)+ 1. Prove that P(T) holds
for all binary trees T. Your proof should be based on your answers given in (b) and (c). (8 marks)
Problem 6? (5 marks)
Let Σ be a finite set, totally ordered by <. Give a formal, recursive definition of the lexicographic ordering
≤lex? Σ? × Σ?.
4
Advice on how to do the assignment
Collaboration is encouraged, but all submitted work must be done individually without consulting some-
one else’s solutions in accordance with the University’s “Academic Dishonesty and Plagiarism” policies.
Assignments are to be submitted via WebCMS (or give) as a single pdf file.
When giving answers to questions, we always would like you to prove/explain/motivate your an-
swers. You are being assessed on your understanding and ability.
Be careful with giving multiple or alternative answers. If you give multiple answers, then we will
give you marks only for your worst answer, as this indicates how well you understood the question.
Some of the questions are very easy (with the help of external resources). You may make use of
external material provided it is properly referenced1 – however, answers that depend too heavily on
external resources may not receive full marks if you have not adequately demonstrated ability/un-
derstanding.
1Proper referencing means sufficient information for a marker to access the material. Results from the lectures or textbook can be
used without proof, but should still be referenced.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ceng0013 design of a pro...
2024-11-13
代做mech4880 refrigeration a...
2024-11-13
代做mcd1350: media studies a...
2024-11-13
代写fint b338f (autumn 2024)...
2024-11-13
代做engd3000 design of tunab...
2024-11-13
代做n1611 financial economet...
2024-11-13
代做econ 2331: economic and ...
2024-11-13
代做cs770/870 assignment 8代...
2024-11-13
代写amath 481/581 autumn qua...
2024-11-13
代做ccc8013 the process of s...
2024-11-13
代写csit040 – modern comput...
2024-11-13
代写econ 2070: introduc2on t...
2024-11-13
代写cct260, project 2 person...
2024-11-13
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!