1:00 AM
Sandbox posts last active a week ago: Write a Web server quine, Derive an MIU string

You mean RP?

1 hour later…
2:06 AM
0

Write a program that accepts HTTP requests on any port of your choice above 1024, and responds to requests on any URL of your choice with its own source code. It must work with, at least, Firefox and Chrome. The code should be delivered as text/plain with no formatting. There is no restriction on...

@l4m2 Roleplay?

In computational complexity theory, randomized polynomial time (RP) is the complexity class of problems for which a probabilistic Turing machine exists with these properties: It always runs in polynomial time in the input size If the correct answer is NO, it always returns NO If the correct answer is YES, then it returns YES with probability at least 1/2 (otherwise, it returns NO).In other words, the algorithm is allowed to flip a truly random coin while it is running. The only case in which the algorithm can return YES is if the actual answer is YES; therefore if the algorithm terminates and...

uhh thats similar i guess
if we allow the Accept response to be undefined, that would be a valid option i suppose

That'd be cool.

i know theres that "check if a number is irrational" question which this is reminding me of haha

2:16 AM
That's not even in RE nor co-RE.
...Assuming the input is an arbitrary real number.

2:38 AM
0

Write a check Given the check number, payee, amount, and memo as input, fill out this check: +------------------------------------------------------------------------------+ | John and Jane Doe ***** | | 123 Pine St. ...

3:02 AM
@DannyuNDos no im just talking like, vibes, ill show you what i mean ill find it
17

Your task is to make a program that decides if a real number between 0 and 1 is irrational or not. As stated, this is obviously impossible, so instead we will use the following definition: p is your program, which takes in a decimal expansion of a number (list of integers), and returns 0 (≈Ration...

this one
its not the same thing but like, forgive me for sensing a structural pattern

2 hours later…
4:38 AM
@NewPosts I am a huge sucker for a quine challenge.

6 hours later…
10:09 AM
hello!

11:09 AM
CMC We start with an urn which contains one white ball and one black ball. At each second we choose a ball at random from the urn and replace it together with one more ball of the same colour. Write C code to estimate the probability that when 10 balls are in the urn, 4 of them are white.
I was told this was too hard for first year undergraduates!
I really want to see how short the code could be in C to make a point

I edited the CMC to actually render the markdown

@lyxal thanks!
I can't pass the twitter capture!
is that a correct or incorrect example?

how does it work?
(I don't have a twitter/x account, so I've never experienced it before :p)
although it looks like it wants the image on the right to only contain a single bench
right now there's two benches
click left until it shows one bench?

you are supposed to click submit when the image on the right "matches" the image on the left
but I get it wrong
so I don't understand
it says "Make sure the number of objects matches the number shown in the left image exactly."

11:24 AM
I would take that to mean "the left image asks for 1 bench" and "make the right image contain one bench"

yes

so did you make the right image contain one bench?

I managed to pass on the 10th time of trying!

what was the solution?

all the dirty versions of the objects are meant to be treated the same as the clean ones
which didn't match with the word exactly" to me

11:30 AM
11 mins ago, by lyxal
right now there's two benches

yes

That's what I meant :p

yes were right!

11:43 AM
here is a non-golfed version of my CMC bpa.st/4C2Q

@Simd captchas are known for being notoriously hard…

@TheEmptyStringPhotographer and getting harder!

12:29 PM
Strange… I own this room, but I don’t!

yes that's the "rooms you're in" tab

you're not wrong

12:48 PM
-1

This category is named “mine”. It is a bit misleading since it actually shows what rooms I’m in: This suggests that I own The Nineteenth byte, which I do not. Maybe this could be changed?

Just ignore the fact that it’s at -1
I have no idea why it has that score.

1:28 PM
Me attempting to star the fact that someone starred a message:

0

Hypnotising people into thinking that an answer is valid and is the best-scoring answer. Ok, what the actual hell!?! I’m just being silly, aren’t I?

2:10 PM
wanted to write a challenge for a tiny stack language, are there precedents? only thing I could find is Tokenize a Stack-Based language, which seems different enough

2:25 PM
0

Deja vu Given two arrays, let's call them a and b, and a number n, your task is to see if there exists a subarray in a so that that subarray's sum is n and there is a subarray in b that also sums to n and has the same length. You may assume that all elements in a and b are positive integers, and ...

2:44 PM
@Simd exactly 4 or at least 4?

3:04 PM
@Neil exactly

3:21 PM
@Simd is the result 1/9?

2 hours later…
5:27 PM
0

Divisibility counting Given two positive integers a and b, how many times can you divide a by b so that the result is a whole number without any decimal? For example, if a is 10 and b is 2, the answer would be 1 because 10 / 2 = 5, but then 5 / 2 = 2.5. Or take a = 3 and b = 2, for example. 3 / 2...

5:46 PM
@RubenVerg good question :)

