# Questions tagged [decision-problem]

For challenges which involve deciding whether or not the input meets certain criteria, and outputting some data, representing that decision.

664 questions
Filter by
Sorted by
Tagged with
2k views
+200

### Crossing a Lily Pond

The Narrative You are a frog who is at the edge of a pond with waterlilies. You would like to cross the pond without getting wet, so you plan to jump from lily to lily. There is, however, one problem: ...
• 975
1k views

### Is Wally there?

Inpired by recent Stand-up Maths' video. Task Wrapping a list x can be seen as inserting "line-breaks" into x every <...
• 10.7k
4k views

### Is this expression Python 2/3 safe?

Given an expression like 4 / 2 + 3, determine whether the expression has the same value in Python 2 and Python 3. Recall that in Python 2 division rounds down (so ...
• 11.7k
2k views

### Is this polynomial a square?

Given an integral polynomial $p$, determine if $p$ is a square of another integral polynomial. An integral polynomial is a polynomial with only integers as coefficients. For example, $x^2+2x+1$ ...
• 32.7k
2k views

### Is it 1089-able?

$1089$ is a very special number. To prove why, select any 3-digit number whose first and last digits differ by at least 2. Then, reverse the digits, and take the difference of these two numbers. ...
• 16.9k
737 views

### Will this makina program halt?

makina is a cell-based esolang composed of automata which move around a grid. These automata follow paths of instructions that direct their movement. Your task is to, given a makina program using only ...
• 3,204
838 views

### Ragged list pattern matching

Given a pattern and a ragged list of positive integers, your task is to decide whether the pattern matches the ragged list. The pattern is also represented by a ragged list. But in addition to ...
• 32.7k
692 views

### Is this propositional formula an instance of an axiom?

Please help me automate my discrete mathematics homework. Given a valid propositional formula, check if it is an instance of one of Łukasiewicz's axioms. Here's how it works. A term can be defined ...
• 971
2k views

### Is it irrational?

Your task is to make a program that decides if a real number between 0 and 1 is irrational or not. As stated, this is obviously impossible, so instead we will use the following definition: ...
• 6,645
529 views

### Can you draw this in one stroke?

Related | Related Given an ASCII art with |, _, and , check if you can draw the art in one ...
• 3,605
2k views

### Can the Tune be Played?

Can the Tune be Played? Explanation A broken musical keyboard has keys labelled with positive integers. It is broken in two ways: It takes a long time to process key presses: after pressing the key ...
• 837
3k views

### Gambling with an Alien

You met a 4-th dimensional being who challenged you to a game of dice. The rules are simple: each player rolls 3 6-sided dice and takes the sum of each combination of 2 dice. The player with the ...
• 391
504 views

### Solve an alien wordle

You've arrived on an alien planet. The writing system, the culture and the language there are completely foreign to any language you know. But somehow they are all playing wordle already. So as a ...
• 84.6k
596 views

### Is it a sub-permutation?

A finite-permutation is a function which takes an $n$-tuple and produces an $n$-tuple such that every element of the input is present in the output, and the ordering does not rely on the values of ...
• 84.6k
2k views

### Is it a tower permutation?

A tower is made out of layers, each one being one unit shorter than the one below it. Every layer is completely on top of the previous layer. For example, here is a tower along with it's height map: <...
• 6,645
3k views

### Is it a fibonacci-like sequence?

The Fibonacci Sequence is a sequence of positive integers where the first two elements are 1 and the rest are the sum of the previous two. It begins $1, 1, 2, 3, 5, 8, 13$ and continues forever. But ...
• 26.7k
786 views

### Golf the prime numbers in Shue

I'd like to introduce a new? programming language I call Shue (Simplified Thue). It has very simple syntax. Here is a program that checks if an input is divisible by three: ...
• 6,645
303 views

### Is it a bigger regex?

You are given two regexes and your task is to determine if the strings matched by the first regex are a subset of the strings matched by the second regex. For this we are going to use a limited ...
• 6,645
1k views

### Is given number a concat of two squares

Given a positive integer, determine if it can be represented as a concatenation of two square numbers. Concatenated numbers may not begin with 0 (except for 0). Any leading zeros in input should be ...
• 227
307 views

### Mahjong Checker

Mahjong is a tabletop game played using tiles. It features three "number" suits (pins, sous, mans, represented as p, s ...
• 3,031
446 views

### Can I wall glitch to there?

Background In a 2d game that I play, each screen is a 2d grid of tiles with walls and walkable tiles, with the player only able to travel on walkable tiles, and being stopped by walls. When the player ...
• 3,802
2k views

### Write a spam-detection program

You work for a social media platform, and are told to create a program in a language of your choice that will automatically flag certain post titles as "spam". Your program must take the ...
3k views

### Sum of two squares

Given a nonnegative integer $n$, determine whether $n$ can be expressed as the sum of two square numbers, that is $\exists a,b\in\mathbb Z$ such that $n=a^2+b^2$. ...
• 3,931
755 views

### Check if a matrix is Zarankiewicz-maximal

My final-year project at the National University of Singapore is on Zarankiewicz's problem: What is the maximum number of 1s in an $m×n$ binary matrix ($m$ rows and $n$ columns) with no $a×b$ ...
• 753
275 views

### Is it a possible Hearts result?

Hearts is a 4-player game that uses the following scoring rules: Everyone starts with score 0. Each round every player gets a non-negative amount of points. The sum of the points is 26, and at least ...
• 12.7k
1k views

### Reversed Multiple Pair

Intro Two numbers are a reversed multiple pair if they satisfy the following property: $$a\cdot b = \operatorname{reversed}( (a-1)\cdot b )$$ Here, $\operatorname{reversed}()$ means to reverse the ...
• 3,053
511 views

### Is there a stable way to stack these?

If we have a binary matrix then we will say that a $1$ is stable if it is in the bottom row or it is directly adjacent to a $1$ which is stable. In other words there must be a path to the bottom ...
• 84.6k
822 views

### Is this hexagon symmetric?

TLDR: This is the hexagonal version of Is this square symmetrical? Given a hexagonal grid, decide if it is symmetric. The shape of the grid is a regular hexagon. Each cell in the grid has two possible ...
• 32.7k
668 views

### Predicting pumpkin planting plans' potential problems

You are going to be planting pumpkins soon, and you are preparing your supplies. Pumpkins come in all sorts of sizes and have their sizes written on the seed bag. A pumpkin that is size n will grow ...
• 84.6k
1k views

3k views

### AoCG2021 Day 2: Naughty or nice?

Part of Advent of Code Golf 2021 event. See the linked meta post for details. The story continues from AoC2015 Day 5, Part 2. Santa needs help figuring out which strings in his text file are naughty ...
• 62.1k
3k views

### Will one-cell brainfuck halt?

Brainfuck is an esoteric programming language that is Turing Complete, meaning you can't tell whether a given program will halt without running it. It's cell-based and has an infinite tape of cells, ...
• 26.7k