SlideShare a Scribd company logo
Unit 8: Algorithms - Assignment
Total points for Assignment: 35 points. Assignments must be
submitted as a Microsoft Word document and uploaded to the
Dropbox for Unit 8. All Assignments are due by Tuesday at
11:59 PM ET of the assigned Unit.
NOTE: Assignment problems should not be posted to the
Discussion threads. Questions on the Assignment problems
should be addressed to the instructor by sending an email or by
attending office hours.
You must show your work on all problems. If a problem is
worth 2 points and you only show the answer, then you will
receive only 1 point credit. If you use a calculator or online
website, give the source and tell me exactly what you provided
as input. For example, if you used Excel to compute 16 * 16,
state “I typed =16*16 into Excel and got 256. You may type
your answer right into this document.
Part I. Basic Computations
1. (5 points) Consider the following pseudo code for
determining any sum in this form:
ComputeSum:
INPUT m
sum = 0
for k = 6 to m do
sum = sum + 5*k^2 + 2*k -10
next k
OUTPUT sum
a. Are the inputs and outputs for this algorithm well defined?
Explain.
b. Identify an iterative operation in this algorithm.
2. ( 5 points) Consider this algorithm used to sort an array in
this form:
5
8
6
3
5
1
6
19
7
4
S(n) =
BUBBLESORT:
INPUT S, n (an array called S, with n elements)
FOR i = 1 to n – 1
FOR j = 1 to n – 1
if S(j) > S(J+1) then
exchange the contents of S(j) with S(j+1)
NEXT
NEXT
OUTPUT S
Using the following grid, show a trace for this algorithm using
the following values:
Part II. Case Study Season Finale: Unlocking the
Treasure
The directors and producers of the “Patty Madeye Mysteries”
have decided that the season finale for the show will be filmed
in a secret location. They have identifed a remote island and
visited it to determine what facilities and features are available
on the island. The interns that were sent to scout out the island
only had time to draw this map of the island and collect some
other information.
In order to open the lock to the treasure chest, you will need to
solve a puzzle using discrete math. Shown below are the paths
and distances that connect the 7 locations on the map.
From
To
Distance
(in meters)
C
D
80
D
E
25
E
G
80
D
G
80
D
A
100
A
F
80
A
G
80
B
A
25
C
B
25
C
E
100
B
E
100
G
F
25
B
F
80
A
C
80
Clue #1: (3 points) One of the things that the film crew will
need to know about is the condition of light during the day at
the island. The only marking on the island was this binary
representation of the longitude. Convert this longitude to
decimal so that the crew can estimate time of sunrise and
sunset. Show your work.
Longitude:
Answer: =Bin2Dec(10010100) the answer is 148
Clue #2. (3 points) The cast and crew will be staying in the 8
tents shown in the Tent Village. Two of the tents will be set
aside for to be used for “Hair and Makeup” (one for the males,
one for the females). How many different ways can you select
these special tents out of the 8 available?
Answer: =COMBIN(8,2) the answer is 28
Clue #3. (3 points) Since the natives on this remote island
only speak Spanish, it is important to know how many people in
the cast & crew of 56 people. The producers have provided the
following information and asked you to prepare a Venn Diagram
depicting the various sets and subsets of this group.
F = {members of the film crew}
S = {members of the cast & crew who speak Spanish}
M = {male members of the cast & crew}
X - n(F) = 10
ok - n(S) = 14
X - n(M) = 15
X - n(F and S) = 4
X - n(F and M) = 5
n(M and S and F) = 3
n(M or S or F) = 28
How many members of the cast & crew are male and speak
Spanish, but are NOT on the Film Crew?
Answer: 7
Clue #4. (3 points) A strange children’s game was found on
the island with the following markings:
53
56
59
62
…
Determine the 20th element of the sequence using the general
term for the sequence.
Answer 3*16 the number of boxes needed to be determined
added to the 62 the last number determined 62. The answer (
110 )
Clue #5. (3 points) This clue requires solving a logic problem:
p: cast member is male
q: cast member speaks Spanish
r: cast member has short hair
s: it is NOT raining
If a cast member is male and has short hair, does not speak
Spanish, and it is raining, determine the truth value for the
following expression:
=
Answer:
Clue #6. (3 points) To solve this clue, you must determine if
there exists an Euler path or Euler circuit between the 7
locations on the island. If so, describe it. If not, explain how
you know that such a path or circuit does not exist.
Answer: The image drawn around the map shows this island to
be a ( euler circuit ) because every locations could be visited
exactly once
Clue #7. (2 points) Determine a Minimum Spanning Tree for
the graph described by the paths on the island, using the
distances between the locations as weights.
What is the weight of the resulting spanning tree?
Answer:
Clue #8. (5 points) Record your clues here, then use the
following algorithm to determine the 5 digit combination to
unlock the treasure.
Clue #1:
Longitude expressed in decimal: 148
Clue #2:
Number of combinations:28
Clue #3:
n(M + S +~F)
7
Clue #4:
110
Clue #5:
Truth Value
Clue #6:
Path, Circuit, or None?
Clue #7:
Weight of spanning tree:
DIGIT1
DIGIT2
DIGIT3
DIGIT4
DIGIT5
148
28
7
110
To unlock the treasure, you must determine the combination for
the lock:
DIGIT1 = 2
FOR i = 1 to Clue#3
DIGIT1 = DIGIT1 + 2
NEXT
DIGIT2 = (Clue#1 / 4) – Clue#2
IF Clue#4 = 71
THEN DIGIT3 = 4
ELSE DIGIT3 = 7
IF Clue#5 = True AND Clue #7 < 275
THEN DIGIT4 = 2
ELSE DIGIT4 = 1
IF Path exists in Clue #6
THEN DIGIT5 = 0
ELSE
IF Circuit exists in Clue #6
THEN DIGIT5 = 2
ELSE DIGIT5 = 8
Copyright 2010 – Kaplan University – All Rights Reserved
1 | Page
10010100
(~)(~)(~)
pqrssq
ÙÚÙÅÙ
20
a
=
2
6
(5210)
m
k
kk
=
+-
å
{25,1,26,9,2)
5
S
n
=
=

More Related Content

Similar to Unit 8 Algorithms - AssignmentTotal points for Assignment 3.docx

Math10 q2 mod1of8_polynomial function_v2 (1)
Math10 q2 mod1of8_polynomial function_v2 (1)Math10 q2 mod1of8_polynomial function_v2 (1)
Math10 q2 mod1of8_polynomial function_v2 (1)
FahadOdin
 
Math10 q2 mod1of8_polynomial function_v2 (2)
Math10 q2 mod1of8_polynomial function_v2 (2)Math10 q2 mod1of8_polynomial function_v2 (2)
Math10 q2 mod1of8_polynomial function_v2 (2)
FahadOdin
 
Discrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryDiscrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata Theory
Mark Simon
 
ECES302 Exam 1 Solutions
ECES302 Exam 1 SolutionsECES302 Exam 1 Solutions
ECES302 Exam 1 Solutions
Thomas Woo
 
Introduction to probability solutions manual
Introduction to probability   solutions manualIntroduction to probability   solutions manual
Introduction to probability solutions manual
Kibria Prangon
 
SAT-PAPER
SAT-PAPER SAT-PAPER
SAT-PAPER Haridh
 
tutorial5.ppt
tutorial5.ppttutorial5.ppt
tutorial5.ppt
jvjfvvoa
 
Practice Test 2 Solutions
Practice Test 2  SolutionsPractice Test 2  Solutions
Practice Test 2 Solutions
Long Beach City College
 
100 Combinatorics Problems (With Solutions)
100 Combinatorics Problems (With Solutions)100 Combinatorics Problems (With Solutions)
100 Combinatorics Problems (With Solutions)
Courtney Esco
 
N5 practice papers d f with solutions
N5 practice papers d   f with solutionsN5 practice papers d   f with solutions
N5 practice papers d f with solutions
sjamaths
 
Ib math slsummerassignment2014
Ib math slsummerassignment2014Ib math slsummerassignment2014
Ib math slsummerassignment2014
Michelle Eff
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewRoman Elizarov
 
Mathematics_D1_6689_01_que_20070605.pdf
Mathematics_D1_6689_01_que_20070605.pdfMathematics_D1_6689_01_que_20070605.pdf
Mathematics_D1_6689_01_que_20070605.pdf
MusaCaphe
 
H 2016 2018
H 2016   2018H 2016   2018
H 2016 2018
sjamaths
 
Mathematics 10.pptx
Mathematics 10.pptxMathematics 10.pptx
Mathematics 10.pptx
LEIDELCLAUDETOLENTIN1
 
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Vivekananda Samiti
 
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docxDivide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
jacksnathalie
 

Similar to Unit 8 Algorithms - AssignmentTotal points for Assignment 3.docx (20)

Math10 q2 mod1of8_polynomial function_v2 (1)
Math10 q2 mod1of8_polynomial function_v2 (1)Math10 q2 mod1of8_polynomial function_v2 (1)
Math10 q2 mod1of8_polynomial function_v2 (1)
 
Math10 q2 mod1of8_polynomial function_v2 (2)
Math10 q2 mod1of8_polynomial function_v2 (2)Math10 q2 mod1of8_polynomial function_v2 (2)
Math10 q2 mod1of8_polynomial function_v2 (2)
 
Discrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryDiscrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata Theory
 
ECES302 Exam 1 Solutions
ECES302 Exam 1 SolutionsECES302 Exam 1 Solutions
ECES302 Exam 1 Solutions
 
Introduction to probability solutions manual
Introduction to probability   solutions manualIntroduction to probability   solutions manual
Introduction to probability solutions manual
 
SAT-PAPER
SAT-PAPER SAT-PAPER
SAT-PAPER
 
tutorial5.ppt
tutorial5.ppttutorial5.ppt
tutorial5.ppt
 
Practice Test 2 Solutions
Practice Test 2  SolutionsPractice Test 2  Solutions
Practice Test 2 Solutions
 
100 Combinatorics Problems (With Solutions)
100 Combinatorics Problems (With Solutions)100 Combinatorics Problems (With Solutions)
100 Combinatorics Problems (With Solutions)
 
N5 practice papers d f with solutions
N5 practice papers d   f with solutionsN5 practice papers d   f with solutions
N5 practice papers d f with solutions
 
Ib math slsummerassignment2014
Ib math slsummerassignment2014Ib math slsummerassignment2014
Ib math slsummerassignment2014
 
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2013 NEERC (Northeastern European Regional Contest) Problems Review
 
Mathematics_D1_6689_01_que_20070605.pdf
Mathematics_D1_6689_01_que_20070605.pdfMathematics_D1_6689_01_que_20070605.pdf
Mathematics_D1_6689_01_que_20070605.pdf
 
H 2016 2018
H 2016   2018H 2016   2018
H 2016 2018
 
Math Gr4 Ch13
Math Gr4 Ch13Math Gr4 Ch13
Math Gr4 Ch13
 
Mathematics 10.pptx
Mathematics 10.pptxMathematics 10.pptx
Mathematics 10.pptx
 
algo1
algo1algo1
algo1
 
Sol1
Sol1Sol1
Sol1
 
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurProblem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT Kanpur
 
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docxDivide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
 

More from dickonsondorris

Copyright © eContent Management Pty Ltd. Health Sociology Revi.docx
Copyright © eContent Management Pty Ltd. Health Sociology Revi.docxCopyright © eContent Management Pty Ltd. Health Sociology Revi.docx
Copyright © eContent Management Pty Ltd. Health Sociology Revi.docx
dickonsondorris
 
Copyright © Pearson Education 2010 Digital Tools in Toda.docx
Copyright © Pearson Education 2010 Digital Tools in Toda.docxCopyright © Pearson Education 2010 Digital Tools in Toda.docx
Copyright © Pearson Education 2010 Digital Tools in Toda.docx
dickonsondorris
 
Copyright © Jen-Wen Lin 2018 1 STA457 Time series .docx
Copyright © Jen-Wen Lin 2018   1 STA457 Time series .docxCopyright © Jen-Wen Lin 2018   1 STA457 Time series .docx
Copyright © Jen-Wen Lin 2018 1 STA457 Time series .docx
dickonsondorris
 
Copyright © John Wiley & Sons, Inc. All rights reserved..docx
Copyright © John Wiley & Sons, Inc. All rights reserved..docxCopyright © John Wiley & Sons, Inc. All rights reserved..docx
Copyright © John Wiley & Sons, Inc. All rights reserved..docx
dickonsondorris
 
Copyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docx
Copyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docxCopyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docx
Copyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docx
dickonsondorris
 
Copyright © Cengage Learning. All rights reserved. CHAPTE.docx
Copyright © Cengage Learning.  All rights reserved. CHAPTE.docxCopyright © Cengage Learning.  All rights reserved. CHAPTE.docx
Copyright © Cengage Learning. All rights reserved. CHAPTE.docx
dickonsondorris
 
Copyright © by Holt, Rinehart and Winston. All rights reserved.docx
Copyright © by Holt, Rinehart and Winston. All rights reserved.docxCopyright © by Holt, Rinehart and Winston. All rights reserved.docx
Copyright © by Holt, Rinehart and Winston. All rights reserved.docx
dickonsondorris
 
Copyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docx
Copyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docxCopyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docx
Copyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docx
dickonsondorris
 
Copyright © 2019, American Institute of Certified Public Accou.docx
Copyright © 2019, American Institute of Certified Public Accou.docxCopyright © 2019, American Institute of Certified Public Accou.docx
Copyright © 2019, American Institute of Certified Public Accou.docx
dickonsondorris
 
Copyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docx
Copyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docxCopyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docx
Copyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docx
dickonsondorris
 
Copyright © 2018 Pearson Education, Inc. C H A P T E R 6.docx
Copyright © 2018 Pearson Education, Inc. C H A P T E R  6.docxCopyright © 2018 Pearson Education, Inc. C H A P T E R  6.docx
Copyright © 2018 Pearson Education, Inc. C H A P T E R 6.docx
dickonsondorris
 
Copyright © 2018 Capella University. Copy and distribution o.docx
Copyright © 2018 Capella University. Copy and distribution o.docxCopyright © 2018 Capella University. Copy and distribution o.docx
Copyright © 2018 Capella University. Copy and distribution o.docx
dickonsondorris
 
Copyright © 2018 Pearson Education, Inc.C H A P T E R 3.docx
Copyright © 2018 Pearson Education, Inc.C H A P T E R  3.docxCopyright © 2018 Pearson Education, Inc.C H A P T E R  3.docx
Copyright © 2018 Pearson Education, Inc.C H A P T E R 3.docx
dickonsondorris
 
Copyright © 2018 by Steven Levitsky and Daniel.docx
Copyright © 2018 by Steven Levitsky and Daniel.docxCopyright © 2018 by Steven Levitsky and Daniel.docx
Copyright © 2018 by Steven Levitsky and Daniel.docx
dickonsondorris
 
Copyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docx
Copyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docxCopyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docx
Copyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docx
dickonsondorris
 
Copyright © 2017 Wolters Kluwer Health Lippincott Williams.docx
Copyright © 2017 Wolters Kluwer Health  Lippincott Williams.docxCopyright © 2017 Wolters Kluwer Health  Lippincott Williams.docx
Copyright © 2017 Wolters Kluwer Health Lippincott Williams.docx
dickonsondorris
 
Copyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docx
Copyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docxCopyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docx
Copyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docx
dickonsondorris
 
Copyright © 2017 by University of Phoenix. All rights rese.docx
Copyright © 2017 by University of Phoenix. All rights rese.docxCopyright © 2017 by University of Phoenix. All rights rese.docx
Copyright © 2017 by University of Phoenix. All rights rese.docx
dickonsondorris
 
Copyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docx
Copyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docxCopyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docx
Copyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docx
dickonsondorris
 
Copyright © 2016 Pearson Education, Inc. .docx
Copyright © 2016 Pearson Education, Inc.                    .docxCopyright © 2016 Pearson Education, Inc.                    .docx
Copyright © 2016 Pearson Education, Inc. .docx
dickonsondorris
 

More from dickonsondorris (20)

Copyright © eContent Management Pty Ltd. Health Sociology Revi.docx
Copyright © eContent Management Pty Ltd. Health Sociology Revi.docxCopyright © eContent Management Pty Ltd. Health Sociology Revi.docx
Copyright © eContent Management Pty Ltd. Health Sociology Revi.docx
 
Copyright © Pearson Education 2010 Digital Tools in Toda.docx
Copyright © Pearson Education 2010 Digital Tools in Toda.docxCopyright © Pearson Education 2010 Digital Tools in Toda.docx
Copyright © Pearson Education 2010 Digital Tools in Toda.docx
 
Copyright © Jen-Wen Lin 2018 1 STA457 Time series .docx
Copyright © Jen-Wen Lin 2018   1 STA457 Time series .docxCopyright © Jen-Wen Lin 2018   1 STA457 Time series .docx
Copyright © Jen-Wen Lin 2018 1 STA457 Time series .docx
 
Copyright © John Wiley & Sons, Inc. All rights reserved..docx
Copyright © John Wiley & Sons, Inc. All rights reserved..docxCopyright © John Wiley & Sons, Inc. All rights reserved..docx
Copyright © John Wiley & Sons, Inc. All rights reserved..docx
 
Copyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docx
Copyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docxCopyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docx
Copyright © by The McGraw-Hill Companies, Inc. The Aztec Accou.docx
 
Copyright © Cengage Learning. All rights reserved. CHAPTE.docx
Copyright © Cengage Learning.  All rights reserved. CHAPTE.docxCopyright © Cengage Learning.  All rights reserved. CHAPTE.docx
Copyright © Cengage Learning. All rights reserved. CHAPTE.docx
 
Copyright © by Holt, Rinehart and Winston. All rights reserved.docx
Copyright © by Holt, Rinehart and Winston. All rights reserved.docxCopyright © by Holt, Rinehart and Winston. All rights reserved.docx
Copyright © by Holt, Rinehart and Winston. All rights reserved.docx
 
Copyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docx
Copyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docxCopyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docx
Copyright © 2020 by Jones & Bartlett Learning, LLC, an Ascend .docx
 
Copyright © 2019, American Institute of Certified Public Accou.docx
Copyright © 2019, American Institute of Certified Public Accou.docxCopyright © 2019, American Institute of Certified Public Accou.docx
Copyright © 2019, American Institute of Certified Public Accou.docx
 
Copyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docx
Copyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docxCopyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docx
Copyright © 2018 Pearson Education, Inc. All Rights ReservedChild .docx
 
Copyright © 2018 Pearson Education, Inc. C H A P T E R 6.docx
Copyright © 2018 Pearson Education, Inc. C H A P T E R  6.docxCopyright © 2018 Pearson Education, Inc. C H A P T E R  6.docx
Copyright © 2018 Pearson Education, Inc. C H A P T E R 6.docx
 
Copyright © 2018 Capella University. Copy and distribution o.docx
Copyright © 2018 Capella University. Copy and distribution o.docxCopyright © 2018 Capella University. Copy and distribution o.docx
Copyright © 2018 Capella University. Copy and distribution o.docx
 
Copyright © 2018 Pearson Education, Inc.C H A P T E R 3.docx
Copyright © 2018 Pearson Education, Inc.C H A P T E R  3.docxCopyright © 2018 Pearson Education, Inc.C H A P T E R  3.docx
Copyright © 2018 Pearson Education, Inc.C H A P T E R 3.docx
 
Copyright © 2018 by Steven Levitsky and Daniel.docx
Copyright © 2018 by Steven Levitsky and Daniel.docxCopyright © 2018 by Steven Levitsky and Daniel.docx
Copyright © 2018 by Steven Levitsky and Daniel.docx
 
Copyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docx
Copyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docxCopyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docx
Copyright © 2017, 2014, 2011 Pearson Education, Inc. All Right.docx
 
Copyright © 2017 Wolters Kluwer Health Lippincott Williams.docx
Copyright © 2017 Wolters Kluwer Health  Lippincott Williams.docxCopyright © 2017 Wolters Kluwer Health  Lippincott Williams.docx
Copyright © 2017 Wolters Kluwer Health Lippincott Williams.docx
 
Copyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docx
Copyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docxCopyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docx
Copyright © 2016, 2013, 2010 Pearson Education, Inc. All Right.docx
 
Copyright © 2017 by University of Phoenix. All rights rese.docx
Copyright © 2017 by University of Phoenix. All rights rese.docxCopyright © 2017 by University of Phoenix. All rights rese.docx
Copyright © 2017 by University of Phoenix. All rights rese.docx
 
Copyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docx
Copyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docxCopyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docx
Copyright © 2016 John Wiley & Sons, Inc.Copyright © 20.docx
 
Copyright © 2016 Pearson Education, Inc. .docx
Copyright © 2016 Pearson Education, Inc.                    .docxCopyright © 2016 Pearson Education, Inc.                    .docx
Copyright © 2016 Pearson Education, Inc. .docx
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 

Unit 8 Algorithms - AssignmentTotal points for Assignment 3.docx

  • 1. Unit 8: Algorithms - Assignment Total points for Assignment: 35 points. Assignments must be submitted as a Microsoft Word document and uploaded to the Dropbox for Unit 8. All Assignments are due by Tuesday at 11:59 PM ET of the assigned Unit. NOTE: Assignment problems should not be posted to the Discussion threads. Questions on the Assignment problems should be addressed to the instructor by sending an email or by attending office hours. You must show your work on all problems. If a problem is worth 2 points and you only show the answer, then you will receive only 1 point credit. If you use a calculator or online website, give the source and tell me exactly what you provided as input. For example, if you used Excel to compute 16 * 16, state “I typed =16*16 into Excel and got 256. You may type your answer right into this document. Part I. Basic Computations 1. (5 points) Consider the following pseudo code for determining any sum in this form: ComputeSum: INPUT m sum = 0 for k = 6 to m do sum = sum + 5*k^2 + 2*k -10 next k OUTPUT sum a. Are the inputs and outputs for this algorithm well defined? Explain.
  • 2. b. Identify an iterative operation in this algorithm. 2. ( 5 points) Consider this algorithm used to sort an array in this form: 5 8 6 3 5 1 6 19 7 4 S(n) = BUBBLESORT: INPUT S, n (an array called S, with n elements) FOR i = 1 to n – 1 FOR j = 1 to n – 1 if S(j) > S(J+1) then exchange the contents of S(j) with S(j+1) NEXT NEXT OUTPUT S Using the following grid, show a trace for this algorithm using the following values:
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Part II. Case Study Season Finale: Unlocking the Treasure The directors and producers of the “Patty Madeye Mysteries” have decided that the season finale for the show will be filmed in a secret location. They have identifed a remote island and visited it to determine what facilities and features are available on the island. The interns that were sent to scout out the island only had time to draw this map of the island and collect some other information. In order to open the lock to the treasure chest, you will need to solve a puzzle using discrete math. Shown below are the paths
  • 9. and distances that connect the 7 locations on the map. From To Distance (in meters) C D 80 D E 25 E G 80 D G 80 D A 100 A F 80 A G 80 B A 25 C B 25 C E 100 B
  • 10. E 100 G F 25 B F 80 A C 80 Clue #1: (3 points) One of the things that the film crew will need to know about is the condition of light during the day at the island. The only marking on the island was this binary representation of the longitude. Convert this longitude to decimal so that the crew can estimate time of sunrise and sunset. Show your work. Longitude: Answer: =Bin2Dec(10010100) the answer is 148 Clue #2. (3 points) The cast and crew will be staying in the 8 tents shown in the Tent Village. Two of the tents will be set aside for to be used for “Hair and Makeup” (one for the males, one for the females). How many different ways can you select these special tents out of the 8 available? Answer: =COMBIN(8,2) the answer is 28
  • 11. Clue #3. (3 points) Since the natives on this remote island only speak Spanish, it is important to know how many people in the cast & crew of 56 people. The producers have provided the following information and asked you to prepare a Venn Diagram depicting the various sets and subsets of this group. F = {members of the film crew} S = {members of the cast & crew who speak Spanish} M = {male members of the cast & crew} X - n(F) = 10 ok - n(S) = 14 X - n(M) = 15 X - n(F and S) = 4 X - n(F and M) = 5 n(M and S and F) = 3 n(M or S or F) = 28 How many members of the cast & crew are male and speak Spanish, but are NOT on the Film Crew? Answer: 7 Clue #4. (3 points) A strange children’s game was found on the island with the following markings: 53 56 59 62 … Determine the 20th element of the sequence using the general term for the sequence.
  • 12. Answer 3*16 the number of boxes needed to be determined added to the 62 the last number determined 62. The answer ( 110 ) Clue #5. (3 points) This clue requires solving a logic problem: p: cast member is male q: cast member speaks Spanish r: cast member has short hair s: it is NOT raining If a cast member is male and has short hair, does not speak Spanish, and it is raining, determine the truth value for the following expression: = Answer: Clue #6. (3 points) To solve this clue, you must determine if there exists an Euler path or Euler circuit between the 7 locations on the island. If so, describe it. If not, explain how you know that such a path or circuit does not exist. Answer: The image drawn around the map shows this island to be a ( euler circuit ) because every locations could be visited exactly once Clue #7. (2 points) Determine a Minimum Spanning Tree for the graph described by the paths on the island, using the distances between the locations as weights.
  • 13. What is the weight of the resulting spanning tree? Answer: Clue #8. (5 points) Record your clues here, then use the following algorithm to determine the 5 digit combination to unlock the treasure. Clue #1: Longitude expressed in decimal: 148 Clue #2: Number of combinations:28 Clue #3: n(M + S +~F) 7 Clue #4: 110 Clue #5: Truth Value Clue #6:
  • 14. Path, Circuit, or None? Clue #7: Weight of spanning tree: DIGIT1 DIGIT2 DIGIT3 DIGIT4 DIGIT5 148 28 7 110 To unlock the treasure, you must determine the combination for the lock: DIGIT1 = 2 FOR i = 1 to Clue#3 DIGIT1 = DIGIT1 + 2 NEXT DIGIT2 = (Clue#1 / 4) – Clue#2 IF Clue#4 = 71 THEN DIGIT3 = 4 ELSE DIGIT3 = 7
  • 15. IF Clue#5 = True AND Clue #7 < 275 THEN DIGIT4 = 2 ELSE DIGIT4 = 1 IF Path exists in Clue #6 THEN DIGIT5 = 0 ELSE IF Circuit exists in Clue #6 THEN DIGIT5 = 2 ELSE DIGIT5 = 8 Copyright 2010 – Kaplan University – All Rights Reserved 1 | Page 10010100 (~)(~)(~) pqrssq ÙÚÙÅÙ 20 a = 2 6 (5210) m k kk = +- å {25,1,26,9,2) 5