Interesting Algorithms

xox

Joined Sep 8, 2017
936
The algorithms we invent are often framed by the way we think, the (programming) languages we use, I don't think we actually can think without language, I think Wittgenstein was advocating that.


I suspect my dogs can and do think, they have some understanding (or so it seems) of human language.
Now that's a gross anthropomorphism, if there ever was one.

Language not the source of thought but rather an extension of it. Just as paint strokes can be used to convey complex ideas, emotion, and character, sounds can be attached to symbols (ie. words) representing concepts and then manipulated to communicate more complicated relationships.

With regards to programming, being a programmer myself I would argue that clear visualization is much more important than language when it comes to thinking about (and solving) a problem.

As far as the animal kingdom goes, thought is at any rate pretty much ubiquitous. They may not speak human languages (and why would they?) but they do nonetheless have their own ways of conceptualizing things and even communicating their thoughts to one degree or another.
 

Futurist

Joined Apr 8, 2025
753
Now that's a gross anthropomorphism, if there ever was one.

Language not the source of thought but rather an extension of it. Just as paint strokes can be used to convey complex ideas, emotion, and character, sounds can be attached to symbols (ie. words) representing concepts and then manipulated to communicate more complicated relationships.
Well describing animals minds is far from easy, yes I anthropomorphize but I am a human, I don't have much choice, I could never "see the world" as a dog does I can only see it as I see it. The importance of language to thought is well established, I mentioned Wittgenstein but we can add Russell to that list and many others.

They argue that yes language is used to convey ideas but it is essential also to the ability for us produce ideas, it's not just a way of communicating. Take mathematics our ability to formulate certain ideas and concepts in math increases as we learn more math (language)

With regards to programming, being a programmer myself I would argue that clear visualization is much more important than language when it comes to thinking about (and solving) a problem.
Sure but the approach - the intellectual modelling - will generally be clearly linked to the programming language you use, I don't mean variants like C or C++ but fundamentally different languages like for example APL or functional languages like Haskell and F#.

If you've worked with a functional language you'll understand me, but if you haven't then I encourage you to do so, you'll stop thinking about loops and variables and begin to think (almost effortlessly) about recursion and transformation and patterns. The fact that language limits our thinking is evident you discuss functional programming with programmers who know nothing about it, they simply cannot grasp how you don't need loops or variables, the languages they've used for years actually restricts them, I was stunned when I first began to grasp F#.

For imperative programmers recursion is something pretty rare, only suitable for specialized problem domains whereas in a functional world its as natural as writing a loop in C, it becomes second nature, the code becomes very elegant and bug counts fall too.

As far as the animal kingdom goes, thought is at any rate pretty much ubiquitous. They may not speak human languages (and why would they?) but they do nonetheless have their own ways of conceptualizing things and even communicating their thoughts to one degree or another.
Its a mystery, sometimes my dog sits with me in the yard and is content to just watch nature, listen to birds, I could swear he was "philosophizing" in his own way, just enjoying his own existence.
 
Last edited:

xox

Joined Sep 8, 2017
936
Its a mystery, sometimes my dog sits with me in the yard and is content to just watch nature, listen to birds, I could swear he was "philosophizing" in his own way, just enjoying his own existence.

I wouldn't at all doubt it! The mind is not something exclusive to humans. In fact I would say it is a fundamental (if almost indescribable) property of the universe itself. You could place every single one of your cells in a petri dish and provided the conditions were just right they would go about their lives without "you". But somehow being assembled together in the trillions, an ego of mind somehow emerges from seemingly nothing. On the opposite side of the spectrum if you put a bunch of creatures together, whether it be a crowd of people or a colony of ants, a sort of "crowd mind" arises which then allows an even higher level of coordination and organization to take place. If you ask me, it is "minds all the way down"...


one.jpg


Well describing animals minds is far from easy, yes I anthropomorphize but I am a human, I don't have much choice, I could never "see the world" as a dog does I can only see it as I see it. The importance of language to thought is well established, I mentioned Wittgenstein but we can add Russell to that list and many others.


They argue that yes language is used to convey ideas but it is essential also to the ability for us produce ideas, it's not just a way of communicating. Take mathematics our ability to formulate certain ideas and concepts in math increases as we learn more math (language)

Well sure, it is certainly useful for producing new ideas. However it isn't necessarily required either. Anyone who has done any physical craft such as machining or carpentry can probably relate in the sense that much of the creativity of a new design often manifests itself without much (if any) literal thought. And again, I notice this when programming as well. An algorithm can develop from the mere act of visualizing the interaction between various pieces of data.


