Question: Lesson 1 . 2 Permutations 3 ) The map of a local park is shown below. The dashed lines represent walking paths and stars represent
Lesson Permutations
The map of a local park is shown below. The dashed lines represent walking paths and stars represent the parks
entrance and exit. Assuming you want to walk directly from the park entrance to the park exit, that is you will
NOT retrace any point, how many options are there for you to take your walk? points
Use the following lines of code to answer their respective questions.
Parts a & b
for i : to do
print i
for j : to do
print j
for k : to do
print k
Parts c & d
for i : to do
for j : to do
for k : to do
print i j k
a Calculate the number of times the print statement is executed? Note that the for loops are sequential.
b What counting principle did you use?
c Calculate the number of times the print statement is executed? Note that the for loops are nested.
d What counting principle did you use
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
