7

GAP and the automata package The average number is the number of pairs of words of length \$n\$ with Levenshtein distance up to three, divided by \$2^n\$. It is not very difficult to construct an nondeterministic finite automaton over the alphabet of pairs of bits that accepts the word \$(a_1,b_1)(a_2,b_2)\dots(a_n,b_n)\$ iff the binary words \$a_1a_2\dots ...


6

GolfScript/MathGolf/CJam, 2 bytes, score = 2/27 ≈ 0.074075 The most boring (yet probably the optimal) answer. (CJam's addition made the program longer by 1 byte; but this still contributes to the ending score...) Going forward to see what is the most common character choice for an evaluation operator... l~ TIO for MathGolf TIO for CJam TIO for ...


5

Jelly, 05AB1E, GolfScript 8 bytes, score = \$\frac 8 {27} \approx 0.296\$ .Vq;~ ɠV Try it online Jelly! Try it online 05AB1E! Try it online GolfScript! In all cases, takes a program in the relevant language from STDIN and executes it, with any output going to STDOUT.


3

GolfScript/Keg, 6 bytes, score = 3/4 = 0.75 Do we have to use at least one practical language? It doesn't seem to say that in the spec. ß.~\; Golfscript ß # Odd undefined ops . # Copy the input ~ # Evaluate it \; # Discard the unevaluated copy Keg ß # Take input & evaluate the input . # Output the result as a number ~ # ...


3

Keg and Python 3, 19 characters, score = \$ \frac{19}{8} \$ exec(input()) "ø¿ß" Try it online! (Keg) Try it online! (Python 3) Uses the same approach as Nick first did, but with Keg instead. I'll have to figure out how to add another language to get competitive again.


3

><> and Gol><>, 18 bytes + 3 + 6 = 27 '3d*:5-0@o~r{?H>o< Try it online! and "3d*:5-0@o~r{?H>o< Try it online! Both output the same program, but with the first character flipped between ' and ". Neither program is equivalent to itself in the other language, since the behaviour of @ differs.


2

Jelly, 13 bytes + 8 = score 21 “Ṿ;⁾v`+/ŒṘ”v` Try it online! RAD '“Ṿ;⁾v`+/ŒṘ”v`' Try it online! A Jelly quine that wraps itself in single quotes, such that the resultant RAD program simply prints the original Jelly program back out. Thanks to @JoKing for golfing the language name for the second program!


2

Python 3 Caddy, interprets BrainF*** Score: \$\frac{38}{224}\approx0.17\$ (with newlines removed) Program E from textwrap import wrap x = input('Code: ') i = ['<', '>', '+', '-', '[', ']', '.', ','] o = '' for c in x: if c in i: o += str(i.index(c) + 1) if o: d = wrap(o, 6) d = [int(x) for x in d] o = '' for c in d: ...


2

Wren, 37 bytes -System.print("Goodbye Cruel World!") Try it online! Explanation "Goodbye Cruel World!" // Define the string "Goodbye Cruel World!" System.print( ) // Output the string to STDOUT - // Apply negation upon the returned string // ...


1

W j, 7 / 2 = 3.5 points I updated the ord to support W's own code page. 0“„√*"C Explanation 0“„√*" % Define a string C % Convert to codepoints [48,15,16,23,42] Flag:j % Join the output list without a separator ```


1

W d, 17 bytes Weirdly enough, I got the same bytecount when I avoided the bonus! ¿M•}®0(`3‡Ƕ∑⑴⅀⅍ø≤ Unpacked: CD(IdK815Ak]T&:Q>`P/ After string-decompression: Goodbye Cruel World!"P/ Explanation "Goodbye Cruel World!" % Define the string "Goodbye Cruel World!" P % Output the string to STDOUT with a newline ...


1

W, 34 33/2 = 16.5 bytes s|x@`p"Goodbye Cruel"" World!"P+/ Explanation "Hello"p % Print "Hello" to STDOUT without a newline " World!"P % Output " World" to STDOUT with a newline "Goodbye Cruel" + % Join "Goodbye Cruel" with the string / % Perform ...


Only top voted, non community-wiki answers of a minimum length are eligible