Given a real number t in (-10^9,13) (not including -10^9 or 13) as input, output Γ(t), also known as the Gamma function, which is defined as follows:
You may not use a built-in Gamma function to solve this task, nor may you use built-in numeric or symbolic integration functions. Your output sh...
The challenge this time is to find the nth Fibohexaprime. The definition of a Fibohexaprime is as following:
We first observe a list with Fibonacci numbers:
N | Fibonacci number
1 | 1
2 | 1
3 | 2
4 | 3
5 | 5
6 | 8
7 | 13
8 | 21
9 | 34
10 | 55
11 | 89
12 | 144
13 | 233
14 ...
The cofactor matrix is the transpose of the Adjugate Matrix. The elements of this matrix are the cofactors of the original matrix.
The cofactor (i.e. the element of the cofactor matrix at row i and column j) is the determinant of the submatrix formed by deleting the ith row and jth column from ...
Description
Write a function f(m, G) that accepts as its arguments a mapping m, and a set/list of distinct, non-negative integers G.
m should map pairs of integers in G to new integers in G. (G, m) is guaranteed to form a finite abelian group, but any element of G may be the identity.
There is...
Take a look at this chamomile flower:
Pretty, isn't it? Well, what if I told you that this wasn't actually one flower?
A lot of flowers (including sunflowers, chamomiles, daisies and others) actually consist of many very small flowers (the black dots on sunflowers) on a flower head. These min...
The Chaos Game is a simple method to generate fractals. Given a starting point, a length ratio r and a set of 2D points, repeatedly do the following:
From your set of points, pick one at random (uniformly).
Average that point and the last drawn point (or the starting point) using r and 1 - r as...
public class Family implements Child {
private int cheer = 0;
public void hug() {
++cheer++;
}
public static void main(String[] args) {
Family family = new Family();
family.hug();
}
@Override
public void makeChild() {
this.concieve("1".equals(""+(int)(Math.random()*2)));
}
}
Stuck, 5 bytes
soT]y
Takes a binary string as input and outputs an array.
Explanation
soT]y
s get input string
o run-level encoding
T zip
] flatten
y pops the data values off
JavaScript (ES6), 52 bytes
s=>eval(s.replace(/\D|$/g,m=>`.0*${m=="*"?3:2}+`)+0)
Explanation
Converts the input into a valid JavaScript statement. Replaces all * with .0*3+ and all other (non-digit) symbols with .0*2+. For example 8*9+*10 becomes 8.0*3+9.0*2+.0*3+10. Finally it appends .0*2 to...
This is one of several challenges left for the community by Calvin's Hobbies.
Take a "family tree describing" file with lines of the form:
[ID] [mother ID] [father ID] [gender] [full name]
such as this which describes the first family tree at http://en.wikipedia.org/wiki/Cousin:
1 ? ? M Adam...