MATH4004 Mathematics for Computing Assignment

Assignment Help Other Subject
Reference no: EM132502380

MATH4004 Mathematics for Computing - Oxford Brookes University

Problem 1

Let A = {1, 2,3, 4} and B = {1, 2,3}. Define the function f : A → B by the rule

f (1) = 1, f (2) = 3 , f (3) = 1 and f (4) = 2.

(a) What is the image of 3?

(b) What is the codomain of f ?

(c) Draw the digraph representing f .

(d) Is the function injective? Is the function surjective? Justify your answers.

Problem 2

Suppose that ten computer programs have been submitted for batch processing. Only one program may run at a time. In how many ways can the programs be run if:

(a) there are no restrictions on processing order?

(b) four of the programs are considered higher in priority than the other six and should be processed first?

(c) the programs can be separated into three top priority (to be processed first), five medium priority (to be processed immediately after the top priority programs) and two low priority programs (to be processed last)?

Problem 3

(a) Find a Hamiltonian cycle in the graph G whose adjacency matrix is

855_figure.jpg

(b) Find a minimal spanning tree for the graph below.

2390_figure1.jpg

Problem 4

Consider the graph G with vertex-set V (G) = {a,b, c, d, e, f , g, h} and edge- list E(G) = (ab, ac, ad,bc,be,be,bf , cd,ce,cf ,de, gh).

(a) Draw the graph G .
(b) Show that the following graphs H and J are subgraphs of G .

464_figure2.jpg

Problem 5

Use Dijkstra's Algorithm to find the shortest distance from vertex A to all the other vertices in the following weighted digraph:

1868_figure3.jpg

Determine the shortest path from A to Z.

Problem 6

This Problem is concerned with a functional programming language for manipulating binary rooted trees.

The set BT consists of all binary rooted trees whose vertices are elements of the set N of natural numbers. The empty tree is denoted by Ø.

The following basic primitive functions for manipulating elements of BT are given:

ROOT : BT → N , where ROOT(t) = the root of the non-empty tree t
LEFT : BT → BT , where LEFT(t) = the left subtree of the non-empty tree t RIGHT : BT → BT , where RIGHT(t) = the right subtree of the non-empty tree t
MAKE : BT x N x BT → BT , where MAKE(t, n, s) = the tree with root n, left subtree t and right subtree s
MAX : N x N → N, where MAX(m, n) = the maximum of m and n

(a) Let s be the following element of BT:

2029_figure4.jpg

Draw the trees
(i) MAKE(Ø, 9, RIGHT(s))
(ii) MAKE(RIGHT(LEFT(s)), ROOT(RIGHT(s)), LEFT(LEFT(s)))

(b) A function F : BT → N is defined as below. F(t) = 0 if t = Ø
F(t) = ROOT(t) if t ≠ Ø and LEFT(t) = RIGHT(t) = Ø
F(t) = F(LEFT(t)) + F(RIGHT(t)) otherwise

Evaluate F(s) where s is the tree in part (a).

Describe the general effect of F on any tree in BT.

(c) The function ROOTMAX : BT → BT replaces the root of an input tree t with the maximum of the roots of the left and right subtrees of t (provided that L(t) ≠ Ø and R(t) ≠ Ø). Give a description, in terms of the basic primitive functions above, of the function ROOTMAX.

Problem 7

The following algorithm, bubblesort, sorts a list of n integers into increasing order by successively comparing adjacent elements and interchanging them if they are in the wrong order.

Input x1, x2, x3, ..., xn ;
begin
for i := 1 to (n - 1) do
for j := 1 to (n - i) do if xj > xj+1 then
begin
temp:= xj ;
xj := xj+1 ;
xj+1 := temp ;
end
else {do-nothing};
end
Output 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 the number of times the comparison

xj > xj+1 is made for a general positive input n. Show that T(n) is O (n2 ).

(c) Another sorting algorithm requires 3n log2 n comparisons to sort a list of n integers into ascending order. Is this algorithm more efficient than bubblesort? Briefly justify your answer.

Reference no: EM132502380

Questions Cloud

Explain the different psychological theories : We have been looking at different psychological theories and the way we can use them to better examine social media. For this assignment use Michelle Obama.
Prepare a contribution format income statement segmented : Prepare a contribution format income statement segmented by product lines. Royal Lawncare Company produces and sells two packaged products
Determining the total profit or loss : Suppose that you think May gold futures prices will rise over the course of today. Assume that the initial margin is $7,975 per contract, and the maintenance
What do you do when you are faced with adversity : Proverbs 24:10 says, "If you are slack in the day of distress, your strength is limited." What do you do when you are faced with adversity? 250 Word Minimum.
MATH4004 Mathematics for Computing Assignment : MATH4004 Mathematics for Computing Assignment Help and Solution, Oxford Brookes University - Assessment Writing Service
Risk-free arbitrage strategy : Today is early January. You have corn in storage. The corn futures contract is on 5,000 bu. of yellow corn. You have the following price information.
Discuss quotes and tie concepts back to biblical principles : Discuss at least one of the following quotes and tie their concepts back to biblical principles: You say you're all dark and twisty, it's not a flaw.
How can employees control labor costs : How can employees control labor costs? Have you ever seen this put into practice? If so, how did it work, and if not, how do you think it would work best?
Discuss the pay policies in brief : Write a 2-page (minimum 500 words) response to the following questions. Include in your answer how this week's scripture guides our understanding of employee.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd