05-1 Algorithmic Thinking: Snyder Ch.10

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which of the following is NOT a key aspect of the 'Letter Algorithm' used by J.D. Bauby?

  • Assistant uses a computer to speak letters. (correct)
  • Repetition to spell words and sentences.
  • Bauby communicates by blinking.
  • Assistant points to letters.

In the context of the 'Letter Algorithm', what does one blink from J.D. Bauby signify?

  • Yes
  • No (correct)
  • Start Over
  • End of Sentence

What is a key characteristic of an algorithm, as opposed to other processes?

  • It always involves the use of numbers.
  • It is subjective and open to interpretation.
  • It is always executed by a computer.
  • It is a precise and systematic method. (correct)

When specifying an algorithm, the level of detail needed depends on what factor?

<p>The capabilities of the executor. (D)</p> Signup and view all the answers

How can the 'Letter Algorithm' be made faster?

<p>By asking the letters in frequency order. (D)</p> Signup and view all the answers

What is the primary distinction between an 'algorithm' and a 'program'?

<p>A program is an algorithm expressed in a programming language. (B)</p> Signup and view all the answers

Which of the following falls under 'Heuristic Processes'?

<p>Finding information using a search engine. (D)</p> Signup and view all the answers

What is the significance of 'definiteness' in the context of algorithm properties?

<p>It means every step of the algorithm must be precisely stated. (D)</p> Signup and view all the answers

Which of the following is NOT one of the five essential properties of an algorithm?

<p>Elegance (A)</p> Signup and view all the answers

What does the property of 'finiteness' ensure about an algorithm?

<p>It completes execution in a finite number of steps. (A)</p> Signup and view all the answers

In the context of algorithms, what does 'effectiveness' refer to?

<p>Each step of the algorithm can be practically executed. (D)</p> Signup and view all the answers

What is the significance of 'input specified' in the context of algorithm properties?

<p>The type and amount of input data must be known. (A)</p> Signup and view all the answers

What is the importance of 'output specified' in the context of algorithm properties?

<p>The type and amount of output data must be known. (B)</p> Signup and view all the answers

What would be the result of the given algorithm, assuming that <- means 'store the value':

x <- 6 counter <- 0 Repeat if x is greater than 0: x <- x - 3 counter <- counter + 1 Output the value of counter

<p>2 (D)</p> Signup and view all the answers

What happens if you try to compute a result with all the decimals of 20/3?

<p>It results in an endless loop. (C)</p> Signup and view all the answers

In the context of query evaluation, what does the algorithm do after scanning through the DocList and finding a document that matches all the words?

<p>Computes the rank of that document. (C)</p> Signup and view all the answers

What issue can arise when specifying algorithms in natural language?

<p>Natural languages can easily be ambiguous. (D)</p> Signup and view all the answers

According to the materials, what does it mean if a program does not work due to a 'bad algorithm'?

<p>It's a design error. (B)</p> Signup and view all the answers

What is the purpose of the 'translation software' provided by the designer of a programming language?

<p>To generate a binary form of the program. (A)</p> Signup and view all the answers

In the life cycle of a program, what is included in the 'Poblem definition' step?

<p>Defining the possible inputs. (B)</p> Signup and view all the answers

What characteristic defines an 'interpreter' in the context of programming languages?

<p>It executes statements within a memory-resident system. (B)</p> Signup and view all the answers

Algorithm Fact #1 states: Algorithms can be specified at different levels of detail. What mechanism is used to simplify the algorithmic description?

<p>Functions (B)</p> Signup and view all the answers

Which of the following is the most accurate description of Algorithm Fact #2?

<p>Algorithms always build on functionality previously defined and known to the user. (A)</p> Signup and view all the answers

In writing an algorithm to calculate compound interest, what does the arrow symbol <- signify?

<p>Assignment (A)</p> Signup and view all the answers

In creating an algorithm for compound interest, how does the algorithm indicate what the constraints are on the inputs?

<p>Document the required inputs and data types. (A)</p> Signup and view all the answers

In the compound interest algorithm, repeat if x is greater than 0, what would happen with the values: what happens if x is -2?

<p>The loop will be skipped. (C)</p> Signup and view all the answers

How does using formal languages improve algorithm specification compared to natural language?

<p>Formal languages express concepts precisely. (A)</p> Signup and view all the answers

What concept does indentation represent in the pseudocode representation of the compound interest calculation algorithm?

