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...
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...
Write a check
Given the check number, payee, amount, and memo as input, fill out this check:
+------------------------------------------------------------------------------+
| John and Jane Doe ***** |
| 123 Pine St. ...
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...
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
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?
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
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 ...
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...
@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
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 ...