Gelöst


Generate Hadamard Matrix without using hadamard function
In mathematics, a Hadamard matrix, named after the French mathematician Jacques Hadamard, is a square matrix whose entries are e...

mehr als 3 Jahre vor

Gelöst


Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

mehr als 3 Jahre vor

Gelöst


Leap Year
According to Gregorian Calender(which is in use now, in many countries),decide whether a given year is a leap year or not. Give...

mehr als 3 Jahre vor

Gelöst


Convert a vector of Integers into a matrix of binaries
Convert a vector of positive integers into a matrix containing their binary representation. Each column of the output contains t...

mehr als 3 Jahre vor

Gelöst


Find Current in R circuit.
Find the current in an R circuit for a given input of Voltage (V) and Resistance(R).

mehr als 3 Jahre vor

Gelöst


Find alternating sum
Given an array, find alternating sum i.e. – y = x (1) – x (2) + x (3) – x (4) + x (5) - …

mehr als 3 Jahre vor

Gelöst


Compare a value to a vector
Given a random value X and a random vector Y. you have to compare X to the Vector Y and make a decision. case 1: X is a value i...

mehr als 3 Jahre vor

Gelöst


The rabbit problem
Suppose a newly-born pair of rabbits, one male, one female, are put in a field. Rabbits are able to mate at the age of one month...

mehr als 3 Jahre vor

Gelöst


How many ways?
Create a program to determine in how many ways can a regular n-gon be divided into n-2 triangles?

mehr als 3 Jahre vor

Gelöst


Magic Matrix
We are all familiar with the concept of magic matrix. In a magic matrix, the summation of all rows, columns and both diagonals...

mehr als 3 Jahre vor

Gelöst


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/...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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 ...

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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.

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Gelöst


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) = ...

mehr als 3 Jahre vor

Gelöst


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 ...

mehr als 3 Jahre vor

Gelöst


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...

mehr als 3 Jahre vor

Mehr laden