Sure but the approach - the intellectual modelling - will generally be clearly linked to the programming language you use, I don't mean variants like C or C++ but fundamentally different languages like for example APL or functional languages like Haskell and F#.


If you've worked with a functional language you'll understand me, but if you haven't then I encourage you to do so, you'll stop thinking about loops and variables and begin to think (almost effortlessly) about recursion and transformation and patterns. The fact that language limits our thinking is evident you discuss functional programming with programmers who know nothing about it, they simply cannot grasp how you don't need loops or variables, the languages they've used for years actually restricts them, I was stunned when I first began to grasp F#.


For imperative programmers recursion is something pretty rare, only suitable for specialized problem domains whereas in a functional world its as natural as writing a loop in C, it becomes second nature, the code becomes very elegant and bug counts fall too.

Functional languages are neat, they really do boil things down to more or less purely-mathematical expressions. But they can also be restrictive in their own way. I haven't tried F# or Haskell but I have done a fair amount of LISP programming plus a few "raw" lambda calculus languages. Besides the fact that they are typically much less efficient, coming from a background primarily consisting of an assembly language -> C -> C++ progression, I just find imperative programming to be much more pleasant to work with. Also note that recursion is actually fairly common in these languages. If you've ever had to write a parser or say a binary tree or some such, a recursive solution is generally most appropriate.
 

MrAl

Joined Jun 17, 2014
13,704
HI,

Ok, so when do we start talking about existentialism ? :)

I know someone with a dog that when he sees the poop bag come out of her pocketbook he knows he is going for a walk outside. He loves to go outside, and he starts barking sharply and wagging his tail, and even knows several paths to get outside.
If you walk him near the first path entrance, he points his body toward that path which leads outside, if you pull his leash slightly to suggest the other path, he quickly turns his body and heads toward that door instead.
I don't know how he internalizes all this but he remembers the paths, and knows what the bags look like.

There is an old joke though that suggests how difficult it could be in interpreting what they are thinking.
A scientist was studying frogs. He said to the frog, "jump", and it jumped.
He cut off one leg and said "jump", and it jumped but not as well.
He cut off another leg and said "jump" again and the frog jumped a little.
He cut off all the legs and said "jump" and the frog did not jump.
His conclusion was when you cut off all four legs the frog goes deaf.
 
Last edited:

Thread Starter

joeyd999

Joined Jun 6, 2011
6,281
HI,

Ok, so when do we start talking about existentialism ? :)

I know someone with a dog that when he sees the poop bag come out of her pocketbook he knows he is going for a walk outside. He loves to go outside, and he starts barking sharply and wagging his tail, and even knows several paths to get outside.
If you walk him near the first path entrance, he points his body toward that path which leads outside, if you pull his leash slightly to suggest the other path, he quickly turns his body and heads toward that door instead.
I don't know how he internalizes all this but he remembers the paths, and knows what the bags look like.
Pavlov spent a good portion of his career working on this.
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,281
Hi,

Yeah good old Pavie, ha ha, haven't heard that name in a long time now. Actually forgot all about him. Perhaps some re-reading of his works would shed some light on the matter.
He comes to mind every time I see a conditioned response to one of my posts.

I find it entertaining.
 

Futurist

Joined Apr 8, 2025
753
I wouldn't at all doubt it! The mind is not something exclusive to humans. In fact I would say it is a fundamental (if almost indescribable) property of the universe itself. You could place every single one of your cells in a petri dish and provided the conditions were just right they would go about their lives without "you". But somehow being assembled together in the trillions, an ego of mind somehow emerges from seemingly nothing. On the opposite side of the spectrum if you put a bunch of creatures together, whether it be a crowd of people or a colony of ants, a sort of "crowd mind" arises which then allows an even higher level of coordination and organization to take place. If you ask me, it is "minds all the way down"...


View attachment 358567





Well sure, it is certainly useful for producing new ideas. However it isn't necessarily required either. Anyone who has done any physical craft such as machining or carpentry can probably relate in the sense that much of the creativity of a new design often manifests itself without much (if any) literal thought. And again, I notice this when programming as well. An algorithm can develop from the mere act of visualizing the interaction between various pieces of data.





Functional languages are neat, they really do boil things down to more or less purely-mathematical expressions. But they can also be restrictive in their own way. I haven't tried F# or Haskell but I have done a fair amount of LISP programming plus a few "raw" lambda calculus languages. Besides the fact that they are typically much less efficient, coming from a background primarily consisting of an assembly language -> C -> C++ progression, I just find imperative programming to be much more pleasant to work with. Also note that recursion is actually fairly common in these languages. If you've ever had to write a parser or say a binary tree or some such, a recursive solution is generally most appropriate.
what do you think of this

