Questions tagged [kolmogorov-complexity]
Kolmogorov complexity, informally, is the amount of code it takes to describe or produce a constant object, such as a string or image. When posting a challenge in this category, please make sure it adds something new to existing challenges.
607
questions
33
votes
62answers
10k views
Generate a deck of cards
Here's an array representing a standard deck of cards, including two Jokers.
...
0
votes
13answers
465 views
Beginners 10x10 multiplication matrix [duplicate]
I was looking for a very easy task to look how short of a code can be produced on a beginners exercise.
The goal is to produce a simple table that looks like this common java/c# code is about 4 lines....
25
votes
54answers
3k views
Orthodiagonal steps
It's a common problem to navigate in a 2D matrix. We've seen it many times and will see again. So let's help future us and develop the shortest solutions to generate all eight possible steps in a 2D ...
1
vote
0answers
105 views
Golf a bit-reversal table [duplicate]
The Premise:
You are writing a C driver for a screen for use on an embedded system. The screen uses a tortured version of SPI that requires data to be sent LSb (least-significant-bit) first, but MSB (...
25
votes
33answers
4k views
You must construct ASCII Pylons!
Cross posted from my anagolf post (note: may contain spoilers, post mortem).
Output the following text exactly.
You may have additional trailing whitespace on each line, and trailing newlines as ...
24
votes
3answers
504 views
Race Around the Track
I'm looking to find the fastest racer around. Show me your fastest lap around this 18x14 track shown below.
...
10
votes
14answers
2k views
find the pattern in this number sequence of 1's and 0's
Write the shortest program or function which generates these 1000 numbers or a sequence (0- or 1-indexed) which begins with them.
...
8
votes
8answers
629 views
99 Varieties of Dosa
99 Varieties of Dosa is a popular chain of roadside dosa stalls across South India. This is inspired by a combination of this chain and the classic CodeGolf challenge "99 Bottles of Beer".
Recreate ...
4
votes
6answers
682 views
0
votes
5answers
295 views
Yet another “draw a box” Question [duplicate]
The following problem is a common interview question, thus dull answers are discouraged. Go short or creative, best if both:
Create the following pattern
...
21
votes
8answers
1k views
Fizz Buzz with unique characters in columns
Inspired by Digits in their lanes and 1, 2, Fizz, 4, Buzz
Introduction
Your task is to generate exactly the following output:
...
20
votes
40answers
3k views
The next colour
Challenge
Consider the rainbow as seven colours, represented by strings as Red Orange Yellow Green Blue Indigo Violet.
Your task is to create a program that ...
30
votes
47answers
4k views
Which Card is it?
Introduction
Long ago, when I used to code card games with usual playing cards, I used to specify a number for each card and call a function with some number to get a card. This somewhat inspired me ...
5
votes
3answers
617 views
Make a hammer animation
The goal is to make a two frame animation with ASCII art of a hammer smacking a table.
Trailing white-space is allowed and the frames need to repeat continuously. The program should iterate over both ...
19
votes
14answers
2k views
33
votes
5answers
2k views
Left Hand vs. Right Hand ā Typists Challenge
Your task is to pit each side of the keyboard against each other and build two programs, in the same language, one using only keys on the left-hand side of a standard keyboard that outputs ...
35
votes
33answers
6k views
Create a Magic 8 Ball
As a child, my friend had a magic 8 ball that we would ask questions to and see what the fate of that question was.
Challenge
Your challenge is to write a program (or function) that when run (or ...
37
votes
39answers
4k views
Hast Thou Slain the Jabberwock?
Your task is to output the exact string
The Jabberwocky
without taking input. Normal rules for input and output apply, so both functions and programs are ...
11
votes
4answers
352 views
Continued Fraction of Digit-wise Sum of Square Roots
Introduction
Your task is to generate the first 1000 terms in the continued fraction representation of digit-wise sum of square root of 2 and square root of 3.
In other words, produce exactly the ...
-3
votes
3answers
279 views
Print the numbers -1, 0, 1 [duplicate]
This is a very simple challenge, and it is to print the numbers -1, 0, and 1.
The following ...
28
votes
13answers
8k views
Print “Hey Jude” from The Beatles
Your task is to write a program which prints following four verses extracted from the lyrics from The Beatles' song "Hey Jude" (Ā© Sony/ATV Music Publishing LLC):
...
39
votes
44answers
7k views
Kolmogorov shifter
Output or display the following three lines of text, exactly as they are shown below. A trailing newline is accepted.
...
12
votes
3answers
739 views
A Zealous “Quick Brown Fox” “Jumped” Along the Groovy Spiral
Introduction
Write a program to output the outgoing spiral of the famous pangram following given rules.
Challenge
A pangram is a sentence using every letter of a given alphabet at least once. One ...
43
votes
10answers
5k views
Falcon Heavy stages
Choose a set of four bytes without replacement (i.e. no byte repeated), and not necessarily in any particular order, from any one of the following four sets:
The characters of any one single-byte ...
63
votes
161answers
15k views
The Programming Language Quiz, Mark II - Cops
A repost of this challenge. Meta discussion. Sandbox post. Body of the question similar to the original
Robber's challenge
This cops and robbers is now (08/03/2018) closed to further competing cop ...
11
votes
12answers
1k views
List all palindromic prime dates between 0000-01-01 and 99999-12-31
You know what a palindrome, a prime and a date are.
Your task is to list all dates in 100 thousands of years that fulfill
all three characteristics.
Nevermind anything but the numbers, use the ...
25
votes
48answers
2k views
Confusing Alphabet Staircase
Given no input, output this interesting alphabet pattern in either case (the case has to be consistent) via an accepted output method:
A
AB
ACBC
ADBDCD
AEBECEDE
AFBFCFDFEF
AGBGCGDGEGFG
AHBHCHDHEHFHGH
...
25
votes
23answers
4k views
Traffic direction
Rules
Given an ISO3166-1-Alpha-2 country code your task is to decide on the traffic direction for that country:
Input will be a valid country code (valid as in it's an element of the two lists ...
6
votes
10answers
476 views
Print the alphabet Christmas tree [duplicate]
I know it's 1.5 weeks after Christmas but trying to print an isosceles triangle in a monospaced font makes it look weird.
Challenge
Print the alphabet from A to Z so that it forms a filled triangle ...
42
votes
41answers
3k views
A Programming Puzzle of Mode Golf
Your task is to print the text Good morning, Green orb!, with every character repeated in place as many times as the most frequent byte in your source (the mode). ...
1
vote
30answers
822 views
Exponential-ish number sequence
Your program must print out this exact sequence:
1
2
4
10
24
54
116
242
496
1006
2028
4074
8168
16358
32740
65506
131040
262110
NOPE!
As usual, shortest program ...
22
votes
3answers
596 views
Draw an ASCII key signature
Given an input of a note, output an ASCII drawing of the corresponding major
key on the treble clef.
Here are all the major keys (that don't include double-sharps or double-flats)
and their ...
19
votes
16answers
2k views
Mirrored Digital Clock
Many digital clocks display the time using simplified digits comprised of only seven different lights that are either on or off:
When mirrored horizontally, the digits ...
42
votes
77answers
4k views
A very long Terza Rima
Description
Output the rhyme scheme for a very long Terza Rima.
Input
None.
Output
...
17
votes
97answers
5k views
Output the language name times the number of characters [closed]
Challenge:
Your task is to use any language to output that language's name times the number of character's in its name.
Use the common name or acronym of the language.
If there are
multiple versions ...
21
votes
11answers
2k views
Unicode Fractions
Given a fraction in the format m/n (where m and n are coprime integers), output the corresponding Unicode fraction. Your program/function will not be expected to ...
17
votes
7answers
1k views
Electron Configuration
In atomic physics and quantum chemistry, the electron configuration is the distribution of electrons of an atom in atomic orbitals. For example, the electron configuration of the neon atom is 1s2 2s2 ...
14
votes
21answers
2k views
Iterated phi sequence
Related: Iterated phi(n) function.
Your challenge is to compute the iterated phi function:
f(n) = number of iterations of Ļ for n to reach 1.
Where ...
20
votes
11answers
2k views
Print me a scale
Oh no! I have a theory test soon and I don't remember the scales yet! Help me remember my major scales by printing the following:
...
8
votes
14answers
3k views
Coffee Machine Machine
You left your computer for too long, and it went to sleep. Wake it up again by printing the following coffee maker.
...
13
votes
24answers
2k views
Scoop me an icecream please
Make me an icecream cone please
We have a ton of great ice cream places here in New England. Most of them are closed for the winter now, so...
...
0
votes
4answers
457 views
The thousand character classic
Background
The Thousand Character Classic is a chinese poem written around the 4th Century CE in China, and memorized by large populations since then. The name comes from not only its length, but its ...
11
votes
18answers
1k views
Reversed Engineered from Uniqueness (Robber's Thread)
Given the output of the cop's program (o), the byte-count (n) and the number of unique bytes (...
31
votes
97answers
5k views
Alphabet Staircase
The Challenge
Your task is to create a program or function that outputs the following with no input:
...
7
votes
5answers
469 views
Demonstrate a lower bound for the Ramsey number R(4,4)
A special case of Ramsey's theorem says the following: whenever we color the edges of the complete graph on 18 vertices red and blue, there is a monochromatic clique of size 4.
In language that ...
-2
votes
23answers
484 views
8 8's make 1000
Print the following output of a happy coincidence addition pattern:
8
8
8
88
+888
----
1000
Rules:
No leading spaces except the ones already present
...
54
votes
23answers
8k views
Confirm the Illuminati
The Illuminati commands you (with their mind control) to output the following string:
...
76
votes
29answers
3k views
4
votes
17answers
391 views
Any digital permutation
Task
Your task is to output a single integer, with one restriction: its digits must be a permutation of [1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6].
For example, you could output 653443653152432, ...
14
votes
25answers
2k views
Hopping numbers
TASK
print integers n, where 12 <= n <= 123456789, and all pairs of consecutive digits in n have the same positive difference between them (e.g. 2468 but not ...