

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Questions for computer science basically about software
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Problem 1
From section 1.1 of the given reading, what is the number of pairings (in all the various senses as discussed) in a party of 10? a. Handshakes b. Seating arrangements c. Playing chess (with 5 chess-boards) Problem 2
(a) How many words of 10 letters can you form, using the English alphabet? (there are 26 different letters, of which
5 are vowels).
(b) How many words of length 10 can you form, where no letter is repeated?
(c) How many words of length 8 can you form, where the first letter is the same as the last letter?
(d) How many words of length 8 can you form, which contain exactly one vowel?
Problem 3
In how many ways can a photographer at a wedding arrange six people in a row, including the bride and groom, if
a) the bride must be next to the groom?
b) the bride is not next to the groom?
c) the bride is positioned somewhere to the left of the groom?
Problem 4
a. List all subsets of {0, 1, 3}. How many do you get? b. List all subsets of {๐, ๐, ๐, ๐, ๐}, containing ๐ but not containing ๐. c. Define a set of which both {1, 3, 4} and {0, 3, 5} are subsets. Find such a set with the smallest possible number of elements. d. What is the number of subsets of a set with n elements? e. What is the number of subsets of a set with n elements, containing a given element (when element becomes fixed, part of every subset)? Problem 5
a. We form the union of a set with 5 elements and a set with 9 elements. Which of the following numbers can we get as the cardinality of the union: 4, 6, 9, 10, 14, 20? b. We form the union of two sets. We know that one of them has n elements and the other has m elements. What can we infer about the cardinality of their union? c. What is the intersection of i) the sets {0, 1, 3} and {1, 2, 3}; ii) the set of girls in this class and the set of boys in this class; iii) the set of prime numbers and the set of even numbers? d. We form the intersection of two sets. We know that one of them has n elements and the other has m elements. What can we infer about the cardinality of their intersection? Problem 6
Use Venn-diagram to prove following: a. Prove equations (1.2), (1.3), and (1.4) given in the reading pages. b. Prove that |๐ด โช ๐ต| + |๐ด โฉ ๐ต| = |๐ด| + |๐ต|. Problem 7
a. What is the symmetric difference of the set โค+^ of nonnegative integers and the set ๐ผ of even integers (๐ผ = {... , โ4, โ2, 0, 2, 4,... } contains both negative and positive even integers). b. Let ๐ถ be the symmetric difference of ๐ด and ๐ต ( that is ๐ดฮ๐ต = ๐ถ). Now, form the symmetric difference of A and C. What did you get? Give a proof of the answer using Venn diagram.
Graphs
Problem 8 A friendship graph is given below.
a. Make a 5 ร 5 array to show who is friend of whom. (All rows are labelled A, B, C, D, E, and all columns are labelled A, B, C, D, E. Mark the corresponding entry if they are friends, and cross if they are not). b. Represent the friendship relation as sets (e.g. ๐ด = {๐ธ, ๐ต, ๐ถ, ๐ท}, all friends of A. Similarly do for others).
Problem 9
a. Draw graph of the following chemical bonds:
b. Draw graph of the following maze. You make an edge whenever one labelled corridor is connected to another one.
Problem 10