Describe how your algorithm would change

Assignment Help Other Subject
Reference no: EM133141532

7WCM1078 Computational Algorithms and Paradigms

Question 1

‘Connect 4' is a game for two players. It consists of a 6x7 vertical grid into which a red or a yellow disc is placed by each player in turn. Each of the players take turns to place their coloured disc into the grid. The object of the game is to be the first to obtain a (winning) straight line consisting of their set of symbols, these being either 4 red discs or 4 yellow discs.

Using each stage of the HTTLAP procedure (or Polyas approach)

a) Establish the number of winning lines when playing Connect 4 on a 6 x 7 board. Include each of the stages from HTTLAP (or Polya) in your solution.

b) Extend your solution to describe the numberof winning lines when playing Connect 4 on an m x n grid, where m and n are positive whole numbers. Again, include each of the stages from HTTLAP (or Polya) in your solution.

c) How would your algorithm change for Connect P, in which a winning line is p units long?

d) Explore the game of Connect P played on a three-dimensional k x l x m grid, given that a winning (straight) line is P units long consisting of either red discs or yellow discs.

Include at least one imperative solution to the problem, either using control structures or using formulae.

e) Describe how your algorithm would change if your solution was developed in a different paradigm to the above. Would recursion work here? Justify.

Question 2

The Random Access Machine (RAM) is a hypothetical computer used as a model to estimate the run time of an algorithm. During our discussions on RAM we met the concepts of worst case, best case and average case complexity. Relating to these we met the O, Ω, and Θ notations.

a) Explain what is meant by a Random Access Machine and what is meant by the O, Ω, and Θ notations. Include diagrams where appropriate.

b) Given that f(n) = 5n9 - 100 n3 + 27 show that f(n) = Ο(n11). Use the O definition for O(n11).

c) Draw flowcharts for the following control structures:

i. a for loop followed by an if control structure
ii. a while loop containing a nested for loop with an internal nested do-while loop
Calculate McCabes Cyclotomic complexity metric for each of the code segments described.

d) The quantum paradigm is a relatively recent paradigm enabling developers to create analogues of classical based algorithms and to solve previously intractable problems using quantum based algorithms.

a. using a search engine of your own choosing find one example for a quantum based analogue of a classical algorithm and one example of a quantum based algorithm used to solve a previously intractable problem.

b. Compare the quantum paradigm to one of the following:
i. object orientated paradigm
ii. logic paradigm
iii. functional paradigm

e) Using an example of your own describe how either:

i. Haskell could be used to accomplish a task involving functional composition
or
ii. Lisp could be used to accomplish a task involving recursion.

Attachment:- Def Assignment.rar

Reference no: EM133141532

Questions Cloud

Prepare the journal entry to record pension related activity : The city of Stewart contributed $1,600,000 cash to the pension plan. Prepare the journal entry to record the pension related activity
Calculate the direct material quantity variances : Actual production was 15,000 barrels - this was 2,000 barrels less than planned. Calculate the Direct Material Quantity (Efficiency) Variances
Compare and contrast polyas procedure for solving problems : Explanation of the different types of relation that exist between such sets with examples for each type of relation - Calculate McCabes cyclotomic complexity
Calculate bodnar company breakeven revenues : Sara Oves, Bodnar's president, is very concerned about Bodnar Company's poor profitability. Calculate Bodnar Company's breakeven revenues
Describe how your algorithm would change : Describe how your algorithm would change if your solution was developed in a different paradigm to the above. Would recursion work here? Justify
What is the required rate of return of the portfolio : What is the required rate of return of the portfolio held by Bulldogs Inc. if the nominal rate of the short-term government issued security is 2.25%
Calculate McCabes cyclotomic complexity metric : Calculate McCabes cyclotomic complexity metric - Compare and contrast the approach taken above with the tower of Hanoi problem to one that would be generated
Calculate the net profit to dudley savings bank : Given your answer to part (a), calculate the net profit to Dudley Savings Bank if the price of the futures contracts decreases to 104 - 280
Show journal entries to implement the transactions : At that date, a further call of $2 on ordinary shares and $1 on preference shares was made. Show journal entries to implement the transactions

Reviews

Write a Review

Other Subject Questions & Answers

  Discuss the types of information listed in the order

Next rank the ten types of information listed in the order you think they should be handled when making decisions about the new market area.

  Describe how the health insurance industry affected health

Describe how the topic has affected the costs of health care in the US

  What is the volume of medication to be given dose available

What is the volume of medication to be given dose available is 75 MCG 2 times a day andthe volume available is 50mcg (0.05mg).

  Why cognitive behavioral treatment model works well

Why Cognitive Behavioral Treatment Model works well with a widow woman who is starting to drink heavily and neglecting her children after her husband died.

  Relationship between government and the marketplace

What events marked major historical turning points in the relationship between government and the marketplace?

  Cyclical progression of our earth history

Having studied thermohaline and the cyclical progression of our earth's history; how can this possibly affect the world in the near future?

  Managing communication issues paper

Discuss communication problems that occur in the External environment, such as media or the public. Explain how technology can play a role in facilitating

  Prepare employee security awareness training presentation

You are employees in an information security (IS) Department. Make sure to provide an overview of the ficticious company you are basing this presentation.

  Examine role of the paradigm shift under affordable care

analyze the role of the paradigm shift under the affordable care act and discuss how transparency will play a greater

  Discuss historical development of communication technologies

Effective communication is essential for successful police professionals and law enforcement organizations. Discuss the historical development of communication technologies and explain any pros and/or cons of these technological advances.

  How effective internal control structure assists management

FNSACC506 Implement and maintain internal control procedures Assignment. Explain how an effective internal control structure assists management

  Challenges of groups with large numbers of members

What are some ways to deal with the challenges of groups with large numbers of members?

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