4120comp - portfolio of exercises - describes a simple


Exercise A

Let P, Q and R propositions defined as follows:
P: I am a LJMU student.
Q: My SE Principle module is completed.
R: It is end of the semester.
Write each of the following propositions as logical expression involving P, Q, and R:
1. I am a LJMU student and my SE Principle module is completed.
2. 2. It is end of the semester and my SE Principle module is not completed.
3. 3. If my SE Principle module is not completed, then it is not end of the semester.
4. 4. If it is end of the semester, then my SE Principle module is completed.
5. 5. If it is end of semester and my SE Principle module is not completed, then I am not a LJMU
Student.

Exercise B
Translate the following into symbolic form:
1. Every LJMU student is smart.
2. Someone at LJMU is smart.
3. Nobody can ignore Peter
4. Everyone likes someone.
5. There is a student who is loved by every other student.

Exercise C

1. Let's consider a propositional language where:
A ="Angelo comes to the party",
B ="Bruno comes to the party",
C ="Carlo comes to the party",
D ="David comes to the party".

Formalize the following sentences:
- Angelo comes to the party while Bruno doesn't.
- Either Carlo comes to the party, or Bruno and David don't come.
- If Angelo and Bruno come to the party, then Carlo comes provided that David doesn't come.
- Carlo comes to the party if Bruno and Angelo don't come, or if David comes.

2. The following statement describes a simple flat tyre problem: The spare should be at the trunk and the flat is at the axle. If the spare is at the trunk, remove the spare from the trunk. If the flat is at axle, remove the flat from the axle. Put on spare to the axle. Remove the flat from the ground and get on the trunk.

Considering possible actions such as At, Remove, PutOn ... represent the solution of flat tyre problem in at least 10 correct arguments.

3. The following statement describes a simple elevator/lift system:

The elevator is moving between floors or is stationary at a floor. If the elevator is stationary then the brakes are applied. The brakes are not applied therefore the elevator is moving between floors. If the elevator is stationary or the breaks are applied, then elevator are not moving and vice versa.

i. Represent the above statement using propositions

ii. Test the validity of the argument by constructing a truth table.

Exercise D

In a recent small survey a group of workers entering a building were asked which floor they had cause to visit to do their work. A set of people (P ) identified by their first names, P = Jack, John, Bob, M att, Dan, were asked to choose from the three floors in the buildings F = {ttROU N D, ON E, T W O}. There is also a set of ages for the workers given by A = {x ∈ N | 16 < x < 70}. In ages: Jack is 20, John is 25, Bob is 40, Matt is 55 and Dan is 65.

Write down the set of members of the Cartesian product P × F.

Write down the relation, which is a subset of P × A, which relates people to age.

The survey was later widened to ask 60 workers which floor in the 3-storey building they had cause to work on. The results were collated: 12 worked only on the ground and first floor, 6 worked only on the second floor, 29 worked on the ground floor, 2 worked only on the second and ground floors, 10 worked on the second, first and ground floors, 33 worked on the first floor and 1 worked on only the second and first floors. Denoting the sets of workers for each of the floors GROUND, ONE and TWO as tt, O or T respectively.

What is the cardinality of each set: | tt |, | O | and | T |?

What is the value of | tt ∩ O ∩ T |?

Using a Venn diagram determine

How many workers used floor TWO?

How many workers did not work on GROUND, ONE or TWO?

How many workers worked on only ONE?

How many workers used only the GROUND floor?

Exercise E

Let U = {x ∈ N : x TM 15}. Let A = {x : x is even}, B = {x : x < 8}, and C = {x : x is divisible by 3}. Depict the sets on a Venn diagram.
[4 Marks]
Hence write down the following sets in enumerated form:
A ∩ B
B ∪ C
A ∪ B
(A ∪ B) ∩ C
(A ∩ C) ∪ A ∪ B ∪ C

Exercise F

Let U = {x ∈ N : x ≤ 12}. Let A = {x : x is odd}, B = {x : x > 7}, and C = {x : x is divisible by 3}.

With the help of Venn diagrams, show that for finite sets A, B and C

| A ∪ B ∪ C | = | A | + | B | + | C | - | A ∩ B | - | B ∩ C | - | A ∩ C | + | A ∩ B ∩ C |

First year students studying computing at the Liverpool John Moores University can study a number of optional modules. Last year 28 chose to study the finance, 30 chose the business and 15 chose the tourism. There were 21 students who took both the finance and business, 6 who opted for finance and tourism, and 4 who studied business and tourism. No students took all three modules. How many students are taking at least one of the three modules? How many of the students involved took only tourism?

Exercise G

For the purpose of error detection, numeric codes (such as Passport numbers) often include a final ‘check digit'.

Suppose a numeric code consists of a string of 9 digits x1x2 . . . x9, followed by a final check digit x10 defined to be the rightmost decimal digit of x1 + 2x2 + 3x3 + . . . + 9x9.

Verify that 5241562639 is a valid code.

Validate 2516238674, whether is a valid code or not.

Let X be the set of all strings of 9 digits, let Y be the set of all digits, and let f : X → Y be the function that assigns the correct check digit to each string, for example f (251623867) = 4. State, giving reasons, whether f is one-to-one and whether f is onto.

If an error is made in keying in a code, will the check digit always detect it? Explain, with reference to your answer to (ii).

Exercise H

Probability is a function p mapping a set of events E to the set of real numbers in the range 0 to 1:

p E [0,1].

It is possible to work out the probability of two people having a different birth date: Once one person's birth date is known there are only 364 clays out of 365 that the second person can have a birthday on to be different. Thus the probability that the second person has a different birthday from the first is 364/365. This assumes that there are 365 days in a year and people's birthdays are uniformly distributed.

Likewise for a third person to have a different birthday, so that all three people have a distinct birth date, there are only 363 days to choose from out of the 365. So the probability of three people all having different birth dates is the probability that two people have a different birthday and that the thirdperson has a different birthday from them. That is multiplying the probabilities:364/365.363/365

For 4 people all to have different birth dates the probability is 364/365.363/365.362/365.

A pattern can be seen to emerge here so that if the probability of n people having a different birthday is known the probability of adding an (n + 1)th person with a different birth date has a probability 365-n/365 giving the probability of all n + 1 people having different birthdays as 364/365.363/365.362/365.....365-n/365.

This is a recursive definition:

P(n+ 1) = p(n). 365 - n/365 (1)

Set up a table in Excel with the number n in one column, ranging from 2 to 50, with the probability p(n) in the next column. Using the chart features in Excel, or any other graphing tool, produce an X - Y graph to show probability (Y axis) plotted against n (X axis).

At what value of n does the probability fall to less than 0.5 (50%) that all n people have a different birthday?

Exercise I

This module has examined modelling in computing to show how the concepts from set theory and logic, functions and relations underlie the modelling of computer systems and programs.

Write a brief description to discuss the topics of your portfolio and what they show about the importance of the concepts in modelling aspects of systems in computing. You should comment on what you have learned from this portfolio of exercises and suggest some further aspects of computing systems that may be modelled with the tools and techniques you have learnt.

Request for Solution File

Ask an Expert for Answer!!
Software Engineering: 4120comp - portfolio of exercises - describes a simple
Reference No:- TGS02534464

Expected delivery within 24 Hours