<p>The scope of repetition (C)</p> Signup and view all the answers

What is the significance of an algorithm's 'correctness-preserving properties'?

<p>They are how we explain why the algorithm works. (D)</p> Signup and view all the answers

In the life cycle of a program, which of the following is completed immediately before the 'Algorithm definition' step?

<p>Problem definition (C)</p> Signup and view all the answers

Consider an algorithm where the 'Effectiveness' property is not met. What is the direct consequence?

<p>The algorithm cannot be practically implemented. (B)</p> Signup and view all the answers

Which of the following scenarios would violate the 'Definiteness' property of an algorithm?

<p>The algorithm divides by zero, with no error handling. (C)</p> Signup and view all the answers

Consider compiling vs. interpretation. Which statement accurately describes only compilation?

<p>The translated program becomes a process. (D)</p> Signup and view all the answers

What is the most significant advantage of writing an algorithm in simplified every-day English instead of a programming language?

<p>It allows the writer to omit details. (A)</p> Signup and view all the answers

Consider the compounding interest algorithm:

Use variables A, n, r, Af Read A, n, r Af <- A Repeat n times Af <- Af * (1 + r) Write Af

How could this be improved to show input and output more explicitly?

<p>Add <code>Input: A, n, r</code> at the start and <code>Output: Af</code> at the end. (D)</p> Signup and view all the answers

If an algorithm satisfies 'finiteness', can it still be impractical for real-world use?

<p>Yes, if the number of steps is excessively large. (B)</p> Signup and view all the answers

Consider the properties of algorithms, specifically 'Definiteness' and 'Effectiveness'. Which of the following most accurately describes the relationship between them?

<p>'Definiteness' is necessary, but not sufficient, for 'Effectiveness'. (B)</p> Signup and view all the answers

In the context of J.D. Bauby's 'Letter Algorithm', what is the purpose of having an assistant?

<p>To present letters sequentially and recognize Bauby's signal when the correct letter is reached. (B)</p> Signup and view all the answers

Which of the following scenarios best demonstrates an algorithm being executed by a human agent?

<p>A chef following a precise recipe to bake a cake. (C)</p> Signup and view all the answers

An algorithm designed to find the absolute best route for a traveling salesperson is running slower than molasses, even on a modern computer. What is the best course of action?

<p>Accept an approximate solution using a heuristic approach to get a 'good enough' result in a reasonable time. (D)</p> Signup and view all the answers

What is the primary reason for specifying algorithms in a formal language rather than a natural language?

<p>Formal languages eliminate ambiguity and ensure precise interpretation. (B)</p> Signup and view all the answers

What is the key difference between a 'program' and an 'algorithm'?

<p>An algorithm is a generalized solution, while a program is tailored to specific conditions and assumptions. (C)</p> Signup and view all the answers

In the context of heuristic processes, what does it mean for a process to be 'not systematic'?

<p>The process adapts its approach based on the situation. (C)</p> Signup and view all the answers

Which of the following best describes what the 'Definiteness' property brings to an algorithm?

<p>It precisely spells out each step in the algorithm and the order in which they must be carried out, including how to handle errors. (A)</p> Signup and view all the answers

Which of these is NOT a property that an algorithm must have?

<p>Reversibility (D)</p> Signup and view all the answers

Consider an algorithm that calculates the trajectory of a ball thrown into the air. While theoretically sound, air resistance is ignored resulting in wildly inaccurate answers in all real-world situations. Which algorithmic property is not met?

<p>Effectiveness (A)</p> Signup and view all the answers

Consider an algorithm to compute the prime factorization of any integer. The algorithm includes a step to divide by every integer between 1 and the input number. If a user input a number that is so large that computation would take longer than the expected lifetime of our universe, which algorithmic property is not met?

<p>Finiteness (A)</p> Signup and view all the answers

Flashcards

Algorithm definition

A precise, systematic method for producing a specified result.

Programs

Algorithms specialized to a specific set of conditions and assumptions.

Heuristic process

A helpful procedure for finding a result, but is not systematic or guaranteed to be successful.

Algorithm Input

Data to be transformed during computation.

Signup and view all the flashcards

Algorithm Output

Data resulting from the computation.

Signup and view all the flashcards

Algorithm Definiteness

Specifying every step and the order they must be taken.

Signup and view all the flashcards

Algorithm Effectiveness

