OpenLLM-France/wikimedia huggingface dataset:
# Puzzles/Logic puzzles/Getting out of Prison/Solution

Puzzles | Logic puzzles | Getting out of Prison | Solution
"Out of the answers 'left' and 'right', which door would the other guard say doesn't lead to freedom, if I asked her?" - The answer will be the door that leads to freedom. Both guards will answer the same.
OR similarly
"Would the other guard tell me to go through your door to get to freedom?" If either guard says "Yes," go through the other guard's door. If either says "No," go through her door.. (Here actually a tautology[always true statement] is being asked from the guard. In simple form we are asking the question "Does freedom gate guard lie?")
OR alternatively
Trick question: "If I asked you whether the door you guard is the execution room, would you say yes?"
If the guard you asked was guarding the freedom room, the lying guard would have said Yes to the simple question "Is this the execution room?", but when asked whether he would say yes to this simple question, he has to lie and say No to the Trick question.
If the guard you asked was guarding the freedom room, the true guard would have said No to the simple question "Is this the execution room?", and when asked whether he would say yes to this simple question, he will truthfully say No to the Trick question.
Thus if it is the freedom door, either guard will give the answer No to the Trick question.
If the guard you asked was guarding the execution room, the lying guard would have said No to the simple question "Is this the execution room?", but when asked whether he would say yes to this simple question, he has to lie and say Yes to the Trick question.
If the guard you asked was guarding the execution room, the true guard would have said Yes to the simple question "Is this the execution room?", and when asked whether he would say yes to this simple question, he will truthfully say Yes to the Trick question.
Thus if it is the execution door, either guard will give the answer Yes to the Trick question.
Therefore:
If the answer to the trick question by the guard you ask is No - then that guard is guarding the freedom door.
If the answer to the trick question by the guard you ask is Yes - then that guard is guarding the execution door. (OR) You can ask simply to the either of the guard "Is this my execution day?" If he answers "no" then you probably should take the other way out.Or if he says yes he is telling the truth and you should take the path guarded by him.
# Puzzles/Logic puzzles/Getting out of Prison 2/Solution

Puzzles | Logic puzzles | Getting out of Prison 2 | Solution
"If I were to ask you which door leads to freedom, which door would you tell me?" If the guard is the liar, then he would have lied and told you the wrong door, but is now lying and telling you that he would have told you the correct door. If he is a truth-teller, he is telling you truthfully that he would have told you the correct door. Either way, whichever door the guard points to leads to freedom.
(A simple solution may be to ask any guard to point out the door he guards.....anyone will point to freedom door only)
# Puzzles/Logic puzzles/Gold Coins

Puzzles | Logic puzzles | Gold Coins
5 pirates of different ages have a treasure of 100 gold coins. On their ship, they decide to split the coins using this scheme: the oldest pirate alive will propose how the coins will be distributed among the pirates, and all pirates remaining will vote for or against it. If more than 50% of the pirates vote for it, then the coins will be distributed as such. Otherwise, the pirate proposing the scheme will be thrown overboard, and the process is repeated with the pirates that remain.
Assuming that all 5 pirates are extremely intelligent, rational, greedy, and do not wish to die, (and are rather good at math for pirates) what will happen?
Solution
# Puzzles/Logic puzzles/Gold Coins/Solution

The eldest pirate will propose a 97, 0, 1, 0, 2 split.
Working backwards, splits in terms of younger to older:
2 Pirates: Pirate two splits at 100, 0. Otherwise, and perhaps even then, pirate 1 (the youngest) votes against him and over he goes!
3 Pirates: Pirate three splits at 0, 1, 99. Pirate 1 (the youngest) is going to vote against him no matter what (see above), but this way, pirate 2 will vote for him, to get at least one gold out of it.
4 Pirates: Pirate four splits of 1, 2, 0, 97. This way, pirate 1 will vote for him, and so will pirate 2 - they're getting more than they would under 3 pirates.
5 Pirates: Pirate five splits of 2, 0, 1, 0, 97. This way, pirate 1 will vote for him, and so will pirate 3 - they're both getting better than they would under 4.
# Puzzles/Non-scientific puzzles/Boy, Girl, and a Dog

Puzzles | Non-scientific puzzles | Boy, Girl, and a Dog
A boy, a girl, and a dog simultaneously begin movement from one point. Boy and girl are heading in one direction, boy - with speed 5 km/h, girl - 4 km/h. The dog runs from boy to girl and back with speed 10 km/h. Given that it takes no time for the dog to change direction, how much will the dog travel in 1 hour?
Solution
# Puzzles/Non-scientific puzzles/Less than Two Million/Solution

Puzzles | Non-scientific puzzles | Less than Two Million | Solution
"n is an integer that is less than 2000000."
"n is an integer that is either negative, 0, has fewer than 7 digits, or has 7 digits and its first digit is 1."
"n/2 < 1 000 000 |n being an integer (and similars equations)."
# Puzzles/Luoshu Squares
## History

Luo Shu (or known also as Nine Hall Diagram) was considered to be a tool used for divination by ancient Chinese feng shui masters.
There are several slightly different stories about different masters, the more popular one is about the Emperor Yu walking along the river Lo (thus Lo Shu Square is translated as the Scroll of River Lo). This legend dates way back to 650 BC, which is the times of great floods in China. The turtle that emerged from the river had an unusual 3 x 3 pattern on its shell which later became the basis of the Lo Shu Square, a mathematical grid where the sum of numbers from each row, column or diagonal is the same. An ancient Chinese master derived the wisdom of the magic square from the patterns on the back of the turtle. See pics 1. By reading those patterns he saw a deeper pattern of natural rhythms, or laws of the Universe as expressed in the Lo Shu square.The black circles depict even (feminine) numbers or yin; the white circles, odd (masculine) numbers or yang
Basically, no matter which direction you add the numbers – horizontal, vertical or diagonal – they always add up to 15. Also note that numbers highlighted in red are odd numbers meanwhile numbers highlighted in blue are even numbers.
Number 15 is considered a powerful number because it corresponds to the number of days in each of the 24 cycles of Chinese solar year. In other words, it is the number of days in the cycle of the new moon to the full moon. See pics 2
After several centuries, the 3x3 magic square made its way out of China and entered the Indian subcontinent. The 4x4 magic square was used as part of rituals in India from vedic times, and continues to be used till date. The Kubera-Kolam is a floor painting used in India which is in the form of a magic square of order three. It is essentially the same as the Lo Shu Square, but with 19 added to each number, giving a magic constant of 34. See pics 3
At the beginning of the fifteenth century, magic squares reached Europe . A magic square appears in one of Albrecht Durer's best engravings, "Melencolia" (1514).See pics 4
* Pic 1: The pattern of magic squares
* Pic 2: Chinese Loshu Square
* Pic 3: 4X4 magic square (Typical magic squares in India)
* Pic 4: Engraving details of magic square found in Melencolia (1514)

## Puzzles

Could you figure out what is the magic square numbers for Luoshu ? Here are some rules / hints
* All the squares can be filled by each number (1 to 9) once only
* The number of middle/center of the squares are 5
* The numbers that are directly horizontal/vertical ( + ) to the center are odd numbers
* Each number can be added horizontal, vertical and diagonal to be total of 15
** If still stuck, refer to pics 1

## Solution

The answer are as below:

## Bibliography

* https://www.thespruce.com/feng-shui-magic-of-the-lo-shu-square-1274879
* http://www.taliscope.com/LoShu_en.html
* https://hypernumber.blogspot.com/2015/01/magic-square-in-lo-shu-magic-square.html
* http://www.chinaknowledge.de/Literature/Daoists/hetuluoshu.html
# Puzzles/Non-scientific puzzles/Less than Two Million

Puzzles | Non-scientific puzzles | Less than Two Million
What sentence about an integer $\,n$ is true if, and only if the values $\,n$ takes are less than two million?
Solution
# Puzzles/Medium Sequence 1/Solution

The sequence is a$_n$ = A(n,n), starting at a$_0$. (A is of course the Ackermann function.)
So the next number in the sequence is $2^{2^{2^{65536}}}-3$.
# Puzzles/Medium Sequence 3/Solution

The digits of Pi. 1 4 1 5 9 2 6
# Puzzles/Non-scientific puzzles

Puzzles | Non-scientific puzzles
* Boy and Girl
* Less than Two Million
* Boy, Girl, and a Dog
* Mathematical Character
# Puzzles/Non-scientific puzzles/Boy, Girl, and a Dog/Solution

Since the dog travels at 10 km/hr, in 1 hour it will cover 10 km.
The boy moves at 5km/hr the girl at 4km/hr. After 1 hour the distance between them is 1km. The dog is within 1km. The distance between the boy and girl will increase linearly over the one hour, to its maximum of 1km. During this time the dog has been running back and forth at 10km/hr.To calculate its exact position is a VERY scientific question.
The boy moves at 5km/hr the girl at 4km/hr, but we don´t know for how long they have being moving. They could have just started to move and there´s virtually no distance between them. So the dog, whatever his speed, could just had travel a couple meters. Also we dont know if he stops when he gets back to the boy or continues running, and for how long. Or if his speed is constant and movement linear. Maybe after a 100 meters he got tired and took a nap.
# Puzzles/Non-scientific puzzles/Boy and Girl

Puzzles | Non-Scientific Puzzles | Boy and Girl
A boy and a girl are talking.
    "I am a boy" - said the child with black hair.
    "I am a girl" - said the child with white hair.
At least one of them lied. Who is the boy and who is the girl?
# Puzzles/Non-scientific puzzles/Boy and Girl/Solution

Puzzles | Non-Scientific Puzzles | Boy and Girl | Boy and Girl Solution
If only one of them had lied, we'd have to conclude that both are boy or both are girl. This is impossible, so both of them must have lied. Therefore, the child with the black hair is the girl, and the child with the white hair is the boy.
# Micronations/Micronational war/Emerian-American War

Emerian-American War
May, 2013
When American police illegally crossed the Emerian border, and captured two off duty Emerian soldiers as tourists who were falsely accused for undisclosed reasons in Corpus Christi TX, the Emerian Premier Alexander Meade was immediately notified of the incident by the U.S.R.E. Ministry of Foreign Affairs. With multiple failed attempts in requesting the release of the two POWs, an infuriated Emerian Government was given the order by Premier Alexander Meade to launch a covert operation into Corpus Christi with Emerian Naval Commando forces.
In the conclusion of the two hour stand off that ensued between Emerian Naval Commandos and American Police, the tension eventually ended with the release of the two Emerian POWs and the Emerian forces returning to the U.S.R.E. with them. The aftermath led to a Cold-War like rivalry between the Socialist nation of the U.S.R.E. and the Capitalist nation of the United States.
# Micronations/List of past micronations/Republic of Rose Island

The Republic of Rose Island (Esperanto: Respubliko de la Insulo de la Rozoj) was a short-lived micronation on a man-made platform in the Adriatic Sea, 11 kilometres (6.8 mi) off the coast of the province of Rimini, Italy.

## History

In 1967, Italian engineer Giorgio Rosafunded the construction of a 400-square-metre (4,300 sq ft) platform supported by nine pylons, and furnished it with a number of commercial establishments, including a restaurant, bar, nightclub, souvenir shop and a post office. Some reports also mention the presence of a radio station, but this remains unconfirmed.
The platform declared independence on 24 June 1968, under the Esperanto name "Insulo de la Rozoj", with Rosa as self-declared President. Both Esperanto rozo(plural rozoj) and Italian rosa (plural rose) mean "rose". Soon afterwards Rose Island issued a number of stamps, including a stamp showing the approximate location of Rose Island in the Adriatic Sea. The purported currency of the republic was the "Mill" and this appeared on the early stamp issues, although no coins or banknotes are known to have been produced. This denomination was translated into Esperanto as "Miloj" on later stamp issues (it is unrelated to the Esperantist currency spesmilo).
Rosa's actions were viewed by the Italian government as a ploy to raise money from tourists while avoiding national taxation. Whether or not this was the real reason behind Rosa's micronation, the Italian government's response was swift: a group of four carabinieri and Guardia di Finanza officers landed on the "Isola delle Rose" and assumed control. The platform's Council of Government is said to have sent a telegram, presumably to the Italian government, to protest the "violation of its sovereigntyand the injury inflicted on local tourism by the military occupation", but this was ignored.
On 13 February 1969, the Italian Navy used explosives to destroy the facility, an act later portrayed on postage stamps issued by Rosa's self-declared Government in exile.
# Micronations/Micronational war/Achenbach Rebellion

The Achenbach Rebellion was a very short actual war that was to stop a number of Dutch and German invaders who staged a rebel insurrection and attempted to overthrow the Sealandic government. During the time, Prince Roy of Sealand was away in Britain! The rebels took Prince Roy's son Michael hostage and took Sealand by force. Once Prince Roy returned, he quickly captured the rebels and held them as prisoners of war. Then a while later, Germany and the Netherlands requested that Sealand repatriate the citizens to their homeland. The Dutch citizens were released immediately, but the German, having been convicted by Prince Roy's government of treason (for claiming to represent the legitimate government of Sealand), was held for longer. But after a day or two, he was sent home. The quick war was the first to have involve interaction with other countries, and was a huge victory for Sealand!
# Micronations/Micronational war/First Conch-American War

The First Conch-American War was a one-minute-long war between the Conch Republic and the United States. It ended in a Conch defeat.

## Provoking factors

In 1982, the United States Border Patrol set up a roadblock and inspection point on US 1 just north of the merger of Monroe County Road 905A/Miami-Dade County Road 905A onto US 1 (they are the only two roads connecting the Florida Keys, where the Conch Republic is now located, with the mainland), in front of the Last Chance Saloon just south of Florida City. Vehicles were stopped and searched for narcotics and illegal immigrants. The Key West City Council complained repeatedly about the inconvenience for travelers to and from Key West, claiming that it hurt the Keys' important tourism industry. Eastern Air Lines, which had a hub at Miami International Airport, saw a window of opportunity when the roadblocks were established; Eastern became the only airline to establish jet service to Key West International Airport, counting on travelers from Key West to Miami preferring to fly rather than to wait for police to search their vehicles.

## Secession and war

When the City Council's complaints went unanswered by the federal government and attempts to get an injunction against the roadblock failed in court, as a form of protest Mayor Dennis Wardlow and the Council declared Key West's independence on April 23, 1982. In the eyes of the Council, since the federal government had set up the equivalent of a border station as if they were a foreign nation, they might as well become one. As many of the local citizens were referred to as Conchs, the new nation took the name of the Conch Republic.
As part of the protest, Mayor Wardlow was proclaimed Prime Minister of the Republic, which immediately declared war against the U.S. (symbolically breaking a loaf of stale Cuban bread over the head of a man dressed in a naval uniform), quickly surrendered after one minute (to the man in the uniform), and applied for one billion dollars in foreign aid.

## Aftermath

Soon after the conclusion of the war, the roadblock and inspection station were removed. The secession of the Conch Republic also resulted in the creation of a new avenue of tourism for the Keys, as henceforth anyone visiting Key West would be visiting a foreign nation, which many people relished just for its novelty.
# Micronations/Micronational war/Francian-Gustavian Civil War

Well however small this micronation had two political parties and well one family the francias family said they were the rightful rulers the other wealthy family claimed independence with 27 casualties (2 from suicidal thoughts) but then the fighting was 2 battles in with the francias family lost
# Puzzles/Logic puzzles/Two Boys and a River/Solution

Puzzles | Logic puzzles | Two Boys and a River | Solution
The two boys approach different sides of the river.
# Puzzles/Logic puzzles/Sudoku/9 by 9/Example 1 solution

| 5 | 7 | 3 |
| 2 | 1 | 8 |
| 6 | 4 | 9 |
| 9 | 1 | 4 |
| 5 | 6 | 7 |
| 3 | 8 | 2 |
| 6 | 2 | 8 |
| 4 | 9 | 3 |
| 7 | 5 | 1 |
| 9 | 6 | 5 |
| 1 | 3 | 2 |
| 4 | 8 | 7 |
| 2 | 7 | 3 |
| 8 | 4 | 6 |
| 1 | 5 | 9 |
| 1 | 8 | 4 |
| 5 | 7 | 9 |
| 3 | 6 | 2 |
| 3 | 5 | 4 |
| 7 | 2 | 1 |
| 8 | 9 | 6 |
| 6 | 2 | 8 |
| 4 | 9 | 5 |
| 7 | 3 | 1 |
| 9 | 1 | 7 |
| 8 | 3 | 6 |
| 2 | 4 | 5 |
# Puzzles/Logic puzzles/Three Knights/Solution

Puzzles | Logic puzzles | Three Knights | Solution
The small knight is the Knight of Life. The fat knight is the Knight of the Dungeon. The tall knight is the Knight of Death.

## Reasoning

The tall knight is not the Knight of the Dungeon, since if he were neither of the other knights could be the Knight of Life. Since he lied, he is not the Knight of Life. Therefore, the tall knight is the Knight of Death. The small knight must then be the Knight of Life, leaving the fat knight as the Knight of the Dungeon.
Provided the fat knight tells the truth he can not be the Knight of Life as he is pointing out the tall knight as Knight of Life. The answer of the tall knight contradicts the answer of the fat knight. Therefore, the fat knight was lying. The tall knight can not be the Knight of Life, because he would have said so when directly asked, who he is. We can conclude that the small knight is the Knight of Life and he is pointing out the tall Knight as Knight of Death as he is always telling the truth. The last job position left for the fat knight is the Knight of Dungeon.
The convict can be happy that the tall knight did not answer: 'Yes, I am the Knight of Life'. In this context, it would have been possible and would have left our convict very unfortunate, because his chance to find the Knight of Life would have been reduced by 50%
A better tactic would be to ask each Knight: "If I asked you who the Knight of Life was, whom might you identify?" The Knight of Life would correctly identify himself. If asked "Who is the Knight of Life?" the Knight of Death would incorrectly identify either himself or the Knight of the Dungeon. Hence, when asked how he might respond, he would lie again, and state that he would have identified the correct Knight of Life (double negative). The Knight of the Dungeon is the unknown quantity, but when at least two Knights agree on someone, that is the correct identification.
Unfortunately not foolproof, as if he would have identified the Knight of the Dungeon for his first lie, he could then pick to instead identify the Knight of Death for his second lie.
# Puzzles/Logic puzzles/Three Knights

Puzzles | Logic puzzles | Three Knights
A man was sentenced to death, but the king wanted to give him a last chance. He asked the man to choose from one of the three knights that were there. One of the knights was the Knight of Life, and he always told the truth. The second Knight was the Knight of Death, and he always told lies. The third knight was the Knight of the Dungeon. He sometimes lied and sometimes told the truth. If the man chose the Knight of Death, he would be executed before sunset. If he chose the Knight of Life, he would be acquitted and set free right away. If he chose the Knight of the Dungeon, he would spend the rest of his life imprisoned in the Dungeon. The man was allowed to ask the three knights one question each.
Thus, he asked the fat knight, "What is the name of this tall knight?" The reply was, "He is the Knight of Life." He asked the small knight, "What is the name of this tall knight?" The reply was, "He is the Knight of Death." Then he asked the tall knight, "Who are you?" "I am the Knight of the Dungeon" was the reply. After that, the man was able to correctly choose the Knight of Life, and was set free immediately.
Who is the Knight of Life, and who are the other two knights?
Solution
# Puzzles/Logic puzzles/Two Boys and a River

Puzzles | Logic puzzles | Two Boys and a River
Two boys approach the shore of a river. There is a boat, but only one boy can fit in. The only way to get to the other side is by boat, and the boat is unable to move itself. Given this puzzle has a solution, how can both boys get to the other side?
Solution
# Puzzles/Logic puzzles/Two Cities

Puzzles | Logic puzzles | Two Cities
There are two cities, one of them is called City of Lies, and the other - City of Truth. Those who were born in City of Lies always lie. Those who were born in City of Truth always tell truth. Residents of each town visit the other town from time to time, so when you ask someone a question you don't know if he would lie or not.
You are in one of these cities, and your task is to determine which city you are in by by asking a random bypasser one question. What question should you ask?
Solution
# Puzzles/Logic puzzles/Two Cities/Solution

Puzzles | Logic puzzles | Two Cities | Solution
You should ask: "Were you born in this city?" if answer is "Yes", this is the City of Truth. If "No" - City of Lies.

## Reasoning

For "yes" given as an answer:
If the person is honest, then the person was born in the city, so it is the city of truth
If the person is dishonest, then that person was born in the other city, so this is the city of truth
For "no" given as an answer:
If the person is honest, then the person was born in the other city, so this is the city of lies
If the person is dishonest, then the person is lying and was born in this city, so it is the city of lies
# Puzzles/Logic puzzles/Two Cities - Same Response/Solution

Puzzles | Logic puzzles | Two Cities - Same Response | Solution
Can you tell the truth?
OR
Which city are you from?
etc...
# Puzzles/Logic puzzles/Two Cities - Same Response

Puzzles | Logic puzzles | Two Cities - Same Response
There are two cities, one of them is called City of Lies, and the other - City of Truth. Those who were born in City of Lies always lie. Those who were born in City of Truth always tell truth. What is a question you can pose to a resident (of one of the 2 cities) that will yield the same answer, irrespective of which city that resident belongs to ?
Solution
# Programmable Logic/HDL Basics

This page of the Programmable Logic book is a stub. You can help by expanding it.
* Hardware Design Languages
* HDL Comparison
# Programmable Logic/Implementation Flow
## Implementation Flow

* Synthesis
* Mapping
* Placing
* Routing