https://www.bbc.co.uk/programmes/m001vl96
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,281
what was entertaining?
Thinking of Pavlov's dogs every time I see a conditioned response to one of my posts by one of a group of certain members.

I imagine my interlocutor drooling involuntarily on his keyboard.

Quite funny, actually.
 

MrAl

Joined Jun 17, 2014
13,704
Thinking of Pavlov's dogs every time I see a conditioned response to one of my posts by one of a group of certain members.

I imagine my interlocutor drooling involuntarily on his keyboard.

Quite funny, actually.
I fully understand, and I welcome a little humor from time to time. Breaks up the total seriousness of life.
 

BobTPH

Joined Jun 5, 2013
11,515
I know someone with a dog that when he sees the poop bag come out of her pocketbook he knows he is going for a walk outside.
When I was a teenager, we would say “Wanna go for a walk?” and Duke would jump around excitedly. It eventually got shortened to “Wanna?”. When I had friends over, I would say “Marijuana” stressing the latter half and Duke would do his dance, giving the impression he was a stoner.
 

Futurist

Joined Apr 8, 2025
753
I wouldn't at all doubt it! The mind is not something exclusive to humans. In fact I would say it is a fundamental (if almost indescribable) property of the universe itself. You could place every single one of your cells in a petri dish and provided the conditions were just right they would go about their lives without "you". But somehow being assembled together in the trillions, an ego of mind somehow emerges from seemingly nothing. On the opposite side of the spectrum if you put a bunch of creatures together, whether it be a crowd of people or a colony of ants, a sort of "crowd mind" arises which then allows an even higher level of coordination and organization to take place. If you ask me, it is "minds all the way down"...


View attachment 358567





Well sure, it is certainly useful for producing new ideas. However it isn't necessarily required either. Anyone who has done any physical craft such as machining or carpentry can probably relate in the sense that much of the creativity of a new design often manifests itself without much (if any) literal thought. And again, I notice this when programming as well. An algorithm can develop from the mere act of visualizing the interaction between various pieces of data.





Functional languages are neat, they really do boil things down to more or less purely-mathematical expressions. But they can also be restrictive in their own way. I haven't tried F# or Haskell but I have done a fair amount of LISP programming plus a few "raw" lambda calculus languages. Besides the fact that they are typically much less efficient, coming from a background primarily consisting of an assembly language -> C -> C++ progression, I just find imperative programming to be much more pleasant to work with. Also note that recursion is actually fairly common in these languages. If you've ever had to write a parser or say a binary tree or some such, a recursive solution is generally most appropriate.
I think the informal term "efficiency" is over used when discussing software, it's just one metric. If "efficiency" is super important then we can just use assembly language. Regarding functional languages too, there's nothing inherently efficient about imperative languages, they both ultimately execute on a processor.

F# for example is excellent for concurrent problems for the very reason it avoids mutating state. Its very natural to use it that way too, whereas C# makes it much easier to write mutating code.

Consider too the quality, there's an adage among functional developers that if it compiles it almost certainly works, of course not strictly true but largely, this is something imperative developers find hard to accept so once again language frames how we think, our expectations are based on our experience so if our experience is restricted so to are our expectations.

The financial investment firm Jane Street use OCaml for most of their backbone software, that wasn't a choice made on whim, there are deep solid reasons they adopted that:

https://blog.janestreet.com/why-ocaml/

But I'm not seeking to advocate this or that programming approach, just stressing that with intellectual problems (your remarks about wood work etc are good, but have holes) our languages really does frame and bound our ability to generate ideas. Einstein was barely able to think about general relativity until he developed expertise in tensor calculus, his progress ramped once he developed that expertise.
 

MrAl

Joined Jun 17, 2014
13,704
Hi,

That looks interesting. I do a lot of image filter work myself so I might get around to trying this or something related.

For those that want a summary, it's basically about how you can use a diffusion lens to 'mess up' an image with a camera sensor and then reconstruct the original image using some interesting frequency domain functions. In this video the original images don't come out that good, but they are undeniably the original images. With further experimentation, the images can probably come out better and better. There are other theories that could add greatly to the clarity of the reproductions.

The core idea I think is based on mean square error optimization with known blur function (and probably assumed white noise or some type of noise shaping).
This could be used for other types of image processing I would think. I might be looking into that aspect if time (and energy) permits.
 
Last edited:
Top