# Questions tagged [algorithm]

A puzzle related to algorithms (a main concept in computer science). Puzzles may ask for an algorithm as an answer or require the analysis of a given algorithm.

180 questions
Filter by
Sorted by
Tagged with
1 vote
108 views

### What is the CMLL Algorithm that fits this particular case?

I implemented the CFOP method in my Rubik's cube solver. Now I am trying to add the Roux method. I couldn't find the right CMLL algorithm for this particular case. After consulting the CMLL algorithms ...
• 113
401 views

### Dishonest dungeon staff

You are faced with the difficult task to set up a dungeon for adventurers. However you made a deal with the guild: any adventurer brave enough to beat the dungeon and reach the treasure room will be ...
• 1,202
1 vote
122 views

### Early OLL parity detection and correction [closed]

Is it possible to detect the OLL parity of a scrambled 3x3 cube directly? I have reduced the 4x4 cube to a 3x3 cube. How can I check the parity of the resulting 3x3 cube - to check if an edge has been ...
3k views

### Magic: the Gathering – Scry-sort

Let me start with a formulation of the problem for people who aren't familiar with Magic: the Gathering. You have a stack of distinct cards face-down. You can apply the following actions arbitrarily ...
• 5,948
915 views

### Minimum number of flips needed to fully set a binary string

Source: My school teacher, it was just given as a problem statement. Problem: You are given a binary sequence $S$ of up to $10^6$ bits. You wish to set all the bits in the string to $1$, but the catch ...
• 103
1k views

### 1+3 Towers of Hanoi

There are four pegs in a row; let's call them A, B, C, and D from left to right. Peg A has a stack of $n$ differently sized disks, sorted in size so the smallest disk is at the top. All other pegs are ...
• 15.6k
85 views

### Heuristic function for estimating nurikabe puzzle state

I am trying to write a program for solving nurikabe puzzle. I need a method to approximately represent the state of the game in one number, to choose the best way for the algorithm to continue. I can'...
196 views

### Deciding whether a set of points on a 2D plane has axial symmetry [closed]

The problem to solve: Let's say we have a set of $n$ points on the 2D plane. Determine whether it has axial symmetry. My attempt so far: For n=2 the answer is trivially "yes". For n=3 ...
• 1,695
240 views

### stuck at robozzle 1251

Can anyone help me solve this robozzle? It is called bigPlus id 1251 http://www.robozzle.com/puzzle.aspx?id=1251
261 views

• 121
344 views

### Nuts and screws

Imagine that you are given a box with n nuts and n screws. Each screw have different size (diameter) and on each screw there is ...
• 263
672 views

### Cable with mixed wires

Let's say you have a cable that has n wires. Each wire on the left side corresponds to one wire on the right side. However you cannot distinguish between the wires ...
• 263
1 vote
716 views

### Solving Robozzle puzzle

I have a problem with solving the "Dispersion V2" puzzle on robozzle.com: The puzzle has a robot that can be moved and turned with a program. The goal of the puzzle is to have the robot ...
1 vote
626 views

### Help with solving 7x7 sub-centers inside 11x11x11 Rubik's cube -- errors in guide book

[companion question here] I was given an 11x11x11 Rubik's cube as a gift. It came with a guide book that I have been following to solve the cube. After solving four of the 9x9 sub-centers of the cube,...
• 141
1 vote
167 views

### Help with solving 5x5 sub-centers inside 11x11x11 Rubik's cube -- errors in guide book

[companion question here] I was given an 11x11x11 Rubik's cube as a gift. It came with a guide book that I have been following to solve the cube. I have solved four of the 9x9 sub-centers of the cube,...
• 141
1 vote
191 views

### Panini Linguistics Olympiad: Genes from Space

Problem: Alien Protein Codes Dr. Muzabique figured out how to manipulate six alien proteins to do three functions: construct, cut, and pack. The alien genetic code used to manipulate the proteins was ...
2k views

### The dessert problem (blind ballot remaining blind if non-unanimous) [closed]

A group of (possibly over-polite) people have just finished their meal at a restaurant. One of them asks, "Does anyone want dessert?" The table goes quiet. Some of the people might want ...
• 613
192 views

### Which sentences in S := {"the number of lies in S is a multiple of n" | n = 1,...,120} are true in every possible non-contradictory case?

Consider the set $S := \{$ "the number of lies in the set $S$ is a multiple of $n$" $|$ $n = 1, 2, 3, ... , 120 \}$. Question: Which elements/sentences in the set $S$ are true in every ...
1 vote
266 views

### Mastermind algorithm but for unique colors only

I have seen Donald Knuth's Algorithm to guess the correct pattern in maximum 5 tries. However, I want to write a program to find the correct pattern effectively however the code maker can only make a ...
2k views

### Orientate the centers of a Master Pyraminx (Pyraminx 4x4)

I have a very strange state on my 4x4 Pyraminx. The green side is solved and the other sides are almost solved, the problem is, on these 3 remaining sides the centers are not solved. The state looks ...
• 153
223 views

### General Fake Coin: k fake coins out of n coins

