The other day my chemistry teacher was explaining to us about scientific notation (using a small number and multiplying it by powers of ten to express large numbers more easily), which brought me back a few years to when I first learnt it. After learning the basics, we had done a bunch of typical...
Wouldn't it be neat if programming functions could be inverted, just like the mathematical function they implement?
Write a function (or program) that takes one input x in any form, that outputs ln(x).
When the bytes of the program are reordered/reversed so that the first byte now is the last b...
The Compression Catalog
code-golf compression kolmogorov-complexity
Introduction
It seems that a lot of programming languages use compression algorithms these days. To see who has the best compression algorithm at that moment, I've set up a challenge.
Task
The task is very simple. You need t...
This challenge is inspired by this other.
The challenge
Write a program or a function in any programming language that given as input a string representing a time in English (see below, for further details) it outputs or prints the equivalent in the 24 hours "digital" format HH:MM.
Shortest co...
@aditsu random idea for v in CJam: make it an infix operator that pops the top of the stack, applies the following operator and then pushes the popped thing again. might help save a lot of stack manipulation. I'm not sure how useful it's actually gonna be, but might be worth thinking about.
Dogecoin (/ˈdoʊʒkɔɪn/ DOHZH-koyn, code: DOGE, symbol: Ð and D) is a cryptocurrency featuring a likeness of the Shiba Inu dog from the "Doge" Internet meme as its logo. It was introduced on December 8, 2013. Started as a "joke currency" in late 2013, Dogecoin quickly developed its own online community and reached a capitalization of USD 60 million in January 2014; as of September 2015, it had a capitalization of USD 12.5 million.
Compared with other cryptocurrencies, Dogecoin has a fast initial coin production schedule: 100 billion coins have been in circulation by mid 2015 with an additional 5...
Introduction:
You, the robbers, have taken over Google! However, the cops are passing messages back and forth in an attempt to destroy you.
Challenge:
Cops thread here(main rules)
To crack a challenge, create a post that looks like this:
Name of cops submission
Language you think it...
Introduction:
Robbers have taken over Google! However, they haven't taken over everything. You need to get secret messages to other cops, while fooling the robbers about their meaning.
Challenge:
Robbers thread here
Create a snippet of code, that when run in the correct language, will outpu...
Recently, when fiddling around with integration by parts, I noticed that it is possible to define infinite series that led to a defined integral. My calculus teacher noticed this, and told me to find
$$
\int \frac{e^x}{x}dx
$$
which I already knew didn't have a mathematical function definition....
Upgoat or Downgoat?
test-battery code-challenge
Given an image of a goat, your program should best try to identify whether the goat is upside down, or not.
Examples
These are examples of what the input may be. Not actual inputs
Input:
Output:
Downgoat
Spec
The input will contain the ful...
> Test battery tests involve running a program through a large number of testing inputs (usually at least 5 or 6 digits) and measuring how it performs in some respect of its output.
I think I've seen challenges of both types - fixed tests to allow hardcoding a few pixel tests and tests with the right to change to enforce general code
@VoteToClose What does hardcoding prevention have to do with SE's byte limit?
@trichoplax I'm not saying the test cases cannot be changed midway, but it's no longer a test battery then. Unless I'm misunderstanding something, test batteries are about static test cases.
Although replacing a small number of test cases with another, small number of test cases will probably change the score dramatically even for non-harcoding solutions.
Jelly, 21 19 11 10 7 bytes
²~³¡H+2
Try it online!
Idea
Assume for a second that the first term of the final sum is subtracted rather than added.
Let n be a positive integer.
Even case
1 6
8 11
15 16
21 22
26 29
31 36
The differenc...
Given an undirected graph and a start node, there is an expected number of steps to reach all possible nodes if you walk at random. This expected number of steps will depend on which node you start from. For a given graph and starting node, let us call the number of steps to visit all nodes in th...
Reasoning
code-golf
Introduction
Reasoning is one of the most important human capabilities, often counted
as what separates us from other species. This capacity, however, takes up
a substantial portion of our meaty brain. Your challenge is to recreate
a reasoning system in a much abbreviated f...
I have a chocolate bar and I need help eating it so you'll be writing a program just to do that.
Explanation
7
____
__|__|
|__|__|
|__|__|
|__|__|
6
_______
|__|__|
|__|__|
|__|__|
5
____
__|__|
|__|__|
|__|__|
0
1
____
|__|
Spec
A chocolate bar is always "two pieces" lon...
@MartinBüttner Just MP3 right now. At the time I wrote it, phones were slightly less powerful, and other popular formats (flac, etc) took way too much to process. It's in the list of updates to come :/
In trigonometry, there are certain angles known as "special angles". This is because when you take sin, cos or tan of one of these angles, you get a result that is easy to remember because it is a square root of a rational number. These special angles are always multiples of either pi/6, or pi/4....
Hmm, that's weird. I'm not having problems with mine. I expected some issues, since Android has changed a lot in the last five years, but not with that.
Let me play around with some of my other devices later. So far so good on Nexus 5 and Kindle Fire for me. What are you on (phone and OS version)?
Wring the changes
I want to ring Stedman Doubles, but I'm lazy so I want to get to a particular change and back as quickly as possible.
As with all change-ringing, the bells start in ascending order, known as Rounds, in this case 12345. The method is called Doubles because at each change two pa...
So in the javascript for my detour interpreter, I have a dictionary equating detour commands to JS methods. I have a comment on the methods that briefly describes its function. is there a tool that can turn that dictionary into documentation?
@CᴏɴᴏʀO'Bʀɪᴇɴ Exactly. I saw -1**n in an answer, and I didn't know if - is a unary minus or part of the numeric literal in JavaScript. Rather surprisingly, it seems to be the latter.
This actually could have been a decent challenge had the OP disallowed comments. Right now the only answer I think is really good is marinus'.
If it wouldn't cost me tons of rep, I'd downvote every answer that uses comments. Usually I wouldn't think twice but there are a lot of comment-reliant answers. :/
We have multiple questions with some aspects of calculus (<-- that's a question per word). We already have tags for number-theory, probability-theory, and various other sects of mathematics. I doubt that we won't have more calculus questions, so let's make a tag for the future.
In the analysis of algorithms, the master theorem provides a solution in asymptotic terms (using Big O notation) for recurrence relations of types that occur in the analysis of many divide and conquer algorithms. It was popularized by the canonical algorithms textbook Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein, in which it is both introduced and proved. Not all recurrence relations can be solved with the use of the master theorem; its generalizations include the Akra–Bazzi method.
== Introduction ==
Consider a problem that can be solved using a recursive algorithm such as...
I think it looks fine too but I don't understand the language at all, let alone enough to know why anything is highlighted as it is. Currently the colors look random to me.
You are to approximate the value of:
Where your input is I.
Rules
You may not use any built-in integral functions.
You may not use any built-in infinite summation functions.
Your code must execute in a reasonable amount of time ( < 20 seconds on my machine)
You may assume that input is grea...
43 bytes: \(\displaystyle\int_0^I\dfrac{e^x}{x^x}dx\) which I don't think can be golfed unless there's a way to left-justify in display mode that I'm forgetting
In mathematics, Stirling's approximation (or Stirling's formula) is an approximation for factorials. It is a very powerful approximation, leading to accurate results even for small values of n. It is named after James Stirling, though it was first stated by Abraham de Moivre.
The formula as typically used in applications is
(in big O notation). The next term in the O(ln(n)) is 1/2ln(2πn); a more precise variant of the formula is therefore
It is also possible to give a version of Stirling's formula with bounds valid for all positive integers n, rather than asymptotics: one has
for all positive...
A decimal mark is a symbol used to separate the integer part from the fractional part of a number written in decimal form.
Different countries officially designate different symbols for the decimal mark. The choice of symbol for the decimal mark also affects the choice of symbol for the thousands separator used in digit grouping, so the latter is also treated in this article.
In mathematics the decimal mark is a type of radix point, a term that also applies to number systems with bases other than ten. Conversationally, the decimal point is commonly referred to as a "decimal dot".
== History... ==
> Since 2003,[14] the use of spaces as separators (for example: 20 000 and 1 000 000 for "twenty thousand" and "one million") has been officially endorsed by SI/ISO 31-0 standard,[15] as well as by the International Bureau of Weights and Measures and the International Union of Pure and Applied Chemistry,[16][17] the American Medical Association's widely followed AMA Manual of Style, and the Metrication Board, among others.
Implement Arbitrary Precision Integers
Help me out with comments!
I don't think this is a dupe, but it is related to GOLF CPU - Implement Arbitrary Precision Integer Division. The notable difference is that it allows for any language and will be scored differently.
This is code-golf.
The tas...
I am developing a consumer product, and it is supposed to be connected to the Internet, so as expected, it is connected to the Internet so that I can properly develop it.
I went away for an hour or two, and when I came back to my office I noticed some strange commands written in the terminal.
L...