Skip to main content

Questions tagged [open-ended-function]

For challenges where an exact output is not required but some property must still be fulfilled.

Filter by
Sorted by
Tagged with
7 votes
9 answers
1k views

Figure out which of your friends reveals confidential information to the media!

Exposition You send secret information to 100 of your friends, and the next day you discover that the information has been published! Who could have revealed it? To determine that, you number your ...
anatolyg's user avatar
  • 13.8k
8 votes
12 answers
2k views

Tic-tac-toe encode them all

I decided to create a complete guide to the great game of tic-tac-toe. I expected it to be extremely popular, so to save on paper while printing it I decided to encode all possible game positions. I ...
talex moved to Codidact's user avatar
0 votes
4 answers
231 views

Implement a Monad

A monad is a type that wraps another type, that represents the available operations on the wrapped type. Monads have the following associated operations, where M is ...
bigyihsuan's user avatar
  • 10.6k
9 votes
3 answers
227 views

Convert to Chomsky normal form

Let a context-free language be specified by its production rules and start symbol, e.g. S -> AbB | C C -> b | c B -> AA | AC A -> a | ε Here and in the ...
Parcly Taxel's user avatar
  • 3,935
10 votes
4 answers
2k views

Output a 1-2-3-5-7... sequence

Follow-up of my previous challenge, inspired by @emanresu A's question, and proven possible by @att (Mathematica solution linked) For the purposes of this challenge, a 1-2-3-5-7... sequence is an ...
Tbw's user avatar
  • 2,143
21 votes
15 answers
2k views

Output a 1-2-3 sequence

For the purposes of this challenge, a 1-2-3 sequence is an infinite sequence of increasing positive integers such that for any positive integer \$n\$, exactly one of \$n, 2n,\$ and \$3n\$ appears in ...
Tbw's user avatar
  • 2,143
12 votes
7 answers
1k views

Horsey sightseeing

A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. For those who are not aware of how knights in chess work, knights are capable of ...
totallyhuman's user avatar
  • 17.3k
19 votes
9 answers
996 views

Output an infinitely proportional sequence

In this challenge, an infinitely proportional sequence is defined as a infinite sequence of positive integers such that: All positive integers are contained infinitely many times within the sequence. ...
emanresu A's user avatar
  • 42.4k
17 votes
12 answers
1k views

Encode the input to exclude a given character (part 1)

Your task is to write 2 functions/programs. They may share code. The first function must, given a string and a character, output a new string that does not contain that character. The second function ...
mousetail's user avatar
  • 13k
6 votes
0 answers
215 views

Give the best Chaitin incompleteness bound

This was originally a pure mathematics question, but I think I've got the best chance for an answer here. The Challenge For concreteness, consider Peano Arithmetic (PA). For some language L of your ...
Charles Wang's user avatar
10 votes
9 answers
2k views

Make a super fair number

An even distribution number is a number such that if you select any of it's digits at random the probability of it being any particular value (e.g. 0 or ...
Wheat Wizard's user avatar
  • 99.6k
16 votes
3 answers
463 views

Convert numbers to dice patterns

The way points are assigned on a dice follows a regular pattern, the center dot is present if and only if the number is odd. To represent the even numbers, pairs of dots on opposite sides of the ...
bsoelch's user avatar
  • 6,035
19 votes
22 answers
3k views

Be big more often

Related You are a manager at a large number factory. You want to show everyone your business is doing well, by showing randomly chosen samples. Unfortunately, your business is not doing that well. But ...
The Empty String Photographer's user avatar
16 votes
5 answers
754 views

Prefix code generator

In this challenge, we consider an encoding from positive integers (up to a limit) to binary sequences. Some examples: ...
Bubbler's user avatar
  • 78.2k
13 votes
9 answers
3k views

Give the fool's Fibonacci sequence

Recently I asked for tips on improving some code-golf of mine. The code was supposed to output every third value of the Fibonacci sequence starting with 2: ...
Wheat Wizard's user avatar
  • 99.6k

15 30 50 per page
1
2 3 4 5
8