The general idea has always been that humans learn from their past experiences, and that a machine follows instructions given by humans, but what if humans could train machines to learn from past data, allow them to improve over time when exposed to new data, and then learn from what the machine produces after that?

Well, at that point we need to get familiar with algorithms.

Algorithms are a set of specific steps to solve a problem. When you want to cook a meal, it is necessary to implement a set of specific steps, starting from preparing the ingredients, mixing them together, and ending with serving the meal. These steps are called algorithms, but can the solutions that become Provided by computer science in the virtual world valid for our problems we humans in our real world?

Congratulations, dear reader, you started your own business after years of struggle as an employee, and the stage of hiring employees came. You want an assistant for you, and of course you want him to be the most efficient applicants for the job, and they are a hundred people, here you face a simple problem, which is that you do not have enough time to do all this The number of interviews is careful, yet you want the best person as possible, so you decide to meet the applicants one by one quickly, and decide to accept or reject him immediately after he leaves the interview, and whoever is rejected, you will not be able to retrieve him again.

Well, it's a really quick way to choose your assistant, but you're afraid to accept someone at the beginning of the interviews, and miss out on someone more worthy and more qualified you might meet later, and you're also afraid to keep looking for the best, so you keep rejecting applicants until there's only a few left, so you have to choose one of the rest forced.

This is called the secretary problem, which was popularized by Martin Gardner in 1960, and is represented by the simple question: When do we stop at a candidate and choose him for the position offered?

The solution lies in the 37% rule, that is, to interview the first 37% of job applicants, then use it as data to check the average abilities of applicants in general, then continue your way in the interviews and choose the first person who is better than the previous 37%.

This ratio is then considered the tipping point at which you have the highest probability of getting the best applicant for your job.

Although this selection strategy may seem a bit strange, your chance of reaching the perfect decision without it may be very small, of course the chances of choosing the most efficient person increase when you have a lot of time and effort to conduct all the interviews, and rank people in ascending order from best to worst, you can then increase the percentage of The success of your choice, but in some jobs for which a thousand or more people apply, for example, we need a quick way to choose, with high chances of success.

This ratio specifically comes from the world of mathematical probabilities as the best computational point at which we can stop and choose between the available options, when we want to calculate the probability of choosing (X) from the available number of options (N), and after rejecting a number of options (M), it was found that the best ratio Maximizing the value of (X) is 37%.

Another example, when you want to buy new shoes, but you do not have enough time to search in all the stores, for example, if you have thirty minutes to buy, then allocate 37% of the time - that is, about 11 minutes - in exploring the shoes in the stores that pass you by, then choose after This is the first shoe you like from the following stores.

If you want to search for housing;

Because you moved to a new city, then started visiting the homes that were nominated for you, and you would like to have the best possible odds of success, divide the search time into 10 days For example, start visiting the first several homes, until 37% of the number of days available for the search is finished , That is, after about 4 days, your task now is to look for a better house than the one you visited in the previous days, so that it becomes your new residence.

Imagine that you are visiting a city, and you want to choose between two restaurants, a restaurant that you get used to and know what it offers, and another that you have not eaten at before, do you choose the guaranteed restaurant that you know and trust?

Or do you venture out and explore the cuisine of the new restaurant?

The previous example is an explanation of what is called the problem of exploration or exploitation. When you face several decisions to choose from, you find yourself trapped between choosing an old thing that you know and trust, and therefore you are here exploiting the information and experiences you have gained throughout your life. or surrender to the spirit of risk and exploration, and try something new to you;

It may be better than your usual old option.

The machine learns by constantly repeating operations, which allows it to learn over and over again how to make a decision that is more correct than the time before. Here AI scientists have developed so-called Multi armed bandit problem solving algorithms to help you solve this kind of problem.

Imagine that you are in front of several lucky machines, each machine has an arm, if you pay this arm, you will win an amount of money, this amount varies from one lucky machine to another, which machine will you choose?

Are you starting with a machine you've played on before and know that it earns you an acceptable amount of money?

Or do you choose a new machine that you do not know whether you will win or lose from it?

This is a famous example of the exploration and exploitation dilemma, where the goal is to explore the best option out of a set of options and then exploit the selected option later.

One of the algorithms developed by scientists, the epsilon-greedy algorithm, helps us achieve a balance between exploration and exploitation, whereby 10% of the time is allocated to exploration at random among the available options, and the remaining 90% is allocated in favor of exploiting the best options that appeared in the exploration phase, and with Repeating it constantly, you will find that what was new has become old, and it has become among your acquaintances that you will use afterwards.

If we want to apply this to the example of a restaurant, if you are in a hurry, and you have almost several hours in this place, and you want to eat, here you must take advantage of your previous knowledge and experience, and therefore go to lunch in your old restaurant, due to the limited resource you have time.

But if you are at the beginning of your trip and you have a week in this place, explore new restaurants in 10% of your time, so you have added the experience of the new restaurant in itself to the sum of your experiences, so you will use it on the next visit within the remaining 90% of the time, and you now have a chance to visit Coming to the same city to try another new restaurant within 10% of your time, or to eat at restaurants you already know, some of which were once new.

The number of shy salespeople is greater than the number of shy PhD students

In your opinion, which of these two scenarios is closer to reality: a shy young man who prefers to be alone most of the time, is he working in the field of sales, or is he preparing a doctorate in a specific field of mathematics?!

If your answer leans in the direction that this young man is doing his PhD, think again.

