Assignment Solution: Theoretical Computer Science, Exercises C and F

Verified

Added on  2019/10/18

|3
|486
|338
Homework Assignment
AI Summary
This document presents the solutions to a theoretical computer science assignment, focusing on two exercises, C and F. Exercise C explores set theory concepts, including the Cartesian product, subsets, and the cardinality of sets, with examples involving people, floors, and ages. Exercise F delves into the validation of check digits, demonstrating how a specific code is verified and discussing the properties of onto functions in the context of error detection. The assignment highlights the application of these concepts in identifying and correcting errors within data. The document provides detailed explanations and calculations, making it a valuable resource for understanding the theoretical underpinnings of these topics.
Document Page
Solution of Exercise C,F
C.)
Let P, F and A be the Set defined follows :
P(set of People) = Alice, Bob, Charles, Diane
F(Floors in the buildings) = Ground, One, Two.
A (Ages for the workers) = {x 2 N | 16 <x< 70}
In ages : Alice is 18, Bob is 40, Charles is 63 and Diane is 30.
i.)set of members of the Cartesian product P x F
P X F = {(Alice,Ground),(Alice,One),(Alice,Two),(Bob,Ground),(Bob,One),(Bob,Two),(Charles,Ground),
( Charles,One),(Charles,Two),(Diane,Ground),(Diane,One),(Diane,Two)}
ii.) Write down the relation, which is a subset of P X A, which relates people to age.
Subset of P X A = {(Alice,18),(Bob,40),(Charles,63),(Diane,30)}
Venn diagram
iii.) cardinality of each set:
| G | = 5
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
| O | = 10
and | T | = 6
iv.) value of | G O T | = 10
v.) workers who used floor two = 19
vi.) workers who did not work on ground, one or two = 14
vii.) workers who worked on only one = 10
viii.) workers who used only the ground floor = 5
F.)
i.) 2516238674 is a valid code
x1 + 2x2 + 3x3 + 4x4 + 5x5 + 6x6 + 7x7 + 8 x8 + 9x9 + 10x10
2 + 2.5 + 3.1 + 4.6 + 5.2 +6.3 +7.8 + 8.6 + 9.7 + 10.4
2 + 10 +3 +24 +10 +18 +56 +48 +63 +40 = 274
Yes ,this is the Valid Code.
ii.) Let X be the set of all strings of 9 digits
let Y be the set of all digits
Function f is onto because there are total 10 digits 0-9 in set Y and all of them will be check digit for a
string, means at least one string will lead to that all digits.
iii.) As the function is onto , means there will be many string i.e wrong one as well ,that points to same
check digit, that misleads to a wrong answer !! So check digit may be able to detect the error made is
keying.
Document Page
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]