Posts

The mating algorithm

We have a population of animals. Each individual can be associated with a certain "value", expressing his "fit level to the environment". We want to design a simple algorithm in the animal's genes that would make the individuals to mate close to optimal. Let's say that resulting value for the mating is the product of the "value" of the two involved individuals. We will study the case when each individual can only be involved in mating with a single other individual. In this conditions, the close to optimum mating is reached when mating is realized between individuals with very close values. Mathematically, we have a set of positive numbers (the values) and we want to create the pairs of numbers so that the sum of products of each pair will be maximal. This happens when we sort the numbers and we pair each number with the one next to it.

On neurons and human ideation

My kid is close to 4 years and started to exhibit a very human brain process: before sleepping, he starts to remember random ideas and expresses them. Sometimes they are not only memories and plans he had over day, some are really new and original ideas - even that many are yet childish of course. It is not something that could be related to a sudden thought association, he just has "ideas". It does not happen only before the sleep, it just happens more often then. Before the sleep it is also easier to eliminate hypothesis like "this thing remembered him about that other thing". This process could show some light about how brain and neurons works, and possibly helping to design more human-like artificial intelligence. I would speculate that the same process that makes ideas and memories to pop up out of nothing, to be the process that permits the most amazing thought processes in humans.

Shortest program that prints the play "Othello" by William Shakespeare

We have this requirement: "Create the smallest program that will print the full text of the play Othello by William Shakespeare". I should warn you that the requirement hides a trick and you will hate the solution. The program does not need to run efficiently. Actually, it does not need to run in reasonable time. It just has to be very short. And to be proven to answer the requirement, eventually... No external random source is allowed and no input from user.

Sorting is computationally harder than playing chess

I will argue below that sorting of a big array, using only comparison, is inherently harder than solving the problem of choosing the best next move on a chess game. One could say that it is not fair to put in competition a big, however finite, problem like chess with an arbitrary big problem like sorting n elements. Fair enough; the interesting thing is that sorting becomes inherently harder than chess for an "n" that is way smaller than you would expect, like sorting 3000 elements. At least in theory... Sorting takes a minimum of n* log 2 (n) comparisons,  more exactly  log 2 (n!) This is about sorting "by comparison only" and can be proven in 2 step. You can skip to the "chess" part if you already know this. 1. Sorting can be done in  log 2 (n!) comparisons, that is just slightly less than n* log 2 (n). We are used to consider sorting an O (n* log 2 (n)) problem. Actually there are algorithms that can do the sorting with little less t...

Godel and psychological types

“There are two types of people in the world, those who divide everybody into types and those who do not”. I am part of the second type ;) Is the text above true or false?

Backup your photos for 20 years or more - ideas

Image
External hard drives Will you have your digital photos after 20 years from now? Will you regret to not have them? How can you safely store your digital photos in order to still have them in 20 years or more? I am talking, for example, about the pictures or movies that you take with your smartphone or with your digital camera. I know I will want to have them after years. Digital pictures tends to be even more fragile than paper pictures. Do you still have all the digital pictures that you have taken 10 years ago? What if your smartphone gets stolen, or your desktop hard drive fails? What if you delete the pictures by mistake when re-installing the operating system? Here are some ideas that I got when I evaluated the way to keep my pictures for 20 years or more. I am already using some of this methods for my pictures. I am open to other suggestions and comments. General considerations  No single solution for storing digital content is perfectly safe for 20 years or more ...

Why is my smartphone charging very slow on USB ?

Image
Better read: Data Consistency in Distributed System - CAP, PACELC Morality series - a heptalogy This blog is mainly focused on my Philosophical and theoretical ideas. From time to time I have practical posts that are too few to deserve a blog by themselves. I still hope my other work (like above) is even more valuable than such practical article as below. * * *   Sometimes the phone is connected to a charger, it reports "charging", however the battery level increases painfully slow, or it could even actually decrease. What is the solution? On short: Update 2020 : prefer original chargers. Even using QC 3.0 charger, some Samsung phones (like A51) will charge faster with original charger - when the display is ON. With display OFF, QC 2.0/3.0 chargers might still be as fast as original chargers. For phones, prefer the 1A ("phone") charger port to the 2A ("tablet") charging port. The 2A port is likely to charge slower than the 1A port (see below why)...