5.9. Limits of Algorithms — Mobile CSP (2024)

5.9. Limits of Algorithms — Mobile CSP (1)

Time Estimate: 45 minutes

5.9.1. Introduction and Goals

We've been using algorithms to build our apps and we've learned about algorithms for solving certain types of problems, such as searching and sorting problems.

It may seem that no matter what the problem, we can find an algorithm to solve it. But that is not true. And in this lesson we want to look at some problems that algorithms cannot solve or cannot solve efficiently.

Learning Objectives:&nbspI will learn to

  • differentiate between problems that have reasonable solutions and those that do not
  • discuss heuristic solutions when an optimal solution is not possible
  • explain how intractability can be used to solve problems such as password security

Language Objectives:&nbspI will be able to

  • use target vocabulary, such as reasonable time, unreasonable time, decidable problems, intractable problems and intractable problem while discussing algorithms, with the support of concept definitions and vocabulary notes from this lesson

5.9.2. Learning Activities

There are two categories of problems that an algorithm cannot solve.

  1. Undecidable Problems. These problems are the theoretically impossible to solve — by any algorithm. The halting problem is a decision problem (with a yes or no answer) that is undecidable. A computer cannot tell if it is in an infinite loop or it will at some point stop!
  2. Intractable Problems. These problems are theoretically impossible to solve in a reasonable time — i.e., there are known algorithmic solutions, but the algorithms are too inefficient/slow to solve the problem when the number of inputs grows large.

The following video will give us an overview of these types of limits to algorithms and will illustrate how we can use the fact that certain problems are intractable to protect our passwords and other information.


POGIL Activity for the Classroom: Creating a Strong Password (15 minutes)

To give us a better sense of what it takes to create a strong password -- i.e., one that can withstand a brute force attack -- we're going to use the Password Strength Calculator to test the strength of various password schemes. (Open widget in a separate window)

According to Wikipedia, an ordinary desktop computer equipped with special password cracking software can test more than 100 million passwords per second. The goal of this activity is to come up with the optimal password scheme that would take an ordinary PC, equipped with password-cracking software, more than 10 years to crack.

Break into 4-person POGIL teams. Record your answers using this worksheet. (File-Make a Copy to have a version you can edit.)

RoleResponsibility
FacilitatorThe facilitator records the details of the team's optimal password scheme.
SpokespersonReports the team's results.
Quality ControlUses the online calculator to test the team's ideas for creating secure passwords.
Process AnalystAssesses the team's performance and records on the Portfolio the team's answers to the following guided inquiry questions.

Questions

  1. (Portfolio) A password scheme consists of a minimum password length and the different types of symbols (i.e., letters, numbers, specials) that can be used in the password. Using the Password Strength Calculator, determine the optimal scheme for withstanding a brute force attack of at least 10 years by an ordinary PC performing 100 million tests per second.
  2. (Portfolio) According to this 2020 article, a password-cracking computer can try 669 billion passwords per second. How would you have to modify your scheme to withstand a 10-year attack by this specially designed computer?
  3. (Portfolio) After you’ve calculated the estimated number of passwords that can be checked per second for the next year, use the Password Strength Calculator to determine an optimal password scheme.
    a. How long should the password be?
    b. What combination of characters should it include?

Heuristic Solutions to Intractable Problems

For some intractable problems, we need to have practical solutions. One such example is the Traveling Salesman Problem (TSP): Construct the most efficient route, the optimal route, that visits N cities. This is an optimization problem where the goal is to find the "best" (most optimal) solution among many.

This is a problem we would like to be able to solve. Variations of this problem are the kinds of problems that Google maps and other apps solve for us when we ask for driving directions.

Fortunately, there are so-called heuristic algorithms that computer scientists use to solve such problems. A heuristic algorithm is one that provides a solution to a problem, although in many cases the solution may not be the best possible solution -- i.e., it may not be an optimal solution.

