-3
\$\begingroup\$

Introduction

Busy Beavers are programs (specifically Turing Machine programs) that aim to output the most ones as possible, while having the least states as possible and halting.


Challenge

Your challenge is to make a busy beaver, which outputs as many ones as possible, but also outputs a second busy beaver. That second busy beaver must be executable in the same language as the original program, and can be no more bytes than the program that produced it

So, for example, say my program was a. That program should aim to print as many 1s as possible, and also output another program, say b, which also aims to print as many 1s as possible and outputs another program etc etc etc. b must be no more bytes than a

The program should be printed after the 1s, separated by any reasonable delimiter.

The outputted programs must also not be the same as any of the previous programs. When no more programs are generated, the scores are calculated from there. For example, program a can print b can print c can print d, but d doesn't print any other program. The scores would be calculated as (a_ones + b_ones + c_ones + d_ones) / (a_bytes + b_bytes + c_bytes + d_bytes) (see below)

The programs must also never error. The "programs" can also be functions, as long as they execute with no arguments


Scoring

Your submission's score is the sum of the number of ones outputted by your programs, all divided by the sum of the bytes of the programs. The higher the score, the better.

\$\endgroup\$
13
  • \$\begingroup\$ Is f=_=>1 and f=_=>2 different programs? \$\endgroup\$ Commented Nov 15, 2018 at 20:10
  • 3
    \$\begingroup\$ At some point down the rabbit hole, the programs will no longer be able to output new programs different from but no bigger than the previous ones, by the pigeonhole principle. So not all of your requirements can be satisfied at once! \$\endgroup\$ Commented Nov 15, 2018 at 20:11
  • \$\begingroup\$ @LuisfelipeDejesusMunoz Yes \$\endgroup\$
    – kepe
    Commented Nov 15, 2018 at 20:33
  • 4
    \$\begingroup\$ With the current rules, it seems likely that the way to maximize the score is to just print lots of ones, without printing a second program. \$\endgroup\$ Commented Nov 15, 2018 at 20:47
  • 3
    \$\begingroup\$ There should probably be a restriction on how long a program could be, since the effect of dividing by the bytecount will be negligible for better busy beavers \$\endgroup\$
    – Jo King
    Commented Nov 15, 2018 at 22:46

3 Answers 3

1
\$\begingroup\$

C (gcc), 71 bytes

I've not done one of these before but here's a shot at it;

Each program should print 4,294,967,295 ones, divided by the sum of bytes 71+30 scores 85,048,857

main(c){puts("main(c){while(~c++)puts(\"1\");}");for(;~c++;)puts("1");}

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ How many 1s is this supposed to print? \$\endgroup\$
    – kepe
    Commented Nov 15, 2018 at 20:35
1
\$\begingroup\$

JavaScript (Node.js), 50 bytes

(f=_=>_?'1'.repeat(_)+`&&(f=${f})(${_-1})`:1)(1e3)

Try it online!

\$\endgroup\$
13
  • \$\begingroup\$ It seems like you want something more like (f=_=>[...Array(_)].map(a=>1).join``+`\n(f=${f})(${_-1})`)(1e3); otherwise, the output after all the 1s doesn't look like a working program to me. Also, I'm not sure where the factorial in your score is coming from. \$\endgroup\$ Commented Nov 15, 2018 at 20:31
  • \$\begingroup\$ 1000! would be approximately 4.023872600770938*10^2567. None of your programs output that many ones. \$\endgroup\$ Commented Nov 15, 2018 at 20:33
  • \$\begingroup\$ Using && will evaluate the previous numbers as true and will excecute the next line of code that is going to be the same program but with a different number (IDK if this fits into the rules since is not the same program at all) \$\endgroup\$ Commented Nov 15, 2018 at 20:34
  • \$\begingroup\$ Lol @MishaLavrov my bad, I'm pretty bad at math Dx \$\endgroup\$ Commented Nov 15, 2018 at 20:35
  • 1
    \$\begingroup\$ Changing 1e3 to 1e9 will give you a lot more 1s! \$\endgroup\$
    – Shaggy
    Commented Nov 15, 2018 at 20:35
1
\$\begingroup\$

brainfuck, 99 bytes, \$f_{255}(255^2)\$

-[>-[[>]-[<]>>-]<-]-[-[[>]+[<]<+>>-]-[<+>-----]<--.,<[>>>[[-<+>]<[<]<[->+<<+>]>[>]>]<+[<]>,<<-]>>>]

Assumes a wrapping implementation with an infinite tape in both directions.

This is modified from my Largest Number Printable to print 1s instead of 3s.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.