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
20
votes
31answers
1k views
Print a conversion table for (un)signed bytes
Your task: Print or return a conversion table with every byte from 00 to ff's value as an unsigned integer, to its value as a ...
41
votes
11answers
5k views
The first published picture of the Mandelbrot set
Here’s the picture of the first published picture of the Mandelbrot set.
Use the fewest bytes possible to write a program or function that outputs the following.
A trailing new line is permitted. ...
23
votes
15answers
2k views
-3
votes
10answers
357 views
Rocket Liftoff!
This code golf challenge is about making a rocket liftoff sequence.
Your output (STDOUT) should be equal to this:
...
26
votes
70answers
3k views
Quickly! Group together!
As of 27/12/20, the challenge is over as no new answers were posted on the 26th. With an astounding 55 points (and 21 answers), the winner is pppery!
A quick shout out to the top 5 scorers as well:
...
13
votes
5answers
771 views
Write a Unicode Unpacker
We all know scoring by characters is ripe for abuse. Let's prove this.
The Challenge
Output the following:
...
17
votes
5answers
2k views
Convert Magic the Gathering colours to a Colour based deck name
Magic the gathering has many unique names for colour combinations in decks, as an example when Blue and White appear together in a deck, the deck maye sometimes be named after the Ravnican Guild that ...
-1
votes
16answers
510 views
Implement Smokey's !!/coffee command. (Part 2)
Like the previous SmokeDetector challenge? This one is for you too ;)
Note: SmokeDetector is a bot that detects spam and offensive posts on the network and posts alerts to chat.
What to implement
...
15
votes
15answers
2k views
Implement Smokey's !!/alive command
Note: SmokeDetector is a bot that detects spam and offensive posts on the network and posts alerts to chat.
What to implement
Smokey's !!/alive command uniformly ...
9
votes
2answers
275 views
Inverse quine: print everything except your program
Write a program which will eventually, given enough time, print all possible permutations of ASCII characters (both printable and non-printable) less than or equal to its length, except itself. The ...
11
votes
9answers
1k views
Peel away the layers - Robbers
This is the Robbers thread. For the Cops challenge, see here
As the robbers, your job is to crack the cops' answers. Choose an uncracked, unsafe cop answer and attempt to figure out which languages, ...
21
votes
13answers
3k views
Peel away the layers - Cops
In this cops-and-robbers challenge, robbers must crack cop answers by finding out which languages the cops used.
This is the Cops thread. For the Robbers' challenge, see here
Cops, you are to write a ...
15
votes
10answers
1k views
Output the International Phonetic Alphabet
The International Phonetic Alphabet is a system of phonetic notation intended to be able to accurately represent every sound used in spoken language.
The alphabet contains 29 vowel letters ...
2
votes
14answers
600 views
Prime Challenge
CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?
...
25
votes
6answers
1k views
Build an alphabetised polyglot
As TIO can show, every letter of the Latin alphabet is represented when it comes to languages. For every letter there is at least 1 programming language whose name begins with that letter. Your task ...
24
votes
12answers
2k views
31
votes
85answers
8k views
Print X without X (robber's thread)
This is the robber's thread of a cops-and-robbers challenge. You can view the cop's thread here
A pretty common beginner style question is to print some string, but, there's a catch!, you need to do ...
52
votes
91answers
9k views
Print X without X (cop's thread)
This is the cop's thread of a cops-and-robbers challenge. You can view the robber's thread here
A pretty common beginner style question is to print some string, but, there's a catch!, you need to do ...
38
votes
5answers
2k views
Find me a Tinder date!
Ah, Tinder . . . the app that takes the code golf approach to online dating. With just a few well-chosen right swipes and a bit of luck (or a cute puppy pic), you too could have more matches than /(?!)...
-3
votes
6answers
348 views
Print om sign with pi
This time I will give you an easy challenge:
Print the Om sign with \$\pi\$!(Sorry for many challenges with \$\pi\$)
Here is the om sign drawn using pi numbers:
...
9
votes
7answers
1k views
25
votes
17answers
3k views
A long long time ago, in a galaxy … right here
Task
Given a positive integer return the geologic era and period it was that many million years ago.
Input/output
The input is a string or integer; the output is a string. Eras and periods are ...
24
votes
2answers
2k views
Get string “-” with JavaScript using only the symbols from “+[]”
Challenge: Get the JavaScript string value containing only the "-" character using code only containing the following three symbols: ...
26
votes
21answers
2k views
Logo Pack LAPACK
This is the logo for LAPACK, a widely used software library for numerical linear algebra.
Your task is to print the logo (color and matrix brackets not required) as this exact string. Trailing ...
30
votes
24answers
3k views
14
votes
4answers
2k views
Archimedes's cattle problem
Compute, O friend, the number of the cattle of the sun which once grazed upon the plains of Sicily, divided according to color into four herds, one milk-white, one black, one dappled and one yellow. ...
30
votes
11answers
2k views
Implement Entombed's lookup table
Background
Entombed is an Atari 2600 game released in 1982, with the goal of navigating through a continuous mirrored maze as it scrolls upwards. In recent times, the game has been subject to research ...
7
votes
5answers
315 views
Print the Black Mirror episode title
Given two integers, s and e, print the title of Black Mirror series #s episode #e.
Expected output is as below, case sensitive. Output for blank cells and invalid inputs is unspecified.
...
38
votes
20answers
7k views
Print the SARS-Cov-2 (COVID-19) genome
Background
As you probably learned in biology class, DNA and RNA are composed of strands of nucleotides; each nucleotide consists of a chemical called a base together with a sugar and a phosphate ...
-5
votes
2answers
292 views
Output NC_045512, the first sequenced genome of SARS-CoV-2 (COVID-19) [closed]
Output the variant NC_045512 of SARS-CoV-2. The genome's raw form is available here.
Lowercase and uppercase are both acceptable
You must output with the letters A, C, T, and G.
An arbitrary number ...
5
votes
3answers
605 views
Solve the Rook's Round Trip
The riddle
In yesterday's newspaper, I found a puzzle in which a Rook should start in the lower-left corner of a 12x12 checkerboard and then, during a round trip, visit each field exactly once except ...
33
votes
16answers
3k views
11
votes
11answers
1k views
Win 270 electoral college votes
You are the electoral strategist for a sudden late entrant in the 2020 US presidental election.
Your task: print out the names of states* your candidate will win, totalling at least 270 electoral ...
37
votes
11answers
1k views
lc's dvntrs n Wndrlnd
The task
Today's special offer: consonants and punctuation for FREE!
Your program or function will be given as input the first 6 paragraphs of Lewis Carroll's famous novel Alice's Adventures in ...
15
votes
13answers
2k views
Rod of Asclepius
With this challenge we pay homage to everyone around the whole world fighting against the coronavirus crisis; particularly represented are the people tied to medicine, as the Rod of Asclepius is a ...
30
votes
34answers
5k views
Help, I've mixed my week up!
My dog ate my calendar, and now my days are all mixed up. I tried putting it back together, but I keep mixing up the days of the week! I need some help putting my calendar back together, with the days ...
50
votes
31answers
7k views
Conway's Monster
This challenge is in honor of mathematician John Conway who passed away April 11, 2020 due to COVID-19. He was famous for coming up with the Game of Life cellular automaton and many other mathematical ...
-1
votes
11answers
290 views
Let's start with a brainy quote
The challenge today is to write a program that outputs a known proverb, Where there is a will, there is a way., that means if someone is determined to do something, ...
12
votes
4answers
2k views
Who's that pokemon (based on its etymology)?
As we all know, most Pokemon are created by combining some English (or Japanese) words; these words are the Pokemon's "etymology." For example, "charmander" is "char" and "salamander" put together.
...
4
votes
6answers
243 views
FizzBuzz: Least unique bytes [duplicate]
Introduction:
Although it seems challenges scored by least unique characters have been attempted, there are few which were well-received. I think it's a potentially interesting scoring criterion, as ...
17
votes
12answers
1k views
Day of the week of an ambiguous date
Goal
Write a program or function that returns the day of the week for a date, eg.
01/06/2020 -> Mon
However, it's unknown if the date is in the format mm/...
29
votes
81answers
3k views
Numbers by Position
Numbers by Position
Challenge
Print the numbers:
1
22
333
4444
55555
666666
7777777
88888888
999999999
In that order.
I/O
Takes no input. The numbers can ...
21
votes
22answers
5k views
Print a list of iPhones
Write the shortest program that prints, in order, a complete list of iPhone iterations, according to this site:
...
2
votes
0answers
142 views
Predictor Generator [closed]
Write a program that when given a string \$S\$, it generates a program of the same language as itself.
The generated program, when given a continuous substring of \$S\$, should predict the next ...
0
votes
0answers
114 views
Let's learn a bit French: 99 Bottles [duplicate]
The 99 bottles in French
The lyrics of the song goes like this:
...
31
votes
19answers
4k views
Print this maximally long URL
Task
This one is simple. We want to compress a URL, but don't trust URL shorteners.
Write a program that prints to stdout (or a 0-argument function that returns) the following, working URL:
http://...
8
votes
6answers
746 views
How predictable is popular music?
The McGill Billboard Project annotates various audio features of songs from a random sample of the Billboard charts. I scraped this data to produce the following file of chord progressions:
...
28
votes
15answers
7k views
.-…--..---.-…--… the red-nosed reindeer
Can you recover a sequence of letters from a sequence of dots and dashes? In Morse code, x is represented by -..-, but without ...
23
votes
25answers
3k views
Even and Odd Numbers
Sandbox
Adapted from exercise 4 of 100 little Keg exercises
The ability to repeat chunks of code within a program is an important part of any programming language. Also just as important is the ...
8
votes
3answers
705 views
What is a short code for generating this matrix in R?
I can see that it is 101 'moving to the right' but I cannot think of a short way to generate it in R language.
\$\begin{bmatrix}
0 & 1 & 0 & 0 & 0 & 0 \\
1 & 0 & 1 & 0 ...