Considering a general fake coin problem. There are $n$ coins in total and $k$ of them are fake. Fake coins are lighter than the normal ones. You only have a balance to compare two groups of coins (no ...
269 views

### O princess, where art thou?

In the highest tower of her castle, a princess has N bedrooms which are arranged in a circle. She never sleeps in the same room on two consecutive days. Every morning she moves to another room by ...
840 views

### Exterminating blobs on a grid

On an infinite square grid, some of the squares are occupied by little creatures called blobs. Cute as they are, it is your mission to exterminate all of them! You only have two methods at your ...
• 32.5k
13k views

### What's the optimal strategy for Wordle?

Wordle is a game by Josh Wardle in which you try to guess a 5-letter word in at most six attempts. After each guess, the letters which are not in the word are highlighted in grey, the letters which ...
272 views

### How can the princess escape the prince?

This is the story of the sister of the princess in this puzzle. I will shamelessly copy-paste some parts of this post. I have no reference to give for this version as I adapted a Computer Science ...
• 193
604 views

### Algorithm to make two scrambled Rubik's cubes be exactly the same on all faces

There are millions of Rubik's cube combinations possible. If I have two 3×3 Rubik's cubes and both are scrambled, I want to make one scrambled cube exactly the same as the other without solving them. ...
165 views

### Copy that solution

This copy machine program prints the solution to a well-known puzzle.  Explanation of the syntax will follow. What solution will be printed for which well-known puzzle?  EXECUTION CODE .--> ...
• 21.9k
1 vote
403 views

### Find the hidden message in... this grid

(So I made this puzzle, and I wanted it to be fun rather than difficult! I hope it’s original enough) Given a 5x5 grid as input, here’s an algorithm: randomly select any 3x3 grid within the 5x5 grid ...
849 views

### Two dimensional Mastermind

You have probably played the classic game of Mastermind with 4 pegs and 6 colours. It turns out that the codebreaker can always find the pattern in 5 moves or fewer. Now consider the 2D version of the ...
• 36.2k
798 views

### Transform each square of a chessboard to zero

Each square of an 8x8 chessboard is marked with a positive integer. The integers can be changed according to the following two rules: (1) all integers in a row are doubled (2) all integers in a column ...
• 12.2k
270 views

### All possible locations of a robot going from $(x,y)$ to $(x+y, y)$ or $(x,x+y)$ [closed]

Suppose I had a little robot on the coordinate grid that moves according to the following rule. If it's at the point $(x,y)$, it can move to either $(x+y,y)$ or $(x,x+y)$. If the robot starts at the ...
1 vote
178 views

### Reverse Engineer Chess Software Calculations

TLDR Just the Puzzle Given a number n and a weight w the function f will result in a weighted number r as follows. f(n, w) = r n can be a number from 0 to 200 w can be a number from -100 to 100 (...
• 111
72 views

### Find the strategy: How to order without knowing [duplicate]

Imagine: You have a group of people in a room that is completely dark. Half of the group has red t-shirts and the other half blue t-shirts. The group gets told to think about a strategy to solve the ...
• 141
135 views

### A simple two-operation calculator. How to obtain any natural number from any other?

Imagine that you possess a very simple electronic calculator. It has a screen and ten buttons from 0 to 9 to enter natural decimal numbers (positive integers). However, it can perform just two unary ...
• 595
269 views

### Is it possible to solve the Cube in a Cube in a Cube in a Cube state using its own algorithm on a 4x4?

So, I got curious if I could solve from the cube in a cube in a cube in a cube position to the solved state just using its own algorithm. This is the one I was using: B' 2R2 2L2 U2 2R2 2L2 B F2 R U' ...
• 121
7k views

### The New York Time's "Letter Boxed" Puzzle (spoiler)

WARNING: I solved this puzzle and posted a solution below. I'm posting this more for muse. Hello! I don't know if anyone's enjoyed this puzzle on The New York Times website, but I find it rather fun. ...
• 31
173 views

1 vote
139 views

### Minimise battle time in Monster's Den

So there is this excellent flash game, Monster's Den. In order to make a high score, I must complete many battles..this question is about battles with the Legendary Monsters. The target is to reduce ...
• 4,585
376 views

### A robot moving on a grid

In the spirit the question I propose the puzzle: A robot is placed on a vertex of a grid. At each move the robot must take three steps along the edge of the grid. After each step the robot must turn ...
• 1,695
2k views

### A robot visiting every edge of a 4x4 grid

This is a harder version of this puzzle: A robot visiting every edge of a 3x3 grid A robot is placed on the top-left vertex of a 4x4 grid. At each move the robot can take one step (up, down, left or ...
• 36.2k
5k views

### A robot visiting every edge of a 3x3 grid

A robot is placed on the top-left vertex of a 3x3 grid. At each move the robot can take one step (up, down, left or right) along the edge of the grid to the adjacent vertex, but he cannot go outside ...
• 36.2k
3k views

### Find Local Maximum in an Integer Sequence

An element of an integer sequence is called a local maximum if it is not smaller than all its neighbors. E.g., all local maximums of the following sequence are bolded. 3, * 4 *, 2, 1, * 3 *, 2, * 8 *, ...
235 views

### Based on 9-trains puzzle

Based on this problem, we have got some algorithms that can sort the 9 train cars in a given specific arrangement. But say if the 9 train cars are given in any-arrangement? Say ABC ABC ABC ...
137 views

### demystify and paint me!

To demystify me, look and say. Then paint me not with colors but with array. ...
• 133
477 views

### Missing number in a set of four segment circles

This is a puzzle posted on a social networking site that I have been trying hard since yesterday to solve: My approach has been to find out a mathematical function with the numbers in the yellow, ...
621 views

### GameDev: stuck with first puzzle design, would love resources to study from or algorithm suggestions!

First time posting here and I'm really, really hoping this is the community I've been looking for. I'm developing a game, right now I'm in the middle of designing levels as the core mechanics have ...
• 143