Solved


Penny flipping - calculate winning probability (easy)
Two players are playing a fair penny flipping game. For each flip, the winner adds one penny from the loser's collection to his/...

3 years ago

Solved


Design matrix from eigenvalues
Write a function that takes one input argument n and outputs a (n x n) square matrix A with the following properties: -A has...

3 years ago

Solved


Simple Interest : Calculate annual simple interest rate
Theorem : Simple Interest where; F : Future Value P : Present Value r : Annual simple interest rate (decimal) t : Time in...

3 years ago

Solved


Find the moving-average of the elements of a vector
Example Input vector: [1 2 3 4] output vector: 1st element=1/1, 2nd element=(1+2)/2, 3rd element=(1+2+3)/3, 4th element=(1+2...

3 years ago

Solved


Compute a nested cube root
Consider the quantity . Write a function to compute without using loops or recursion.

3 years ago

Solved


Sum the unitary divisors of a number
Cody Problems 1933 and 46898 deal with , the sum of divisors function. This problem deals with , the sum of unitary divisors fun...

3 years ago

Solved


Count the unitary divisors of a number
Cody Problem 56738 asks for a list of the unitary divisors of a number. For this problem, write a function to count the unitary ...

3 years ago

Solved


Matrix Generation.
if input n =1, generate a matrix y = [1]

3 years ago

Solved


find the relation...
if given input is 1, output is 4. if input is 55, output is 3136.

3 years ago

Solved


Find the area of a rectangle if length of the diagonal is given.
if length of a diagnonal in rectangle is 5. Its area is 12.

3 years ago

Solved


3rd side of a Triangle
Given two sides of a triangle, find the minimum and maximum possible area of the triangle. the length of the third side has t...

3 years ago

Solved


Performance - summation
Given a vector of natural numbers x = [1,2,3,...,N] compute the sum of its elements by not stressing the machine too much...

3 years ago

Solved


Triangle Coordinates
Given a natural number n, return two -element vectors, x and y, containing the coordinates of a triangular arrangement of points...

3 years ago

Solved


Create block matrix of integers (j+k-1) - Part II
Given m, n, p, and q, create an m-by-n matrix made up of submatrices, each sized p-by-q (if possible - the last row and column o...

3 years ago

Solved


Create block matrix of integers (j+k-1) - Part I
Given m, n, p, and q, create a matrix of m-by-n blocks (submatrices), each sized p-by-q. The elements of the (j,k)th block all h...

3 years ago

Solved


Construyendo matrices parte 2
Construye la siguiente matriz a partir de otros tres vectores/matrices. [ 1 8 15 3 3 3 3 2 9 16 3 3...

3 years ago

Solved


Kurosu checker
The game of Kurosu is simple. A square grid contains cells that can be filled with either a 'X' or an 'O', similarly to a tic-ta...

3 years ago

Solved


List unitary divisors of a number
A unitary divisor of a number divides and satisfies gcd(,) = 1. For example, 9 is a unitary divisor of 18 because gcd(9,2) = ...

3 years ago

Solved


Dyck words
A Dyck word can be considered as a string of n X's and n Y's arranged to have at least as many X's in an initial segment of the ...

3 years ago

Solved


Intersection points of a polynomial
Find the intersection points of a polynomial, given by its vector of coefficients with the X-axis and the Y-axis. Input: a poly...

3 years ago

Solved


Determine if vector has any zeroes
Return 1 if vector has atleast 1 zero, else return 0

3 years ago

Solved


Remove Duplicates
Remove duplicates from the vector of integers and display in sorted order

3 years ago

Solved


Split Even Number Into Two Primes
Given an even whole number n (> 2), return a 2-element vector of primes, p, such that p(1) + p(2) = n. Fun note: technically it...

3 years ago

Solved


Multiply each matrix element by its row index and add its column index.
Return a matrix the same size as the input, multiply each element by its row index and add its column index. Example: x = [ 1 ...

3 years ago

Solved


Check if a year is a leap year or not
Return 1 if a given year is a leap year or 0 if it is not

3 years ago

Solved


Determine if a given input is even or odd?
Given an input, determine if even or odd.

3 years ago

Solved


Crunch that matrix!
You are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms ...

3 years ago

Solved


Fill the matrix - 1
Input is a column vector and n. n columns will be added to the left of the input column. The first value of the row is the s...

3 years ago

Solved


Compound Interest: Interest Rate
Theorem : Compound Interest where, F : Future value at the end of n periods P : Present value r : Annual nominal rate n :...

3 years ago

Solved


Get Next Combination
Return next combination For example three-element combinations of 1:5 1 2 3 1 2 4 1 ...

3 years ago

Load more