Gelöst


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

etwa 4 Jahre vor

Gelöst


Lowest sum from a group of digits
Hi there. It's James's daughter here again, and my third grade math teacher is up to her old tricks. This time, she's giving u...

etwa 4 Jahre vor

Gelöst


Maximum sum from any 2 numbers with a variable number of inputs
Given a variable number of inputs, combine any 2 numbers from the inputs and output the maximum sum the combinations can generat...

etwa 4 Jahre vor

Gelöst


Red and green towers
Frankie has a large number of wooden cubes, painted in red and green. He is building little towers with his cubes, by stacking t...

etwa 4 Jahre vor

Gelöst


A (wrong) place for everything, and everything in its (wrong) place
You have an equal number of cups and balls, each labelled from one to N. You randomly place one ball in each cup. Determine th...

etwa 4 Jahre vor

Gelöst


Numbered lottery balls into cells
You are running a lottery, and have a number of different balls numbered 1 to N. Your job is to figure out how many different w...

etwa 4 Jahre vor

Gelöst


NCHOOSEK - Time Optimization
*Input* * *V* —— Set of all choices, a vector of N, 1 < N < 100 * *K* —— Number of selected choices, a scalar, 0 <= K <=...

etwa 4 Jahre vor

Gelöst


Hexagonal Tiling Dots in a Circle
Return how many <http://en.wikipedia.org/wiki/Hexagonal_grid Hexagonal Tiling> grid points there are inside a circle of radius _...

etwa 4 Jahre vor

Gelöst


Minimum Distance Point to Segment
This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point. The point is (p...

etwa 4 Jahre vor

Gelöst


Perimeter
Given a sequence of points forming a closed path (first and last points are coincident) return the perimeter value. For example...

etwa 4 Jahre vor

Gelöst


Shifted Hexagonal Tiling Dots in a Circle
Return how many <http://en.wikipedia.org/wiki/Hexagonal_grid Hexagonal Tiling> grid points there are inside a circle of radius _...

etwa 4 Jahre vor

Gelöst


Edges of a n-dimensional Hypercube
Return the number of edges on an <http://en.wikipedia.org/wiki/Hypercube _n_-dimensional hypercube> (with an integer n &ge; 0). ...

etwa 4 Jahre vor

Gelöst


Dots in a Sphere
Return how many integer grid points there are inside a 3D sphere of radius _r_ centred at (0,0,0) (including points on the edge)...

etwa 4 Jahre vor

Gelöst


Dots in a Circle
Return how many integer grid points there are inside a circle of radius _r_ centred at (0,0) (including points on the edge). ...

etwa 4 Jahre vor

Gelöst


Put m balls into n boxes (again)
According to <http://www.mathworks.com/matlabcentral/cody/problems/1516-put-m-balls-into-n-boxes Cody Problem 1516>, if I put 3 ...

etwa 4 Jahre vor

Gelöst


Put m balls into n boxes
Can you find all the cases where, if I put 3 balls into 2 boxes the case is 1 1 1 1 1 2 1...

etwa 4 Jahre vor

Gelöst


Which way to go?
Given an m*n grid, How many ways are there to go from upper left corner to the lower right one? You can only move right...

etwa 4 Jahre vor

Gelöst


Number of paths on a grid
Consider a grid formed by n vertices vertically down, and m vertices horizontally right. Your starting point is at the top lef...

etwa 4 Jahre vor

Gelöst


Generate binary combinations for a given number of bit(s)
Generate the binary combination as in the example below. Example: If you are given: bin_comb(2) The answer will be: ...

etwa 4 Jahre vor

Gelöst


Get ranking of a combination looking for speed.
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to...

etwa 4 Jahre vor

Gelöst


Create Combination
Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...

etwa 4 Jahre vor

Gelöst


Get ranking of a combination
I have the numbers pulled without replacement from the set [1 2 3 4 5 6 7 8 9 10 11 12 13]; They are then ordered from least to...

etwa 4 Jahre vor

Gelöst


Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

etwa 4 Jahre vor

Gelöst


Possible Outcomes of American Roulette
The payout for American roulette can be calculated by: payout = (38/n)-1 where n is the number of squares the bet covers. ...

etwa 4 Jahre vor

Gelöst


The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

etwa 4 Jahre vor

Gelöst


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

etwa 4 Jahre vor

Gelöst


Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

etwa 4 Jahre vor

Gelöst


Find nearest prime number less than input number
Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

etwa 4 Jahre vor

Gelöst


Make a vector of prime numbers
Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

etwa 4 Jahre vor

Gelöst


Find the next prime number
Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

etwa 4 Jahre vor

Mehr laden