Explanation of the different types of relation that exist

Post New Homework

7WCM1078 Computational Algorithms and Paradigms

Assessment - Question 1

Various procedures may be followed in order to solve a problem. Two such procedures are the HTTLAP procedure and Polya's procedure.

a) Compare and contrast Polya's procedure for solving problems, with another procedure (of your own choosing), that has also been developed for solving problems. Include an explanation for each part of the Polya procedure.

The Tower of Hanoi is a game for two players. It consists of ‘n' discs of various size located on one of ‘p' posts. Each disc is of different size to each of the other discs and are initially arranged on a post with the largest disc on the bottom of the stack, with smaller discs only allowed to rest on a disc of larger size.

In this question I would like you to consider the Tower of Hanoi problem with p = 4.

b) Using the HTTLAP procedure or otherwise derive appropriate procedural algorithms, (using, if possible, an appropriate formula, or 'not using a formula') for the tower of Hanoi problem with 4 posts. Provide a final completed solution in pseudo-code.

c) Compare and contrast the approach taken above with the tower of Hanoi problem to one that would be generated in another paradigm of your own choosing. Would recursion be possible here?

Question 2

The Functional paradigm was introduced in the 1960's to address a range of different types of problem from a range of different disciplines. Two such disciplines were symbolic computation and natural language processing. Initial functional programming languages such as LISP have been described as examples of impure rather than pure functional languages.

a) Compare and contrast the pure functional paradigm to two of the following:
i. object oriented paradigm
ii. logic paradigm
iii. quantum paradigm

Following your initial observations on the two paradigms extend your discussion to include

iv. Source, domain, range and codomain. Include an explanation of the different types of relation that exist between such sets with examples for each type of relation
v. the representation of states in classical and quantum paradigms

b) Using an example of your own describe how Lisp or Haskell could be used to accomplish a task involving
i. functional composition, and
ii. recursion.

c) The Linear Search Algorithm and the Binary Search Algorithm are two examples of algorithms that can be used to find a particular value within a finite collection of numeric data. Explain what is meant by a linear search algorithm and a binary search algorithm. Establish the worst case complexity for each of these algorithms. Justify your answers.

d) Calculate McCabes cyclotomic complexity metric for the following code segments:

i. a for loop followed by a do-while loop
ii. a do-while loop containing a nested if control structure

Include appropriate flowcharts for each code segment.

Attachment:- Computational Algorithms and Paradigms.rar

Post New Homework
Captcha

Looking tutor’s service for getting help in UK studies or college assignments? Order Now