Gelöst


Calculate the probability that at least two people in a group share the same birthday.
Calculate the probability that at least two people in a group share the same birthday. Given an integer input n, return to 0.015...

mehr als 5 Jahre vor

Gelöst


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

mehr als 5 Jahre vor

Gelöst


Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

mehr als 5 Jahre vor

Gelöst


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

mehr als 5 Jahre vor

Gelöst


Test if two numbers have the same digits
Given two integers _x1_ and _x2_, return |true| if the numbers written with no leading zeros contain the same digits. That is, t...

mehr als 5 Jahre vor

Gelöst


Replace values out of an interval with the lower or upper values
For a vector or matrix X and an interval [n1,n2], the function replace every element of x inferior to n1 by n1, and every elemen...

mehr als 5 Jahre vor

Gelöst


Binary Inversion
Given the unsigned 8-bit integer x, return the number y which is the binary inversion of x. For example if x is 5, y should b...

mehr als 5 Jahre vor

Gelöst


Convert decimal to binary and then generate the minimum binary it can with jumbling
input is 10 --> 1010 output should be 3 --> 0011 input 23 --> 10111 output should be 15 --> 01111

mehr als 5 Jahre vor

Gelöst


Number construction III
Given a positive integer, n, return a, b and c, such that 1. n = a^1.5+b^2.5+c^3.5 2. a, b and c are all positive integers...

mehr als 5 Jahre vor

Gelöst


Number construction II
Given a positive integer, n, return a, b, c and d, such that 1. n = a*2^b+c*3^d 2. a, b, c and d are all positive integers...

mehr als 5 Jahre vor

Gelöst


Number construction I
Given a positive integer, n, return a, b, c and d, such that 1. n = a*sqrt(b)+c*sqrt(d) 2. a, b, c and d are all positive ...

mehr als 5 Jahre vor

Gelöst


Find the gcm of n given values
Create a function that given n integer values greater than zero, finds the two numbers with the greatest common divisor and retu...

mehr als 5 Jahre vor

Gelöst


Convert integer to base26 using letters
Write a function that converts a decimal integer to base26 using the letters of the english alphabet, i.e. 0->'a', 1->'b', 2->'c...

mehr als 5 Jahre vor

Gelöst


How to multiply?
* Imagine you are in 3012 Anno Domini, when everyone must learn how to multiply, * and competing for the highly prestigious pos...

mehr als 5 Jahre vor

Gelöst


Infinite precision division
Develop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555...

mehr als 5 Jahre vor

Gelöst


Factorial

mehr als 5 Jahre vor

Gelöst


Hexagonal numbers on a spiral matrix
Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

mehr als 5 Jahre vor

Gelöst


It's going down. We're finding simbers!
This problem is inspired by Project Euler 520: Simbers. "We define a simber to be a positive integer in which any odd digit, ...

mehr als 5 Jahre vor

Gelöst


How to add?
* Imagine you are in 2222 Anno Domini, when everyone must learn how to add, * and competing for the highly prestigious post of,...

mehr als 5 Jahre vor

Gelöst


calculate PI without using pi function
There are many methods to get the pi(Ratio of circumference to diameter). You should get pi without using the pi function in M...

mehr als 5 Jahre vor

Gelöst


Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...

mehr als 5 Jahre vor

Gelöst


Calculate the hypotenuse of a right triangle without using ^ and sqrt ()
Find out the hypotenuse of right triangle. Say a = 4, b = 3 then c = 5 Please don't use ^ and sqrt() function.

mehr als 5 Jahre vor

Gelöst


Calculate cosine without cos(x)
Solve cos(x). The use of the function cos() and sin() is not allowed.

mehr als 5 Jahre vor

Gelöst


Calculate sin(x) without sin(x)
Calculate y = sin(x) x = 0 -> y= 0 without the use of sin(x) or cos(x)

mehr als 5 Jahre vor

Gelöst


Determinant without using det()
Given a square matrix A, compute the <http://en.wikipedia.org/wiki/Determinant determinant> of A. Note that you may not use t...

mehr als 5 Jahre vor

Gelöst


Number of even divisors of a given number
Given a Number n, return the number of its even divisors without listing them. example: n=14 ; EvenDivisors={2,14} ; y=2 ...

mehr als 5 Jahre vor

Gelöst


Accurate Division
Given three integers x, y and d, return x/y (as a string) to d significant digits. Remove leading and trailing zeros. Example...

mehr als 5 Jahre vor

Gelöst


Let's get back to school, and create multiplication tables
For a given range, create multiplication tables. (start is always < endno) Example start = 17 endno = 19 Then, ...

mehr als 5 Jahre vor

Gelöst


Multiplication
Multiply two numbers in a different manner. The numbers are given to you as vectors x and y. Example x = [ 1 2 0 1 ] ...

mehr als 5 Jahre vor

Gelöst


Subtract integers and add doubles
Create a function that subtracts a from b if a and b are integers and adds them if they are floats.

mehr als 5 Jahre vor

Mehr laden