6:01 PM
@RubenVerg I agree

6:16 PM
@RubenVerg My Modify the Stack might be relevant, although it requires to create a program using only very simple stack manipulations

@Simd Although I dislike writing your code for you, I couldn't resist:
```#include<stdio.h>
#include <time.h>
#include <stdlib.h>

int randint(int n) {
int randn;

do {
randn = rand();
} while (randn > RAND_MAX - (n - (RAND_MAX % n + 1)));

return randn % n;
}

int count_whites() {
int blacks = 1;
int whites = 1;

for (int i = 0; i < 8; i++) {
int is_white = randint(blacks + whites) < whites;

if (is_white) {
whites++;
} else {
blacks++;
}
}

return whites;
}

int main() {```
This consistently gets numbers right around 11.1% so pretty sure I got the randomness right

6:34 PM
@NewLoopholeProposal ಠ_ಠ
@cairdcoinheringaahing (since you're on) I'm pretty sure this user is a spambot, since they proposed two tag wiki edits that blanked the wiki and replaced it with a link to a spam site and don't seem to have any other activity

7:07 PM
@Simd straightforward, not random based solution:
```float step(int white, int black) {
if (white + black == 10) return white == 4;
return (white * step(white + 1, black) + black * step(white, black + 1)) / (white + black);
}

printf("%g\n", step(1, 1));```

7:20 PM
0

Implement a simple stack language In this task, you implement an interpreter for a simple stack-based programming language. Your language must provide the following instructions: push an arbitrary number pop two numbers and push their sum pop two numbers and push their difference (second number ...

8:14 PM

1 hour later…

9:41 PM
@Simd C (gcc), 31 bytes `int main(){printf("%f",1./9.);}` Why re-calculate every time?

@Fatalize It's always confusing reading old comment threads when the users involved have since changed their usernames :P

@Fatalize heh so that answer is responsible for more than 1% of your entire rep?

9:57 PM
@RydwolfPrograms to be fair, I did give C code too

10:31 PM
@Simd CMC: Play a game of this, and output how many are white.

10:48 PM
@ATaco Pip, 11 bytes: `L8tPBRCt\$+t`
Start with `t = 10`. Loop 8 times: randomly choose a character from `t` and append it to `t`. Then output the sum of `t` (i.e. the number of `1`s).

Technically, `Rand [1, 9]` would be indestinguishable from an actual solution.

Huh. I would not have guessed it was a uniform distribution.
In that case, 4 bytes: `URR9`

@DLosc you don't sound very certain that it's 9

@lyxal Well duh, of course I'm not certain it's 9 because it's usually not 9
;)

Then why'd you put 9?

10:56 PM
Well it might be 9...
URR is actually an acronym that stands for "Uppermost Reach of the Randomness" (random number that's at most 9)

@DLosc although now you say it, it's obviously uniform

The cheap solution in RProgN 2 is 3 bytes, `19ñ`

@DLosc ohh I thought it meant "Unlikely, but Realistically Rounded to" which suggests that its not likely to be, but most probably and obviously 9

Ohwait `9ñ` works too