The following video will give us an overview of the Traveling Salesman Problem.


POGIL Activity for the Classroom: Traveling Salesman Problem (15 minutes)

Using the same POGIL teams as above, let's give the nearest neighbor heuristic a try on this problem.

A Trinity College student needs to visit some of the Mobile CSP Schools in Hartford, Connecticut. The following map shows the schools that need to be visited and gives the distances between each pair of schools. The student needs a good route, starting and ending at Trinity College, that will visit all of the schools.
5.9. Limits of Algorithms — Mobile CSP (2).

Use the map to answer the following questions.

Questions

  1. Starting and ending at Trinity College, what route would the nearest neighbor heuristic produce for the proposed visits?
  2. Starting and ending at Trinity College, find the optimal route that visits all schools. (HINT: To prove that your route is optimal, you'll have to compare it to all possible routes starting and ending at Trinity.)
  3. (Portfolio) For routes starting and ending at Trinity College, you have identified the nearest neighbor route and the optimal route. What does this show you about the nearest neighbor heuristic?

5.9.3. Summary

In this lesson, you learned how to:

5.9.4. Still Curious?

  • Try the How secure is my password site.
  • Check out the article Why So Many People Make Dragon Their Password from Wired magazine.
  • Check out the article Estimating Password Cracking Times from Better Buys.
  • Do some online research to explore alternatives to passwords schemes -- for example, two-factor authentication, biometrics, virtual tokens. What are their relative advantages and disadvantages?
  • Here's an interactive shortest TSP tour to visit the top 647 colleges in the U.S..
  • Here's a neat TSP Game that uses maps in Europe and Africa. You can use it to test the nearest neighbor heuristic, or to try to come up with your own heuristic for finding good routes through the cities.
  • One field of computer science that makes extensive use of heuristics is Artificial Intelligence (AI). You've probably heard of it. The field of AI traditionally tackles problems that humans are good at but computers are not (yet) good at -- for example, vision, speech recognition, natural language understanding, planning, driving, and so on. However, great progress is being made in these various areas -- just think for a moment about how well Siri and similar intelligent digital assistants work today. In fact, try asking Siri "Hey Siri, how do you solve the traveling salesman problem?". AI is a vast field. And, as for many topics, a good way to start learning more about Heuristics and AI would be to start with Wikipedia.

5.9.5. Self-Check

Here is a table of some of the technical terms discussed in this lesson. Hover over the terms to review the definitions.

brute force
decidable problems
undecidable problems
intractable problems
reasonable Time
unreasonable Time

The Halting Problem
The Traveling Salesman Problem
heuristic algorithm
decision problem
optimization problem

    Q-3: Is the following problem tractable (solvable in a reasonable amount of time) or intractable (cannot be solved in a reasonable amount of time)? For any length string of letters using any combination of the letters ‘a’ through ‘z’, write down all possible strings.

  • Tractable
  • Let me add new information to help you solve this question. There are 26 possible 1-letter words, 26 × 26 2 letter words, 26 × 26 × 26 3-letter words, and so on. So there would be 26N N-letter words. This is exponential.
  • Intractable
  • Yes. If the string has N letters 'a' to 'z', then there are 26N possible strings, which is exponential. This is similar to trying to crack a long password made up of lowercase letters. In this case, each letter in the password can be one of 26 possible letters. If you made such a password long enough (e.g., more than 15 letters), it would be fairly secure from brute force attack.

    Q-4: True or False: An algorithm can be found for any computational problem whatsoever.

  • True
  • This is challenging, but rewarding! The Halting Problem is an example of an unsolvable problem.
  • False
  • Yes. The Halting Problem is an example of an undecidable problem, as Turing proved.

    Q-5: The Halting Problemis an example of

  • an intractable problem.
  • This is challenging, but rewarding! Intractable problems are those for which there are known algorithms but the algorithms are exponential and therefore too inefficient to solve the problem for large N.
  • an exponential problem.
  • This is challenging, but rewarding! Exponential problems are those for which there are only exponential algorithms available. But the Halting Problem is not such a problem.
  • an undecidable problem.
  • Yes. As Turing proved, it is impossible to solve the Halting Problem.
  • a difficult problem.
  • This is challenging, but rewarding! The Halting Problem is an undecidable problem.

    Q-6: True or false: All intractable problems(that cannot be solved in a reasonable time) are bad.

  • True
  • Let me add new information to help you solve this...Some intractable problems, such as the problem of breaking cryptographic keys, are helpful. In that case the intractability of the problem protects the security of our networks. There are many similar uses of such intractable problems in computing, many of which are used to make the Internet more secure.
  • False
  • Some intractable problems, such as the problem of breaking cryptographic keys, are helpful. In that case the intractability of the problem protects the security of our networks. There are many similar uses of such intractable problems in computing, many of which are used to make the Internet more secure.

5.9.6. Sample AP CSP Exam Question

    Q-7: Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

  • When the problem can be solved in a reasonable time and an approximate solution is acceptable.
  • When the problem can be solved in a reasonable time and an exact solution is needed.
  • When the problem cannot be solved in a reasonable time and an approximate solution is acceptable.
  • When the problem cannot be solved in a reasonable time and an exact solution is needed.

5.9.7. Reflection: For Your Portfolio

Answer the following portfolio reflection questions as directed by your instructor. Questions are also available in this Google Doc where you may use File/Make a Copy to make your own editable copy.

You have attempted of activities on this page

5.9. Limits of Algorithms — Mobile CSP (2024)

FAQs

What are the limits of algorithms? ›

Algorithms with exponential or factorial efficiencies are examples of algorithms that run in an unreasonable amount of time. Some problems cannot be solved in a reasonable amount of time because there is no efficient algorithm for solving them. In these cases, approximate solutions are sought.

What are the limitations of an algorithm? ›

Algorithm limitations are the postconditions or drawbacks that your algorithm produces or faces. For example, a limitation could be that your output data is approximate, incomplete, or sensitive.

What are the limitations of algorithm power? ›

Some problems cannot be solved by any algorithm. Some problems can be solved algorithmically, but not in a polynomial time. And few problems have lower bound for their efficiency. There are certain ways of establishing lower bounds on efficiency of algorithms.

What is the algorithm for CSP problem? ›

The basic algorithm is sim- ple backtracking (BT) 12], a general search strategy which has been widely used in problem solving. In solving CSPs, it also serves as the basis for many other algorithms.

What is minimum and maximum algorithm? ›

Algorithm steps

Declare max and min variables to store maximum and minimum. We are picking elements in pairs. So if array size is odd, initialise min and max with X[0] and loop variable i with 1. Otherwise, compare X[0] and X[1], initialize min with the smaller value, max with larger value and loop variable i with 2.

What are the three 3 types of algorithms? ›

Types of Algorithms
  • Search algorithms. Designed to retrieve information stored within some data structure, e.g., binary search algorithm used to find a particular item in a sorted list.
  • Sorting algorithms. ...
  • Graph algorithms.
Sep 28, 2023

What are the 3 requirements of an algorithm? ›

Feasibility: All steps of an algorithm should be possible (also known as effectively computable). Input: an algorithm should be able to accept a well-defined set of inputs. Output: an algorithm should produce some result as an output, so that its correctness can be reasoned about.

What are the three rules of algorithm? ›

Definiteness: Each step must be unambiguous. Finiteness: If we trace the steps of an algorithm, then for all cases, the algorithm must terminate after a finite number of steps. Effectiveness: Each step must be sufficiently basic that a person using only paper and pencil can in principle carry it out.

What makes an algorithm bad? ›

Additionally, algorithms can make flawed decisions when they don't account for novel situations outside their training data. This can also harm marginalized people, who are often underrepresented in such datasets.

What is the biggest drawback of algorithms? ›

The major drawback of algorithms is that they can lead to faulty solutions. Algorithms are step-by-step procedures that provide a systematic approach to solving a problem, but they are developed by humans and are subject to errors. Even a small mistake in the algorithm can lead to incorrect results or faulty solutions.

What is the main disadvantage of using algorithms? ›

The main disadvantage of using an algorithm is that it may generate a solution that will be time-consuming when large and complex tasks need to be executed. The main reason is that you can not obtain the final product and calculate the overall complexity of the program before coding.

What are the limitations of deep learning algorithms? ›

What Are The Limitations Of Deep Learning? Deep learning works only with large amounts of data. Training it with large and complex data models can be expensive. It also needs extensive hardware to do complex mathematical calculations.

Which algorithm is used in CSP? ›

Backtracking Search for CSP in Artificial Intelligence:

Backtracking is a widely used technique for solving CSPs. It is a systematic search algorithm that explores possible assignments for variables, backtracking when it encounters constraints that cannot be satisfied.

What is most constrained CSP? ›

Most constrained variable It is a variable-level ordering heuristic that selects the next unassigned variable that has the fewest consistent values. This has the effect of making inconsistent assignments to fail earlier in the search, which enables more efficient pruning.

How do you solve a CSP problem? ›

CSPs can be solved by assigning values to variables one by one, in different combinations. Whenever a constraint is violated, we go back to the most recently assigned variable and assign it a new value.

What are the limitations of machine learning algorithms? ›

Machine learning algorithms frequently have two limitations: overfitting and underfitting. Overfitting is a condition where a machine learning model performs poorly on new, unknown data because it needs to be simplified and has been trained too successfully on the training data.

Top Articles
2.7: Process Cost Demonstration (FIFO Method)
Run and RunOnce Registry Keys - Win32 apps
Foxy Roxxie Coomer
Duralast Gold Cv Axle
Truist Bank Near Here
Is pickleball Betts' next conquest? 'That's my jam'
Chase Bank Operating Hours
Bucks County Job Requisitions
Los Angeles Craigs List
Gwdonate Org
Tracking Your Shipments with Maher Terminal
Shreveport Active 911
Kris Carolla Obituary
2016 Ford Fusion Belt Diagram
Gon Deer Forum
Bitlife Tyrone's
Overton Funeral Home Waterloo Iowa
Driving Directions To Bed Bath & Beyond
Clear Fork Progress Book
라이키 유출
Tygodnik Polityka - Polityka.pl
A Biomass Pyramid Of An Ecosystem Is Shown.Tertiary ConsumersSecondary ConsumersPrimary ConsumersProducersWhich
Georgia Cash 3 Midday-Lottery Results & Winning Numbers
Cpt 90677 Reimbursem*nt 2023
Craigslist Ludington Michigan
Pixel Combat Unblocked
Tottenham Blog Aggregator
Pfcu Chestnut Street
Metro By T Mobile Sign In
Graphic Look Inside Jeffrey Dresser
2016 Honda Accord Belt Diagram
Does Iherb Accept Ebt
Synchrony Manage Account
Myql Loan Login
Mcgiftcardmall.con
2008 DODGE RAM diesel for sale - Gladstone, OR - craigslist
Paperless Employee/Kiewit Pay Statements
Anhedönia Last Name Origin
Amc.santa Anita
Strange World Showtimes Near Century Stadium 25 And Xd
Port Huron Newspaper
Tacos Diego Hugoton Ks
Phmc.myloancare.com
Dying Light Mother's Day Roof
Das schönste Comeback des Jahres: Warum die Vengaboys nie wieder gehen dürfen
Mlb Hitting Streak Record Holder Crossword Clue
Random Warzone 2 Loadout Generator
Quest Diagnostics Mt Morris Appointment
Julies Freebies Instant Win
Fallout 76 Fox Locations
Goosetown Communications Guilford Ct
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 5571

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.