COS1000S Computer and Logic Essentials Assignment

Assignment Help Theory of Computation
Reference no: EM132893961

COS1000S Computer and Logic Essentials - Swinburne University of Technology

Aim

This assessment task allows you to demonstrate your problem solving ability on problems covering counting, algorithms, complexity and graphs.

Questions

Counting

1. After a year of not doing much, everyone has decided to get active. We thought about this in assignment 1 as well.
For all parts of this question, working is required, including combinatoric/factorial notation as needed as well as final answers.

a) During a given day, there are many activities that could be done, such as:

• go shopping
• get an immunisation
• visit the gym
• go to a tutorial
• join a virtual student event.

Assume that each activity is undertaken at most once a day (i.e., so once you have visited the gym you don't visit it again). The amount of time spent on each activity is also unimportant, however, for example, shopping before a tutorial and a tutorial before shopping should be considered different. We are interested in working out the different ways people spend their day.

i.How many di fferent activity patterns can be formed from those five activities? ii.How many patterns contain only three activities (e.g., shop - immunisation - gym)? iii.How many patterns with at least four di fferent activities start with going shopping?

b) You have twelve friends that you haven't seen in a year that you would like to meet up with. For parts i-iii, your reasoning needs to be explained in a sentence or two; 0 marks will be awarded for a number or expression alone.

i. You have won a voucher for 5 people to go indoor rockclimbing. How many options are there for inviting your friends to join you?
ii. All twelve friends are invited to meet you at an outdoor gym for some exercise at a particular time. How many outcomes are there from this invite?
iii. With eleven friends, you are going to a concert in the city but are required to sit in pods of four at the venue. How many different ways can the pods be organised?
iv. Show a second approach to your answer to iii.

c) After all these social activities, you decide you probably should do some cleaning at home, and put together a schedule for the next month (30 days). You don't clean more than once a day. If you have 20 cleaning sessions planned, explain using the counting principles covered in class how this means you will clean on consecutive days at least once in the next month.

Algorithms

2. You have been given a file with two columns: a name and an integer (whole number) representing how many times the person with that name has used the Swinburne app to sign on to visit campus this year. The file will look something like:
Aakaansh 10
Aaron 25
Erika 0
Linh 15
...

It is not known at the outset how many rows are in the file, however the file will be terminated by EOF (end of file).
a) Draw a flowchart (following the conventions used in class) that reads the file and then calculates and prints the number of students that have applied to visit campus more than 24 times this year.

b) What is the likely complexity of your program using big-O notation? Clearly point out what the primary parameters are and define your terms.

in the lecture, to calculate the nth value in the sequence mystery(n) = -4 ∗ mystery(n - 1) -

3. Write a recursive function mystery(n), using the pseudocode principles covered 4 ∗ mystery(n - 2), where mystery(0) = 1 and mystery(1) = -2. You may also assume that n will be greater than or equal to 0 - error checking is not needed.

Submission of actual code (e.g., in Ruby or Python or any other programming language) will be awarded zero marks - we are seeking pseudocode. Answers using iteration will be marked on pseudocode alone and cannot receive full marks.

Graphs and trees

4. Using the following graph representation (G(V,E,w)):
V = {1, 2, 3, 4, 5, 6, 7}
E = {{1, 3}, {1, 5}, {1, 7}, {2, 3}, {2, 4}, {2, 6}, {3, 4}, {3, 5}, {3, 7} {5, 7}, {6, 7}}
W (1, 3) = 2, W (1, 5) = 7, W (1, 7) = 19
W (2, 3) = 12, W (2, 4) = 9, W (2, 6) = 16
W (3, 4) = 4, W (3, 5) = 5, W (3, 7) = 20
W (5, 7) = 18, W (6, 7) = 11
a) Draw the graph including weights.

