Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 12, Problem 35CRP
Explanation of Solution
Identify the points of non-determinism in the following
- It can be done by considering the statement “Select three numbers between 1 and 100.” This instruction is ambiguous as it does not clearly mention which of the three elements are selected.
- The condition for the selection of numbers is not provided in the statement.
- The three numbers should be selected by the user in such a way that the sum can be greater than 150 or less than 50.
- The selection of three numbers depends on the user.
- Consider another statement “Select one of the chosen numbers and give the number and give that number as the answer...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
3. Is the following algorithm deterministic? Explain your answer.
def mystery (Number):
if (Number > 0):
else:
Answer "yes"
pick a value less than 5 and give this number as the answer
Question-1
Friend's Party Circle:
There are a few friends living in the same area.
They have a party every weekend and the place
of party change each week. It is always a
lifficult task to select a place which is nearest
for everyone. They
advantage of Computer Science to solve this
problem.
all decided to take
Names of friends are Ahmed, Rehman, Careem,
Basit, Dawood, Ghani, and Farid. Ahmed lives
at 5 minutes' walk from rehman and at 10
minutes' walk from Careem. Careem lives at 3
minutes' walk from Dawood. Rehman lives at 4
minutes' walk from Basit and 2 minutes' walk
from Dawood. Dawood lives at two minutes'
walk from Farid. Ghani lives at 2 minutes' walk
from Basit.
a. If we represent a graph G = V (V, E) in
which set of vertices are home of each
Friend and an edge represents a path
between
two
homes.
Provide the
adjacency matrix of directed graph of
the graph G.
b. In above directed graph G. You are
required to devise an algorithm to find
all possible paths.
Algorithm Analysis
Start with 102 coins on a table, 98 showing heads and 4 showing tails. There are two ways to
change the coins:
• flip over any ten coins, or
• place n+ 1 additional coins, all showing tails, on the table where n is the number of heads
currently showing on the table.
For example, you might begin by flipping nine heads and one tail, yielding 90 heads and 12 tails,
then add 91 tails, yielding 90 heads and 103 tails.
(a) Model this situation as a state machine, carefully defining the set of states, the start state, and
the possible state transitions.
(b) Optionally, explain how to reach a state with exactly one tail showing.
(c) Consider the following derived variables:
C ::= the number of coins on the table H ::= the number of heads on the table
T::= the number of tails on the table C, ::= parity (C)
H2 ::= parity(H)
T2 ::= parity(T)
Here the parity : Z → {0,1} function is defined as parity(n) = 0 when n is even and 1
otherwise.
Which of these variables is strictly…
Chapter 12 Solutions
Computer Science: An Overview (12th Edition)
Ch. 12.1 - Prob. 1QECh. 12.1 - Prob. 2QECh. 12.1 - Prob. 3QECh. 12.1 - Prob. 4QECh. 12.2 - Prob. 1QECh. 12.2 - Prob. 2QECh. 12.2 - Prob. 3QECh. 12.2 - Prob. 4QECh. 12.2 - Prob. 5QECh. 12.3 - Prob. 1QE
Ch. 12.3 - Prob. 3QECh. 12.3 - Prob. 5QECh. 12.3 - Prob. 6QECh. 12.4 - Prob. 1QECh. 12.4 - Prob. 2QECh. 12.4 - Prob. 3QECh. 12.5 - Prob. 1QECh. 12.5 - Prob. 2QECh. 12.5 - Prob. 4QECh. 12.5 - Prob. 5QECh. 12.6 - Prob. 1QECh. 12.6 - Prob. 2QECh. 12.6 - Prob. 3QECh. 12.6 - Prob. 4QECh. 12 - Prob. 1CRPCh. 12 - Prob. 2CRPCh. 12 - Prob. 3CRPCh. 12 - In each of the following cases, write a program...Ch. 12 - Prob. 5CRPCh. 12 - Describe the function computed by the following...Ch. 12 - Describe the function computed by the following...Ch. 12 - Write a Bare Bones program that computes the...Ch. 12 - Prob. 9CRPCh. 12 - In this chapter we saw how the statement copy...Ch. 12 - Prob. 11CRPCh. 12 - Prob. 12CRPCh. 12 - Prob. 13CRPCh. 12 - Prob. 14CRPCh. 12 - Prob. 15CRPCh. 12 - Prob. 16CRPCh. 12 - Prob. 17CRPCh. 12 - Prob. 18CRPCh. 12 - Prob. 19CRPCh. 12 - Analyze the validity of the following pair of...Ch. 12 - Analyze the validity of the statement The cook on...Ch. 12 - Suppose you were in a country where each person...Ch. 12 - Prob. 23CRPCh. 12 - Prob. 24CRPCh. 12 - Suppose you needed to find out if anyone in a...Ch. 12 - Prob. 26CRPCh. 12 - Prob. 27CRPCh. 12 - Prob. 28CRPCh. 12 - Prob. 29CRPCh. 12 - Prob. 30CRPCh. 12 - Prob. 31CRPCh. 12 - Suppose a lottery is based on correctly picking...Ch. 12 - Is the following algorithm deterministic? Explain...Ch. 12 - Prob. 34CRPCh. 12 - Prob. 35CRPCh. 12 - Does the following algorithm have a polynomial or...Ch. 12 - Prob. 37CRPCh. 12 - Summarize the distinction between stating that a...Ch. 12 - Prob. 39CRPCh. 12 - Prob. 40CRPCh. 12 - Prob. 41CRPCh. 12 - Prob. 42CRPCh. 12 - Prob. 43CRPCh. 12 - Prob. 44CRPCh. 12 - Prob. 46CRPCh. 12 - Prob. 48CRPCh. 12 - Prob. 49CRPCh. 12 - Prob. 50CRPCh. 12 - Prob. 51CRPCh. 12 - Prob. 52CRPCh. 12 - Prob. 1SICh. 12 - Prob. 2SICh. 12 - Prob. 3SICh. 12 - Prob. 4SICh. 12 - Prob. 5SICh. 12 - Prob. 6SICh. 12 - Prob. 7SICh. 12 - Prob. 8SI
Knowledge Booster
Similar questions
- الفصل: الثاني الموضوع : واجب منزلي Assignment Question: (i): Given three numbers (numl, num2, and num3), write an algorithm to find and print the sumarrow_forwardNote:- Do not provide handwritten solution. Maintain accuracy and quality in your answer. Take care of plagiarism.Answer completely.You will get up vote for sure.arrow_forwardWrite a pricing algorithm for item A and the amount you bought. The algorithm shows the cost, including a sales tax of 6 percent.arrow_forward
- Question-1 Friend's Party Circle: There are a few friends living in the same area. They have a party every weekend and the place of party change each week. It is always a difficult task to select a place which is nearest for everyone. They all decided advantage of Computer Science to solve this problem. to take Names of friends are Ahmed, Rehman, Careem, Basit, Dawood, Ghani, and Farid. Ahmed lives at 5 minutes’walk from rehman and at 10 minutes' walk from Careem. Careem lives at 3 minutes' walk from Dawood. Rehman lives at 4 minutes' walk from Basit and 2 minutes' walk from Dawood. Dawood lives at two minutes' walk from Farid. Ghani lives at 2 minutes' walk from Basit. b. In above directed graph G. You are required to devise an algorithm to find all possible paths.arrow_forwardCheck Your Progress: 1. Write the algorithm to find the product of the two numbers.arrow_forwardIn what sense does it mean to "choose numbers at random"?arrow_forward
- Correct answer will be upvoted else downvoted. Computer science. You have two positive integers an and b. You can perform two sorts of tasks: a=⌊ab⌋ (supplant a with the integer part of the division among an and b) b=b+1 (increment b by 1) Track down the base number of activities needed to make a=0. Input The primary line contains a solitary integer t (1≤t≤100) — the number of experiments. The main line of the depiction of each experiment contains two integers a, b (1≤a,b≤109). Output For each experiment, print a solitary integer: the base number of activities needed to make a=0.arrow_forwardQUESTION 8 The following algorithm construct a sequence of positive whole numbers, which demonstrates the famous Collatz's conjecture: starting from any positive whole number, the sequence will eventually go down to 1. 1. input: positive integer x 2. i+0 3. repeat 3.1. i+i+1 3.2. if x is odd then 3.2.1. x (3 x x) + 1 else 3.2.2. x x+ 2 until x = 1 4. output i By tracing the algorithm, how many times does the algorithm perform Step 3.2.1. if the input is set to x = 6?arrow_forwardWrite an algorithm that lets the user enter several items prices (number of items is unknown)(when the user finishes he must enter - 1)then this algorithm computes and prints the following: -- Average price -- Highest and lowest price How many prices are above 100 -- How many prices are between 50 and 150arrow_forward
- A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a fish is swimming past if:there are four consecutive depth readings which form a strictly increasing sequence (such as 3 4 7 9) (which we will call "Fish Rising"), orthere are four consecutive depth readings which form a strictly decreasing sequence (such as 9 6 5 2) (which we will call "Fish Diving"), orthere are four consecutive depth readings which are identical (which we will call "Constant Depth").All other readings will be considered random noise or debris, which we will call "No Fish."Create a Python program called "fishfinder_firstname_lastname" that takes 1 input of string of 4 numbers separated with comma. Your program must display "Fish Rising", "Fish Diving.", "Fish At Constant Depth" or "No Fish".Example:30,10,20,20 Must display No…arrow_forward¬∀x∀y∃z P(x, y, z) has the same truth value as ___. Group of answer choices ¬∃x∃y∀z P(x, y, z) ∀x∀y∃z ¬P(x, y, z) ∃x∃y∀z P(x, y, z) ∃x¬∀y∃z P(x, y, z) ¬∀x∀y A(x, y) has the same truth value as ___. ∀x¬∃y A(x, y) ∃x¬∀y A(x, y) ∀x∀y ¬A(x, y) ∀x∃y ¬A(x, y) ¬∃x∀y∃z (x – y < z) has the same truth value as ___. ∀x∃y∀z (x – y ≥ z) ∀x∃y∃z (x – y ≥ z) ∃x∀y∃z (x – y < z) ∀x∃y∀z (x – y > z)arrow_forwardnumbers 4,5,6,7arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT