Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [optimization]

A mathematical puzzle where you have to optimize a certain objective function (maximize profit, minimize cost).

8
votes
3answers
2k views

Folding a paper wouldn't be this hard

Alice and Bob started to play a game with a piece of A4 paper. Alice is going to cut that paper as she wants and will give it to Bob, then Bob will fold the paper from anywhere he wants. In the game, ...
5
votes
3answers
150 views

Fill $N$ by $M$ grid with numbers in such a way that any given cells' neighbors are different

Create an $N$ by $M$ grid with numbers in such a way that satisfies following conditions: numbers should be integers that range from $1$ to $r$. for any cell $C$, all its adjacent neighbors (i.e. ...
3
votes
3answers
1k views

Three coins for the fair king [duplicate]

Based on the question Eight coins for the fair king: I saw a comment saying "There isn't a good solution known even with three coins in all cases". So the challenge here is to try to solve the same ...
45
votes
6answers
3k views

Eight coins for the fair king

You are responsible for creating new types of coins for the court. King respects the forgetful: he wants you to create 8 coins of different value, no more. King respects the feeble: he wants that any ...
5
votes
3answers
591 views

Should I kill all of my elves?

I've been playing a simplified variant of The Great Elf Game for a few days now and I'm struggling to identify an optimal strategy. Rules: You start with 12 elves. Each elf is sent to gather a tree ...
6
votes
4answers
1k views

Coloring the Chess Board

We have 8x8 Chess board like grid (8x8 2D matrix) and we are trying to color every single square/cell. But the rules are interesting; You may start from any square you want and color that square for ...
9
votes
4answers
427 views

Cupcake division

A elementary school student brought cupcakes to their class to celebrate their birthday! However, there's a problem: There are 25 students in the classroom, and only 24 cupcakes! The students have ...
-1
votes
1answer
104 views

Annual Meet Puzzle

The annual meet was attended by 20 persons. The persons who attended the meet have worked in eight different firms – M, BC, K, A, BA, D, PC and E. The following table provides information about the ...
5
votes
2answers
177 views

The Minimized Dropmate

I don't know, but I think my opponent just may be cheating in this chess game. So, the natural thing to do is cheat right back! My plan is to put black pieces on the board so the white king is ...
1
vote
0answers
66 views

Are there basic weighing puzzles requiring adaptive strategies?

Let us define a basic weighing puzzle as such: There are <number> identical balls, except one weighs <more/less/a different amount than the others> A balance scale may be used to weigh two ...
10
votes
5answers
802 views

Optimize a keyboard for one-finger typing

The ubiquitous QWERTY keyboard layout works well enough for ten-finger touch typing (though Dvorak proponents may disagree). But what if you're typing a text message on a mobile phone? Those fiddly ...
8
votes
1answer
205 views

Create your own custom ruler

There is a blank ruler of $X$ units. You are going to set $9$ marks on this ruler so that you will be able to measure all integer values from $1$ to $X$ units with only one measurement. What is the ...
12
votes
3answers
2k views

Removing 100 digits from the first 100 numbers

Write the first 100 positive integers next to each other to form one big number: $$123456789101112131415161718192021\dots90919293949596979899100.$$ If we remove 100 digits (not necessarily consecutive)...
13
votes
4answers
3k views

A dice game, what is the optimal strategy?

Alice was walking on the street when she came across a man playing with a die. She could not help trying to check if the die was loaded and while she was concluding that it wasn't loaded, the man ...
8
votes
1answer
447 views

Clearing the Robot Museum

The grand opening of the Collapsible Robot Museum is just 1 week away in the robot nation of Robotia. The museum is unique because shortly after the museum closes, the building collapses into a flat ...
3
votes
2answers
332 views

Rectangles and Diagonals

A 4×4 table has 18 lines, consisting of the 4 rows, the 4 columns, 5 diagonals running from southwest to northeast, and 5 diagonals running from northwest to southeast. A diagonal may have 2, 3 or 4 ...
2
votes
2answers
323 views

33 stones into gold transmuter

There is a magic transmuter which turns stones into the gold! But this transmuter works weird. Every time you put a stone or more stones and press a button, it takes that stone into a slot in the ...
10
votes
1answer
247 views

Barrel - Part 3

An entry in Fortnightly Topic Challenge #35: Restricted Title 1. Title based on this xkcd. This is a continuation of Barrel - Part 1 and Barrel - Part 2, but this puzzle is still self-contained. ...
13
votes
1answer
387 views

Candy Button Paper

An entry in Fortnightly Topic Challenge #35: Restricted Title 1. Title based on this xkcd. Your biggest dream has come true: you have an infinite supply of your favorite five-flavor candy button ...
6
votes
1answer
349 views

Red Fish Blue ꟻish

You are presented the following six cards. The red cards are rotations of F, and the blue cards are rotations of ꟻ (backwards F). Your goal is to make it so that the red cards are rotations of ꟻ (...
19
votes
2answers
1k views

A thirsty king and his knights

The black king has spent his life fighting over this strange checkered land, the white king has finally been defeated and his troops have surrendered and pledged allegiance to him. Now he's not sure ...
8
votes
1answer
170 views

Mitosis of 80 bioelectronic cells

You are working in a bio-laboratory, where they produce some special bioelectronic cells which have mitosis ability. FYI: Mitosis is a process of cell duplication during which one cell gives rise to ...
4
votes
1answer
180 views

Find the fake bar in 2 weighing [duplicate]

You are given 8 equal sized bars of silver labeled a to h. You know for a fact one of them is fake, and the only measurable difference is weight. However you do not know if the fake bar is heavier or ...
9
votes
6answers
1k views

Optimizing month abbreviation to number

(This comes from a real-world requirement.) The idea is easy - if you have the three-letter abbreviated name of a month, say "Jan", get the numeric month number (for "Jan", 1). Sure, sure, pick a ...
5
votes
3answers
249 views

Crazy queen in checkers

Checkers Checkers, also called draughts, is an interesting game. all pieces are placed on black tile and are all pawns at the start. When a pawn reach the final line, a powerful piece is created: the ...
6
votes
3answers
311 views

5 Tires with maximum distance

I just bought a car with $5$ identical tires on it, as you guess $4$ of them were already installed, just one is in the trunk. The seller said that while the tires on the front, they can go $48k$ ...
5
votes
1answer
2k views

Is there only one solution to the “Ten Penny Puzzle” or more?

Not knowing the dimensions of the square in the Ten Penny Puzzle I ask if there is more than one unique solution that isn't a reflection/mirror of the one shown in the video, if you know the ...
5
votes
3answers
1k views

Hacking an electronic keypad v2

This is related to Hacking an electronic keypad. You are a spy trying to break into an enemy facility. The back door is protected by an electronic keypad lock. You know that this particular lock is ...
5
votes
2answers
700 views

How much money can we make? v2

This is follow up question to How much money can we make? My five friends and I used to loan each other money all the time. But over the past several years we have moved apart. We don't trust ...
2
votes
1answer
235 views

The A-B chocolate puzzle!

Imagine you have 2 types of chocolates (A and B). You randomly pick up two chocolates at once from your bag in a specific pattern. If the same type of chocolates come out, you give them both to your ...
22
votes
3answers
938 views

How much money can we make?

My five friends and I used to loan each other money all the time. But over the past several years we have moved apart. We don't trust PayPal, banks, or the postal service so transferring money over ...
9
votes
2answers
480 views

Smallest Army on a chessboard

This is actually similar question to Biggest army on a chessboard. But it is kinda different way of asking. In this game, you are supposed to put the least amount of pieces into the board where there ...
1
vote
1answer
266 views

Scheduling Meetings

I came across this problem in real life and thought it could be made into an interesting puzzle. I will enjoy seeing how my eventual solution could be improved! Here's the situation. There ...
8
votes
3answers
526 views

Acids and Bases

I have 6 solutions. 3 of them are acids, and 3 of them are bases. The acids and the bases (HCl and NaOH respectively) both have solution with a concentration of $0.1M$, $1M$, and $10M$. I don't know ...
28
votes
5answers
3k views

Biggest army on a chessboard

Reminder: Everybody knows that we can place 8 queens in a chessboard without threatening each other (see here). Same reasoning can be applied for knights, bishops, rooks and kings. Giving ...
-4
votes
1answer
146 views

Maximize gold bars [duplicate]

You have encountered 100 gold bars in a cave. In the cave, a goblin shows you 3 holes in the wall. He says one hole will triple what you put in it, one hole will leave it as the same amount, and one ...
7
votes
2answers
398 views

99 chips into more chips V2

This is follow up question of 99 chips into more chips, which is originally: You are at a casino in Vegas and you have earned 99 chips by playing poker! While you are checking out a slot ...
8
votes
1answer
2k views

99 chips into more chips

You are at a casino in Vegas and you have earned 99 chips by playing poker! While you are checking out a slot machine, someone comes to you and congratulates you that you have a chance to make more ...
16
votes
7answers
2k views

Soldiers in the Parade Ground

Twenty-five soldiers are standing in a parade ground consisting of a five-by-five grid of large concrete slabs, laid out in a neat north-to-south, east-to-west square array. Each soldier is standing ...
17
votes
2answers
798 views

numbers want to cross a river, but their sum must be a square number

In the world of numbers, numbers 1 to 9 want to cross a river, They have a boat which can take 1 to 3 numbers, But sum of the numbers must be a square number. The boat can not sail back itself, so ...
6
votes
3answers
370 views

The Alchemist's brew

I'm an Alchemist and I want to prepare Universal Panacea. That's a precious thing and I will be able to sell it for good money. The complete recipe for the Panacea is of course very complex (and ...
39
votes
7answers
5k views

Amnesiac in a ring shaped palace

Related: Turn off all lights in a ring-shaped palace Your boss has trapped you inside a ring-shaped palace, and all you know about the palace is that there are some number* of identical rooms, each ...
10
votes
1answer
322 views

Minimize the intersection area

You are given two identical pieces of paper of size $a \times \sqrt{2} a$, like the standard DIN A4 paper. Put one paper on top of the other, such that none of the corners is under or above the other ...
1
vote
1answer
268 views

The counterfeit coin [duplicate]

You have 9 coins. One of the nine is counterfeit. The counterfeit coin can be distinguished by weight - it is heavier than the rest. Using a balance scale only twice, find the counterfeit coin.
13
votes
1answer
409 views

Hiding Cat Puzzle on a Grid

The Youtube channel MindYourDecisions posted a video about the "Hiding Cat Puzzle". In the puzzle, you have a line of five boxes, one of which contains a cat. You don't know where the cat is, and your ...
-2
votes
2answers
164 views

Best strategy to finding gas station [closed]

We need to refuel and we don't know where the nearest gas station is. We are at a crossing which looks like: ← ↑ →. What is the best strategy to find the gas ...
5
votes
3answers
244 views

A Counterfeit $100 Bill among 93 Bills

You have $93$ of $100 bills and there is a counterfeit 100 dollar among them. You do not know which one is counterfeit bill. You go to the bank and ask whether if there is counterfeit among a group of ...
2
votes
1answer
171 views

How many drops you need to make. You are allowed to break 2 eggs in the process [duplicate]

You are given 2 eggs. You have access to a 100-story building. Eggs can be very hard or very fragile meaning it may break if dropped from the first floor or may not even break if dropped from 100th ...
8
votes
2answers
699 views

Warehouse Maximum Capacity

You own a warehouse which is a 7x7 grid of cells. You must arrange a maximal number of boxes in the warehouse so that you are able to travel to any given cell. Here are the specific conditions: You ...
2
votes
1answer
640 views

3 cannibals and 3 missionaries on different side of the river

Three missionaries on the left side of a river and three cannibals on the right side of the river want to cross a river using a boat which can carry at most two people, The boat is on the cannibals ...