b) Given the following algorithm for finding a minimum spanning tree for a graph:
Given a graph (G(V,E)) create a new graph (F) with nodes (V) and no edges
Add all the edges (E) to a set S and order them by weight starting with the minimum weight While S is not empty and all the nodes V in F are not connected:
Remove the edge s from set S with the lowest weight When s is added to F:
If it does not cause a cycle to form, keep it Else discard it from F
Using your graph from a) as G,

i. Provide the order of the edges as they are removed from S, and note whether it is kept or discarded.
ii. Draw the resulting spanning tree F.

Probability

5. A game has been set up that requires players to pay money to play, where the outcome will be determined by drawing cards from a standard 52 card pack.

a) Players pay $10 to play by drawing one single card. If they draw a red face card, they win $50; if they draw a black card, they win $20. Any other cards means that the player wins nothing.

i. If the deck is fair, what is the expected value?

ii. What value (to the nearest cent) should players pay to make the game fairer?

b) As a further challenge, the game is changed so that the player takes three cards. In this variant, the player still pays $10 to play, but must have selected three red face cards to win $50, and exactly two red cards and one black card to win $20.

What is the expected value in this case? Use counting notation as part of your working.

Attachment:- Computer and Logic Essentials.rar

Reference no: EM132893961

Questions Cloud

Subprime Lending-Greed-Faith and Disaster : Subprime mortgages targeted lower-income Americans, new immigrants, and people who had poor credit history.
Principles of organization and management : Create a personal memo to discuss how these concepts may relate to your dissertation research.
Calculate company WACC : Financing source Book Value short term debt 3,300,000. Calculate company's WACC based on above information
What is bad boys cost of capital : If Bad Boys, Inc. raises capital using 45% debt, 5% preferred stock, and 50% common stock, what is Bad Boys, Inc.'s cost of capital?
COS1000S Computer and Logic Essentials Assignment : COS1000S Computer and Logic Essentials Assignment Help and Solution, Swinburne University of Technology - Assessment Writing Service
The changing business environment : The changing business environment and the pressures for change. Resistance to change and how to overcome it.
Calculate Maria net pay : This non-cash taxable benefit is $19.00 per pay. Calculate Maria's net pay, following the steps in the payroll calculation template
Brainstorming with affinity diagram : Complete the affinity diagram action steps outlined in the "Brainstorming With an Affinity Diagram" resource
Risks associated with pursuing such strategy : A firm based in California wants to export a shipload of finished lumber to the Philippines. What are the risks associated with pursuing such a strategy?

Reviews

Write a Review

Theory of Computation Questions & Answers

  Finite-state machine design

Create a finite-state machine design to turn your FPGA development board into a simple programmable music box.

  Redundant sequence identi cation

Redundant sequence identi cation

  Compute a shortest superstring

Dynamic programming algorithm to compute a shortest superstring.

  Propositional and predicate logic

Write down a structural induction principle for the PlayTree free type

  Design a syntactic analyzer

Design a syntactic analyzer for the language specified by the grammar

  Design unambiguous grammar to parse expressions

Write a program would read two numbers and then print all numbers between the first and the second, inclusive. Design unambiguous grammar to parse expressions

  Consider a logic function with three outputs

Consider a logic function with three outputs,  A ,  B , and  C , and three inputs,  D ,  E , and  F . The function is defined as follows:  A  is true if at least one input is true,  B  is true

  Considering a single programmed operating system

Considering a single programmed operating system, what is the minimal total time required to complete executions of the two processes? You should explain your answer with a diagram.

  How to construct an nfa

Give a construction that assumes you are given a DFA for L and show how to construct an NFA (with or without ε-moves) to recognize sort(L).

  Equivalence classes to construct minimal dfa for language

How many equivalence classes does this relation have and what are they? Use these equivalence classes to construct the minimal DFA for the language.

  Impact of moore-s law on data center costs

Discuss the impact of Moore's law on data center costs on such things as servers and communications equipment. List at least 3 steps or recommendations your data center can take to offset some or all of the effect of Moore's law.

  Problem encountered in statements in predicate logic

How the problem would be encountered in attempting to represent the following statements in Predicate logic. it should be possible to: John only likes to see French movies.

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