U08606 Discrete Mathematics

Semester 2 2013/14Assignment 2Please provide the following informationSubmissionPlease complete this cover sheet and attach it to the front of your assignment solutions. You can hand in your work at the start of the lecture, or post your assignment in the coursework box labelled U08606 in the R building,Wheatley campus on or before the due date. Coursework submitted late without a valid justification will not be accepted unless you have made an application for an extension due to mitigating circumstances.AssessmentThis assignment carries 25% of the total marks for the module. All questions should be attempted and marks will be allocated as indicated. Full details of your working should be handed in for assessment.Important noticeYou are bound by University regulations which require that coursework submitted for assessment purposes is genuinely your own and is not borrowed or stolen from any source, including fellow students. Ask yourpractical tutor or attend a surgery if you need advice.1U08606 DISCRETE MATHEMATICS – Coursework 2There are seven questions on this assignmentQuestion 1 (5 marks)The functions f :R ?R and g :R R ? are given by1 ( ) 3x f x ? ? and gx x () 3 2 ? ? .Determine the functions ?gf x ? ?( ) and ? f ? g x ?( ).Question 2 (5 marks)Of a company’s personnel, 9 work in manufacturing, 6 in marketing and 3 in accounting. Aproject group of 6 is to be formed to plan the launch of a new product.In how many ways can the project group be formed if(a) the project group includes two members from each department?(b) manufacturing is to have at least two representatives?Question 3 (5 marks)Consider the following graphs G1 and G2.1 12 2 3 4 53 45 6 6G1 G2For each of the graphs G1 and G2 , state whether or not the graph is(a) Eulerian and (b) Hamiltonian.If the graph is Eulerian give an Eulerian trail and if the graph is Hamiltonian give aHamiltonian cycle.2Question 4 (5 marks)The following table gives the distances (in miles) between six towns A, B, C, D, E and F.A B C D E FA – 7 26 28 37 16B 7 – 18 23 28 20C 26 18 – 8 11 30D 28 23 8 – 13 42E 37 28 11 13 – 29F 16 20 30 42 29 –(a) Use the minimal spanning tree algorithm to find a network of minimal total lengthlinking all six towns. What is the total length of the network?(b) Use the nearest neighbour algorithm (starting at town C) to find a circular routevisiting all six towns. What is the total length of the route?Question 5 (5 marks)Given the following table of modules and their prerequisites, use the Topological SortAlgorithm to find a total ordering in which the modules can be taken sequentially. Showyour working.Module PrerequisitemodulesAdvanced Mathematical Methods BBasic Mathematical Methods noneCore Electronics BDigital Imaging E, FElectronics CFourier Analysis A, C3Question 6 (10 marks)Let C denote the set of lower case characters of the English alphabet, and let S denote theset of strings of such characters. N is the set of natural numbers.The following basic primitive functions for manipulating elements of S are given:CHAR : S ? C where CHAR(s) is the first character of the non-empty string s,REST : S ? S where REST(s) is the string obtained from the non-empty string s byremoving its first character,ADD : C ? S ? S where ADD(c, s) is the string obtained by adding the character c to thefront of the string s,LEN : S ? N where LEN(s) is the number of characters in s,REV : S ? S where REV(s) is the string obtained from the non-empty string s byreversing the characters in s.(a) A function F : S ? S is given byF(s) = ADD(CHAR(REV(s)), REV(REST(REV(s)))).Evaluate F(s) when s = “apples”.Describe in words the effect of F on any string s containing at least two characters.(b) The function PEN(s) removes the penultimate (last but one) character from an inputstring s of length at least two, leaving the rest of the string intact. For example,PEN(“robes”) = “robs”. Express the function PEN(s) in terms of the basic primitivefunctions above.(c) Trace the values of u, v, s, LEN(v) and LEN(s) in the following algorithm when s =“potato”.beginInput swhile LEN(v) < LEN(s) dobeginu := CHAR(s);s := REST(s);v := ADD(u,v);endOutput vv := REV(v);endDescribe in words the effect of the algorithm on an arbitrary string s. What happens ifthe input string is of odd length?4Question 7 (10 marks)The following algorithm, bubblesort, sorts a list of n integers into increasing order bysuccessively comparing adjacent elements and interchanging them if they are in the wrongorder.Input x1, x2, x3, …, xn ; beginfor i := 1 to (n – 1) dofor j := 1 to (n – i) doif xj > xj+1thenbegintemp:= xj ;xj := xj+1 ;xj+1:= temp ; endelse {do-nothing};endOutput x1, x2, x3, …, xn ;(a) When n = 4, trace the values of i, j, x1, x2, x3 and x4 for the input values x1 = 3, x2 = 2,x3 = 7, x4 =1.(b) A time complexity function T(n) can be found for bubblesort by counting thenumber of times the comparison j x > j 1 x ? is made for a general positive input n.Show that T(n) is ? ?. 2 O n(c) Another sorting algorithm requires comparisons to sort a list of n integersinto ascending order. Is this algorithm more efficient than bubblesort? Brieflyjustify your answer.2 3 log n n

Get 20% Discount on This Paper
Pages (550 words)
Approximate price: -

Try it now!

Get 20% Discount on This Paper

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Ace Writing Center has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.

Essays

Essay Writing Services

At Ace Writing Center, Nowadays, students normally have extremely busy schedules. You will note that some of them have to take on some evening or weekend jobs in order to get some income that can help them to sustain in college or in the university. This can deny them a chance to write all the essays given. Others usually get bombarded with a lot of work by their lecturers. This can still delay such students from working on all their essays. However, some of them usually try to work on all these essays but end up delivering their work late. This can prevent them from graduating since most lecturers are strict on deadlines. If you want to write a business essay, the wise way is to hire an outstanding essay writing service like us, so that you can get the best results. If you are keen, you will note that many companies usually overcharge their customers. Some of them are there only to make money. And in reality, they really don’t care to build a long term commitment with students. You should not choose such companies. You should take your time and choose a reliable company to work with. Ace Writing Center is the ultimate solution for you. We have been offering our writing service for more than 7 years. This is a clear indication that you will get quality essay writing service. We have a wide range of writers who can work on any business essay that you might have. We believe in doing extensive research so that we can provide quality work to all our clients. .

Admissions

Admission and Business Papers

Have you ever had to write an admission essay for college? The majority of students face the same issues when applying to a university or college and many in such situations decide they need professional help to cope with this matter. They get in a situation when the deadline keeps coming closer but lack motivation to start because they are just not sure if their writing skills are strong enough. We have a solution for you! Ace Writing Center is the best admission essay writing service with a large professional team and years of experience in providing high-quality papers to students of all levels and faculties. The mission of our team is to help students make their dreams of entering a good college come true and that’s what we offer!.

Editing

Editing and Proofreading

Sometimes all the words for your paper just flow out of your mind and into your fingers. You type quickly at your keyboard and there they are, your beautiful words right there on the screen. But you have no idea how to polish it up. You may be wishing there was a paper writing service that offered this type of writing service. Look no more! Here at Ace Writing Center, we offer you an editing and proofreading option that you can't find anywhere else..

Coursework

College Essay Writing

In case you are familiar Ace Writing Center, you know the way to distinguish a better company from a cheap one exactly. First of all, poor service website does not have a sufficient support. We think support team is an essential part of success; it has to answer all clients’ questions and be a connecting link between clients and their writers. On our web-service you will get answers about anything you need and your writer will receive all your instructions, assignments and requirements exactly and swiftly. A writing service that we run has got a flexible pricing system that will save you from senseless wastes and many bonus systems that let you sparing money for something important for you.