To understand it clearly, let's talk in terms of numbers. How many young people in sales do you think?

How many people are preparing doctoral dissertations in mathematics?

The difference is huge, and if we assume, for example, that those who work in marketing and sales are ten times those who prepare a doctorate, and if we assume that only 15% in the field of sales have a shy personality, and that 75% of PhD students are shy, we will discover that the chances of this young man being in the category of workers in Sales are twice the chances of him being a PhD student.

The previous way of thinking is called the Bayes rule, named after Thomas Bayes, the English theologian and mathematician from the eighteenth century, and it describes the probability of something happening based on what we have of previous information about the circumstances surrounding that matter, and whenever we have information Further, the probability is close to reality.

If you had information about the number of salespeople compared to PhD students in mathematics before you were asked, your answer would have been completely different. Here it is important to know the previous information before anticipating the possibility of something happening.

When you read a news story that a person had his house robbed by the cleaner who frequents him daily, you find that people are terrified of the cleaners, thinking that they will be robbed soon, but they neglected to think about the small percentage of thieves cleaners compared to the largest proportion of the honorable of them. We don't keep in mind the information and numbers surrounding an issue.

If you want to make a decision related to something, try to collect as much information as you can at the beginning, then with time add what new information to what you have, take your time and practice that, it is not easy to appear, but some professional managers make naive mistakes At this point, when an employee makes a mistake in a task assigned to him, the manager punishes the employee without thinking or studying this decision, the matter is simple for this manager, this employee made a mistake and must be rewarded, justifying himself that such a decision would make other employees more eager to succeed, Besides deterring that employee from making mistakes again.

But when you think of Bayes' rule, you initially gather the previous information about this employee, the nature of his work, and his past mistakes?

Or is he a competent employee who before that accomplished many tasks successfully?

What effect does that penalty have on him?

When you answer these and other questions, you may eventually find yourself making a decision to grant leave to that employee;

In order to regain his activity and enthusiasm for work, so as not to make a mistake again, do you notice the difference between the two decisions?!

Congratulations on the promotion, you are now sitting in your new office in your company, you feel luxurious and important, no doubt, but you also began to feel the upcoming responsibility, as you see the manifestations of the employees’ celebration of you in the amount of files that began to increase on your desktop, then you realize that you need more organization and arrangement And your old randomness won't work here.

British computer scientist Maurice Wilkes invented in 1965 what is called the cache memory (cache), meaning that there are successive levels of memory, each level contains a set of information, so that the closest level contains the most used information, and the slightly higher level contains information that may be They are used occasionally, while the higher level contains information that you may not need but should have;

As you may need it infrequently.

It is like your bedroom, where there is usually a chair on which the most used clothes accumulate, so it is closer to you than your clothes arranged in the closet, which you often resort to only if your usual clothes are dirty, or the nature of clothes changes due to a different occasion.

The Least recently used algorithm provides a way to organize information, making the most used information at a nearby level, so it becomes easy to access it in case of chaos. If you have a library where you keep your books, and you are currently reading a book, then allocating a place nearby In front of the library to put that book whenever you finish a chapter in it makes it easy to go back to reading it, this place is called the cache, so you don't need to search for it throughout your library, as well as for important files that you need to work on, so don't get lost among the rest of the files.

As for the “First In First Out” algorithm, it is a simplified way to arrange your inventory, whether in a consumer store, pharmacy or grocery store, for example. We put the products that we introduced first in reach, and behind them are the newest products, so that upon consumption, the oldest is withdrawn, and we protect Inventory from its expiration date before being spent.

In the late nineteenth century, Italian economist Vilfredo Pareto noticed that about 20% of the pea plants in his garden produced 80% of the healthy pea crop. This prompted him to think about the unequal or unfair distribution of wealth, finding that about 80% of the land Italian is owned by 20% of the population. Pareto was also surprised when he found that this percentage is close when he applied it in different industries and fields, and concluded the following: 80% of the results come from 20% of the reasons. This is called the Pareto principle, the 80/20 rule, or the Law of the Vital Few.

The Pareto principle is not limited to economics and wealth distribution, but also extends to business administration, computer science, health, and sports.

For example, Microsoft found that if more than 20% of reported errors are fixed, 80% of related errors and crashes will be eliminated. It also found that 80% of all users generally use only 20% of the features of different applications. In the programming process itself, it was found that the most difficult 20% of program code takes 80% of the time to write these programs.

Here we come to the conclusion that a small percentage of the inputs contributes the largest amount of output, you yourself, dear reader, notice that you use a small percentage of your clothes out of the total of your other clothes hanging in the closet, or that you communicate with a small group of those close to you much less than the total of your friends .

Although the Pareto rule is not an algorithm in the sense referred to at the beginning of the report, it gives us an 80% chance of success by taking care of 20% of things. When learning a new language, you will find that by memorizing 20% ​​of the language score, you will succeed in about 80% % of daily conversations, in English for example, the 2,000 most common words in the English language make up about 90% of conversations.

Also in the areas of marketing and sales, we find that a small group of customers contribute to the largest income for a company, they are called the influential few, so you find that caring for them - whether by providing distinguished customer service, or communicating with them constantly to improve the quality of products - contributes to increasing the satisfaction of these customers , and then increase profits.

______________________________________________________________

Resources:

In addition to the sources listed above, the author relied on the book "Algorithms to Live By: The Computer Science of Human Decisions" by Brian Christian and Tom Griffiths.