Each step must be doable by the executor without outside help.

Signup and view all the flashcards

Algorithm Finiteness

Algorithm must stop eventually.

Signup and view all the flashcards

Variable

A memory area indicated by a name that can contain a value.

Signup and view all the flashcards

Sequence

The order in which operation are executed.

Signup and view all the flashcards

Repetition

Repeating an operation multiple times.

Signup and view all the flashcards

Study Notes

Informatics: Algorithmic Thinking

  • Study notes on algorithmic thinking.
  • Elaboration on Pearsons – Fluency with Information Technology – Snyder Ch.10.

Learning Objectives

  • Explain similarities and differences among algorithms, programs, and heuristic solutions.
  • Understand the five essential properties of an algorithm.
  • Use the Intersect Alphabetized List algorithm to follow the flow of the instruction execution and to follow an analysis to pinpoint assumptions.
  • Demonstrate algorithmic thinking by being able to explain the importance of alphabetical order on the solution and explain the importance of the barrier abstraction for correctness.

The Letter Algorithm

  • J.D. Bauby, paralyzed, communicated by blinking one eyelid.
  • An assistant pointed to letters, and Bauby indicated the correct one.
  • One blink indicates no, and two blinks indicate yes.
  • The assistant pointed to letters until the correct one was reached.
  • The process was repeated to spell words and sentences.
  • The Letter Algorithm is described as a precise and systematic method for producing a specified result.
  • Algorithms can be invented.
  • Algorithms are not required to use numbers.
  • Algorithms can be run by humans, not just computers.
  • Algorithms exist in better and poorer versions.
  • To specify an algorithm, define a starting point, actions, repeated actions, and when to stop.
  • The Letter Algorithm can be improved by having the assistant guess a word before it is spelled out completely and asking the letters in frequency order.
  • Ordering letters by frequency helps speed up the process.

Algorithm Specification

  • Algorithm specification depends on the executor's capabilities.
  • Skilled executors require less detail.
  • Human executors can use logic and experience.
  • Mechanical executors must be instructed in detail.

Programs and Algorithms

  • Programs are algorithms specialized for a specific set of conditions.
  • The terms "program" and "algorithm" are often used interchangeably.
  • An algorithm is a more abstract description of a solution.
  • A program is a precise description of a solution in a programming language.

Examples of Algorithms

  • Binary to Decimal Conversion involves writing down the place value for each "1" and adding up these values.
  • Binary Addition involves adding numbers as in decimal but limiting digit values to two.

Finding Information on the Web

  • Finding information on the web begins with a general topic and moves to examining the results, choosing descriptive words, refining by adding words, avoiding overconstraining, and removing specific words.

Algorithms vs. Heuristic Processes

  • Not all descriptions of processes are algorithms.
  • Finding information on the web using a search engine is a heuristic process.
  • Heuristic processes are not systematic, are not guaranteed to find a result, and are helpful procedures for finding a result.

Algorithm Properties

  • An algorithm has five essential properties: input specified, output specified, definiteness, effectiveness, and finiteness.

Input Specified

  • Input includes the data transformed during computation to produce the output.
  • Input precision requires knowing the kind, amount, and form of the data.

Output Specified

  • Output is the data resulting from the computation.
  • Output precision requires knowing the kind, amount, and form of the output and whether any output will exist.

Definiteness

  • Algorithms must specify every step and the order in which the steps must be taken.
  • Definiteness involves specifying the sequence of operations for turning input into output.
  • Details of each step must be spelled out, including the handling of errors, and an example is computing x divided by y, where the result is undefined if you input 6,0.

Effectiveness

  • Each step of an algorithm must be doable.
  • The agent must perform each step without outside help or extraordinary powers.
  • The description must be understood by the executor agent.
  • An example of non-effectiveness is trying to predict the result of a coin toss.

Finiteness

  • Algorithms must eventually stop.
  • Stopping may mean getting the expected output, or a response that no solution is possible.
  • Finiteness is usually not an issue for non-computer algorithms.
  • Computer algorithms repeat instructions with different data.
  • Finiteness may be a problem in computer algorithms because it's easy to write a never-ending algorithm/program by mistake.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

COMP 1631 F2024: Understanding Algorithms
32 questions
Strategi Algoritmik dalam Informatika
40 questions
Asesmen Informatika Kelas 7
40 questions
Use Quizgecko on...
Browser
Browser