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.
...
거의 2년 전
문제를 풀었습니다
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)* ...
거의 2년 전
문제를 풀었습니다
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 <=...
거의 2년 전
문제를 풀었습니다
Vector with a repeated entry
Create a row vector of length n, filled with 4's. For example, if n = 3,
output = [4 4 4]
Hint:
Search for the function...
거의 2년 전
문제를 풀었습니다
Check if equal
Return true if all the elements of an nD array are equal, false otherwise.
Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...
거의 2년 전
문제를 풀었습니다
Finding sum of even numbers in a vector.
Find the sum of all the even numbers present in the input vector x.
Examples:
Input x = [1 2 3 4]
Output y is 6
Input...
거의 2년 전
문제를 풀었습니다
Sum of digits of powers of 2
Given n, first, calculate the number 2^n. Then, sum the digits that comprise that number. For example:
Input: n = 7
2^n = ...