Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ANSWER Q no1 1. (max 2 points) Prove that for any positive integer n, the permutation (n, n-1, reachable from (1,2,... ,n) ,1) is (1,

image text in transcribed

ANSWER Q no1

1. (max 2 points) Prove that for any positive integer n, the permutation (n, n-1, reachable from (1,2,... ,n) ,1) is (1, In/2])- 2. (max 3 points) To find out whether T is (d')-reachable from , one may apply bidirected search as follows: First generate all permutations that are (d,L1/2)-reachable from . Next generate all permutations that are (d,1/21)-reachable from . Finally, report YES" if the two generated sets intersect, and otherwise report "NO". Describe the algorithm using pseudocode; in particular, describe how the sets of per- mutations are generated. (You may assume the given arguments are valid: you need not implement error handling.) 3. (max 3 points) Implement the algorithm of the previous task using one of the following programming languages (using only standard libraries): C, C++, Java, Python. Show your code. Use your implementation to solve, for all d 1, 2, 4 and 1 = 1, 2, ,9, whether (9,8,...,1) is (d, l)-reachable from (1,2,...,9). Show the results as a 4 x 9 matrix. 1. (max 2 points) Prove that for any positive integer n, the permutation (n, n-1, reachable from (1,2,... ,n) ,1) is (1, In/2])- 2. (max 3 points) To find out whether T is (d')-reachable from , one may apply bidirected search as follows: First generate all permutations that are (d,L1/2)-reachable from . Next generate all permutations that are (d,1/21)-reachable from . Finally, report YES" if the two generated sets intersect, and otherwise report "NO". Describe the algorithm using pseudocode; in particular, describe how the sets of per- mutations are generated. (You may assume the given arguments are valid: you need not implement error handling.) 3. (max 3 points) Implement the algorithm of the previous task using one of the following programming languages (using only standard libraries): C, C++, Java, Python. Show your code. Use your implementation to solve, for all d 1, 2, 4 and 1 = 1, 2, ,9, whether (9,8,...,1) is (d, l)-reachable from (1,2,...,9). Show the results as a 4 x 9 matrix

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions