# Programming question

**URL:** <https://boards.straightdope.com/t/programming-question/720138>\
**Category:** In My Humble Opinion\
**Created:** [May 15, 2015, 10:23pm UTC](https://boards.straightdope.com/t/programming-question/720138 "2015-05-15T22:23:50Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [May 16, 2015, 5:12pm UTC](https://boards.straightdope.com/t/programming-question/720138/21 "2015-05-16T17:12:45Z")

</div>

I always liked what Niven had to say about this:

> [@](#):
>
> One slow afternoon I asked a pair of chirpsithra about intelligent computers.  
> “Oh yes, we built them,” one said. “Long ago.”
> 
> “You gave up? Why?”
> 
> One of the salmon-colored aliens made a chittering sound. The other said, "Reason enough. Machines should be proper servants. They should not talk back. Especially they should not presume to instruct their masters.

---

<div class="post-metadata">

**Author:** ![Kyrie\_Eleison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kyrie_eleison/32/7682_2.png) [@Kyrie\_Eleison](https://boards.straightdope.com/u/Kyrie_Eleison)\
**Post date:** [May 16, 2015, 7:37pm UTC](https://boards.straightdope.com/t/programming-question/720138/22 "2015-05-16T19:37:48Z")

</div>

I think [genetic algorithms](http://en.wikipedia.org/wiki/Genetic_algorithm) may be close to what the OP is asking about.

> [@](#):
>
> In the field of artificial intelligence, a genetic algorithm (GA) is a search heuristic that mimics the process of natural selection. This heuristic (also sometimes called a metaheuristic) is routinely used to generate useful solutions to optimization and search problems.[1] Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate solutions to optimization problems using techniques inspired by natural evolution, such as inheritance, mutation, selection, and crossover.

Also, perhaps more specifically on point, is [genetic programming](http://en.wikipedia.org/wiki/Genetic_programming), a subset of GA:

> [@](#):
>
> In artificial intelligence, genetic programming (GP) is an evolutionary algorithm-based methodology inspired by biological evolution to find computer programs that perform a user-defined task. Essentially GP is a set of instructions and a fitness function to measure how well a computer has performed a task. It is a specialization of genetic algorithms (GA) where each individual is a computer program. It is a machine learning technique used to optimize a population of computer programs according to a fitness landscape determined by a program’s ability to perform a given computational task.

In GP, individual computer programs are “punished” or “rewarded” according to how well they satisfy one or more fitness tests with a long-term goal of developing a more optimized solution, which, to me, seems very similar to what the OP was describing.

---

<div class="post-metadata">

**Author:** ![enipla](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@enipla](https://boards.straightdope.com/u/enipla)\
**Post date:** [May 16, 2015, 7:57pm UTC](https://boards.straightdope.com/t/programming-question/720138/23 "2015-05-16T19:57:28Z")

</div>

And it’s all based on yes or no. True or false. Be it organic or CIA Skunk works.

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [May 16, 2015, 10:35pm UTC](https://boards.straightdope.com/t/programming-question/720138/24 "2015-05-16T22:35:05Z")

</div>

> [@enipla](#):
>
> Heh. ‘Contact Us’
> 
> It’s sort of funny, I run a County GIS web site. And yes, we have a ‘Contact Us’ button that sends what ever they ask, or rant about right to my desk. I can often respond within minutes, and either direct them to the correct department or answer their question. Users are often stunned to get any response at all, let alone a prompt one. It’s kinda fun.
> 
> It’s good info for me too. If enough users are confused about something, I can fix it. Well, sometimes… There are some that, well… Wish I could through a shoe through the screen. Only a matter of time I guess 😃

A similar case is a section in many help systems that says something like “Did this answer your question?” with an option to enter a response.

Unfortunately, that’s why users are so often stunned at enipla’s prompt response – most of the time you never get a response at all, or at best a very delayed one. But the possibility is there.

Some companies count the “no” responses to such questions, and use those to identify the sections of the help system that need rewriting. And some shareware projects count votes on bug reports, and use those to prioritize working on bugs.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [May 16, 2015, 10:37pm UTC](https://boards.straightdope.com/t/programming-question/720138/25 "2015-05-16T22:37:51Z")

</div>

> [@HoneyBadgerDC](#):
>
> I will try and explain what I am asking. I realize computers will never have a true feeling of any kind. I do believe that humans respond to electro chemical reactions produced by various exposures or behaviors. Computers would likely never be able to experience the chemical part of this reaction. …

IMO that is completely erroneous thinking with zero basis in fact. Conscious computers are in our future, and their “feelings” will be exactly as real as yours are. The only meaningful debate will be how real that really is.

> [@HoneyBadgerDC](#):
>
> … I am trying to find out if a type of logic could be developed that could cause a computer to respond in a way that could almost simulate a reaction based on a reward or punishment or. For instance a goal was programmed into a computer that had a long series of complicated criteria that would need to be met to achieve this goal. The computer was also programmed to know its location relative to the goals it had. If a behavior moved it further away it would reject the behavior if it moved it closer it would accept the behavior, something along these lines.

As I said, that is bog-standard technology _today_. That’s exactly the kind of logic that drives neural networks, self-driving cars, autonomous drone aircraft and submarines, etc. And lots and lots of algorithms used in machine vision, finance, logistics, scheduling, etc.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [May 16, 2015, 10:47pm UTC](https://boards.straightdope.com/t/programming-question/720138/26 "2015-05-16T22:47:09Z")

</div>

Late edit: Substitute “fuzzy logic systems” for “neural networks” in the last paragraph. Brain fart on terminology on my part.

Or more precisely, a mistaken weighting on a reward/punishment tree traversal led to the wrong end-point in my main storage. With the error noted, the meta-scoring system has been updated to re-weight the branches at that point and I’ve rerun the search, arriving at the more correct end point. The satisfaction metric has thus been improved for future use.

---

<div class="post-metadata">

**Author:** ![HoneyBadgerDC](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/honeybadgerdc/32/1033_2.png) [@HoneyBadgerDC](https://boards.straightdope.com/u/HoneyBadgerDC)\
**Post date:** [May 16, 2015, 11:10pm UTC](https://boards.straightdope.com/t/programming-question/720138/27 "2015-05-16T23:10:00Z")

</div>

It is all over my head but exciting stuff none the less.

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [May 17, 2015, 2:03am UTC](https://boards.straightdope.com/t/programming-question/720138/28 "2015-05-17T02:03:38Z")

</div>

> [@Kyrie\_Eleison](#):
>
> I think [genetic algorithms](http://en.wikipedia.org/wiki/Genetic_algorithm) may be close to what the OP is asking about.
> 
> Also, perhaps more specifically on point, is [genetic programming](http://en.wikipedia.org/wiki/Genetic_programming), a subset of GA:  
> In GP, individual computer programs are “punished” or “rewarded” according to how well they satisfy one or more fitness tests with a long-term goal of developing a more optimized solution, which, to me, seems very similar to what the OP was describing.

First thing, something can’t be “more optimized.” I’m sensitive to this because in grad school I worked on a subject which used to be called optimization, but which we managed to get called compaction, which was more accurate.  
Genetic algorithms are so popular around here because the contain the term “genetic” and we all love evolution. They are just one category of search space heuristics, and not even that great a one. There are many others.  
Here is a generic way of looking at these, not referring to biology.

Say your goal is on top of a hill. From some starting point, you emit a bunch of probes. If a probe is below where you are, you stop it. If it is higher you keep it, and have it send out more probes.  
But this won’t necessarily find a solution. Say you start on hill 1 but the solution is on hill 2. You will never find your goal by just going up. So, you must keep some probes that go down, and you must arrange for some probes to go far away from where you are, to perhaps find the hill with your goal. (Being stuck on one hill is called local optimization.)  
No rewards, no punishments.

---

<div class="post-metadata">

**Author:** ![Terminus\_Est](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/terminus_est/32/3087_2.png) [@Terminus\_Est](https://boards.straightdope.com/u/Terminus_Est)\
**Post date:** [May 17, 2015, 4:06am UTC](https://boards.straightdope.com/t/programming-question/720138/29 "2015-05-17T04:06:04Z")

</div>

OP may be interested in this video of [computer-simulated robots learning to walk](https://youtu.be/yci5FuI1ovk).

Here is an [actual robot learning how to walk](https://youtu.be/SBf5-eF-EIw).

[Previous page](https://boards.straightdope.com/t/programming-question/720138.md?page=1)
