If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Discuss: Algorithms in your life

We've given you a little intro to algorithms, and a few examples. Now before we go further, we want to hear what algorithms you can think of.
Leave a comment below answering one or more of these questions, and check out what other students wrote:
  • What algorithms do you use in everyday life? Do you think you could write a program to make them more efficient?
  • What algorithms do you think are used by your favorite games and apps?
  • Have you ever made an algorithm for a program? What did it do? Was it correct and efficient?
Please use the "Tips/Thanks" tab for your answers, not the "Questions" tab. We look forward to your thoughts!

Want to join the conversation?

  • leafers tree style avatar for user LioryMushievv
    Is an algorithm for wring an algorithm possible to make? Or are we humans an algorithm for making algorithms?
    (1053 votes)
    Default Khan Academy avatar avatar for user
    • leaf orange style avatar for user Paul Klar
      There are physic enginges that can simulate a lot of stuff. With simulation you can generate a huge dataset, which is used to make a computer control something according to the "experiences" contained in the datasets.
      Example: Give a robot the keyboard and a flight-simulator and tell him: Airplane in the air = GOOD, crash = NOT good, press any keys and check what happens. The robot will produce datasets that lead to a crash and datasets that made a stable flight. With the huge dataset the computer has "algorithms" to maintain a stable flight (and also algorithms that lead to a crash) that he learned by himself.
      Well, the physics engine was written by humans - though I do not consider humans to be like algorithms. Is there an algorithm for creativity? I guess not.
      (19 votes)
  • male robot johnny style avatar for user Christian R. Engle
    So can you write a program just for making algorithms more efficient, faster?
    (56 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Cameron
      To some extent compilers have algorithms that make algorithms more efficient and faster.

      Example 1:
      if you have some C++ code that looks like:
      bool a=true;
      while(a == true){
      //do something, but never change a

      The compiler may change it to:
      //do something
      goto LABEL

      which eliminates the need to have a variable 'a', and eliminates checking if(a ==true)

      Example 2:
      if you have a calculation in your code that the compiler detects is never used it may eliminate it

      Some compilers have settings which determine how aggressive the compiler will be in optimizing your code.
      The trade off for using more agressive optimization settings is:
      -it typically take longer to compile,
      -the compiled code may be unstable

      Hope this makes sense
      (142 votes)
  • male robot hal style avatar for user Krish
    Couldn't there be algorithms for making algorithms?
    (27 votes)
    Default Khan Academy avatar avatar for user
  • mr pink red style avatar for user Blake Baker
    Is there an algorithm to a random number generator?
    (24 votes)
    Default Khan Academy avatar avatar for user
  • duskpin seed style avatar for user Tyra William
    how do you get into computer science and what do you have to have to get a job and what do you get paid, thank you for your convenience
    (9 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Pratyusha Javangula
    Since a lot of the work I do involves machine learning, an algorithm I use often is the gradient descent algorithm, which provides a tried-and-true method for using data to optimize parameter weights, which are then used to make a decision about some new, unseen piece of data.
    (18 votes)
    Default Khan Academy avatar avatar for user
  • male robot donald style avatar for user Hossam Mohammed
    actually we use algorithms everyday in our daily life any problem or a thing we're solving our brain is algorithming somehow but the whole point is were we we doing algorithms right i don't think so because if we had done such a thing our life would have much changed and here is a question how to make the best algorithm u can imagine ??
    (5 votes)
    Default Khan Academy avatar avatar for user
  • piceratops seedling style avatar for user khmerguy16
    Is there an algorithm that artists use without knowing? such as Photoshop artists to know just how to place something to give it depth for an image
    (6 votes)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Liam James
      That sounds a lot like n-point perspective.
      Basically, following the understanding that objects get smaller the closer they get to the horizon, you can get a general idea of how big or small an object should look, as it's moved closer or further from the observer.

      1)Starting with 1 point perspective, you begin by figuring out where your horizon should be.
      2)Next, you need to pick a point on the horizon to be your vanishing point - you can think of this as being the end of a really long and stright hallway. As things get further away from the viewer, they start to converge on that point.
      3) Next, draw a simple flat shape to extend into the distance. For example, a square.
      4) Trace a straight line from each corner of the square to your vanishing point. this gives you an idea of how big your square should appear as it gets further from the viewer.

      Most of the steps for this procedure can be repeated for 2, 3.. point perspective for achieving different effects.
      2 point perspective - like standing at a street corner.
      3 point perspective - like looking up or down at a sky scraper
      4 point perspective - kinda like 3 point, but floating in the middle of the skyscraper, able to look down and up
      5 and 6 point perspective - Looking through a fish-eye lense or a reflection on a sphere.
      (8 votes)
  • starky seedling style avatar for user Natael Prewitt
    can life be considered an algorithm
    (5 votes)
    Default Khan Academy avatar avatar for user
  • hopper happy style avatar for user matthew.hoppe
    In paragraph 5 the question. Have you ever made an algorithm for a program was it correct or efficient? How do you tell whether it was correct or efficient?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • orange juice squid orange style avatar for user Pablo Delgado
      An algorithm is correct when it produces a "correct" or expected result for a given input. To give you an example, a sorting algorithm is correct if it is given 10 unsorted items and it returns precisely 10 items in sorted order. If any item is our of order or the result contains 9 items instead of 10, then the algorithm is not correct.

      An efficient algorithm is an algorithm that uses the least amount of resources. Time is commonly used to determine the efficiency of an algorithm. Another measure is the number of instructions or steps an algorithm must perform in order to complete the task.

      Hope this helps.
      (14 votes)