Question

In: Computer Science

Question: State if an algorithm (satisfying the formal definition of an algorithm) which is guaranteed to...

Question: State if an algorithm (satisfying the formal definition of an algorithm) which is guaranteed to find a solution exists or not for each of the following problems by filling the blanks with “Yes” (an algorithm guaranteed to find a solution exists) or “No” (an algorithm guaranteed to find a solution does not exist).

1. Finding the average height of a person in a group, given the height of each person in the group

2. Finding all factors of a finite integer

3. Finding if a triangle is scalene or not, when the coordinates of its vertices are given

4. Finding a path from the given start location to the given goal location in a finite maze (the number of junctions is finite and the length of path connecting any two junctions is also finite) that changes unpredictably at any time

Solutions

Expert Solution

SOLUTION:

Yes - an algorithm guaranteed to find a solution exists

No - an algorithm guaranteed to find a solution does not exist

1. Finding the average height of a person in a group, given the height of each person in the group

            YES

            Average height = Sum of all heights / number of people in the group

            Using the above formula in an algorithm, the solution to the question exists

2. Finding all factors of a finite integer

            YES

            Using the below algorithm, the solution to the question exists

Loop from i=1 to i<=n            //n is the finite integer

        if ( n modulus i = =0)

            then “i is factor of n”

3. Finding if a triangle is scalene or not, when the coordinates of its vertices are given

YES

            Using the below algorithm, the solution to the question exists

                        //ABC is the triangle whose coordinates of vertices are given

Calculate distance between AB

                        Calculate distance between BC

                        Calculate distance between CA

                                    if( AB != BC and BC != CA)

                                                then “Given triangle is Scalene triangle”

4. Finding a path from the given start location to the given goal location in a finite maze (the number of junctions is finite and the length of path connecting any two junctions is also finite) that changes unpredictably at any time

            NO

            There exists no algorithm which can guarantee a solution to the question, because the maze changes unpredictably at any time.

*****************************************************************

Please comment for any further help on this question.


Related Solutions

•Formal definition as a search problem (tic tac toe): –Initial state: ?? –Player(s): ?? –Actions(s): ??...
•Formal definition as a search problem (tic tac toe): –Initial state: ?? –Player(s): ?? –Actions(s): ?? –Result(s,a): ?? –(2nd ed.: Successor function: ?? –Terminal-Test(s): ?? –Utility function(s,p): ?? •E.g., win (+1), lose (-1), and draw (0) in tic-tac-toe.
5 A nurse studying evidence-based practice (EBP) reviews the formal definition. Which components are key to...
5 A nurse studying evidence-based practice (EBP) reviews the formal definition. Which components are key to EBP? (Select all that apply.) A Correct Incorrect Educational level of the clinician Rationale: B Correct Incorrect Clinician expertise Rationale: C Correct Incorrect Client values and preferences Rationale: D Correct Incorrect Barriers to practice change Rationale: E Correct Incorrect The latest research evidence Rationale:
Provide a formal proof of the correctness of the algorithm by Boruvka/Solllin for finding a MST.
Provide a formal proof of the correctness of the algorithm by Boruvka/Solllin for finding a MST.
Given the following state for the Banker's Algorithm
Given the following state for the Banker's Algorithm 5 processes PO through P4 3 resource types before assigning to any process. A has 5 instances: B has 6 Instances. C has 8 instances and D has 4.Allocation: the resources currently assigned to each process Max Claim: The maximum number of resource instances a process will need in order to complete. Determine the available vector
List some formal instituions for buisnesses in the state of Texas.
List some formal instituions for buisnesses in the state of Texas.
Question 1: Provide a detailed analysis of Huffman's algorithm, taking care to state any assumptions. (a)...
Question 1: Provide a detailed analysis of Huffman's algorithm, taking care to state any assumptions. (a) What problem is solved by Huffman coding? (b) What key property of the input does Huffman coding exploit? (c) Write pseudo-code for constructing a Huffman tree from a table of character frequencies. (d) Analyze the complexity of this algorithm. (e) Write C struct definitions for the data structures used by the algorithm. Question 2: Name and briefly describe a good algorithm for solving each...
Draw 3 resonance structures for NOCl and assign formal charges to each atom. State which resonance...
Draw 3 resonance structures for NOCl and assign formal charges to each atom. State which resonance structure is favored by formal charge.
Which Sorting algorithm are in place algorithm and which are not? Is it advantageous to design...
Which Sorting algorithm are in place algorithm and which are not? Is it advantageous to design in place sorting algorithm? How this in place term is related to the time complexity and space complexity of the program?
A. Rewrite the following rule base as a CFG and provide its formal definition ( S...
A. Rewrite the following rule base as a CFG and provide its formal definition ( S is the start state ) S → aSb | bAA A → b {aB} | a | Bc B → aB | c B. Generate the 10 smallest possible strings using the above rule base
State a possible definition for "small triangle" and comment on why such a definition eliminates the...
State a possible definition for "small triangle" and comment on why such a definition eliminates the counterexamples allowing SAS to be true on the sphere.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT