Community Profile

photo

William Forsberg


Last seen: 2年弱 前 2018 年からアクティブ

統計

  • CUP Challenge Master
  • Solver

バッジを表示

Content Feed

表示方法

解決済み


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

5年弱 前

解決済み


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

5年弱 前

解決済み


DC chopper
Input x is the sampled signal vector, may have both AC and DC components. output vector y should have AC components removed then...

5年弱 前

解決済み


Calculate volume of box
Calculate the volume of box,hiven its sides

5年弱 前

解決済み


N-Cards Problem
You have a deck of _N_ cards numbered in order from 1 to _N_. You discard the top card (card 1) and place the next card (card 2)...

5年弱 前

解決済み


Volume of this donut
Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

5年弱 前

解決済み


Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

5年弱 前

解決済み


Kinetic Energy
Given the mass m and velocity v of an object, determine its <http://en.wikipedia.org/wiki/Kinetic_energy kinetic energy>.

5年弱 前

解決済み


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

約5年 前

解決済み


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

約5年 前

解決済み


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

約5年 前

解決済み


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

約5年 前

解決済み


Return area of square
Side of square=input=a Area=output=b

約5年 前

解決済み


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

約5年 前

解決済み


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

約5年 前

解決済み


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

約5年 前

解決済み


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

約5年 前

解決済み


radius of a spherical planet
You just measured its surface area, that is the input.

約5年 前

解決済み


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

約5年 前

解決済み


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

5年以上 前

解決済み


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

5年以上 前

解決済み


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

5年以上 前

解決済み


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

5年以上 前

解決済み


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

5年以上 前

解決済み


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

5年以上 前

解決済み


Are all the three given point in the same line?
In this problem the input is the coordinate of the three points in a XY plane? P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) how can...

5年以上 前

解決済み


Television Screen Dimensions
Given a width to height ratio of a TV screen given as _w_ and _h_ as well as the diagonal length of the television _l_, return t...

5年以上 前

解決済み


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

5年以上 前

解決済み


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

5年以上 前

解決済み


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

5年以上 前

さらに読み込む