Count the primes in Collatz sequences
Several Cody problems (21, 69, 42937, 44448, 44784, 52422) involve Collatz sequences. These start with a seed . If is odd, the ...
Matrix to vector transformation
given a matrix, make in the output 1 column vector putting odd numbers in ascending order after that put the even numbers in des...
3年弱 前
解決済み
currency converter
given a rate of exchange calculate the equivalent units of 100 USD
GPA
Math's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA
3年弱 前
解決済み
Fermat's last theorem - again
For a given integer n, express it as a sum of two squares if possible. Return empty matrix otherwise. Solution may not be unique...
3年弱 前
解決済み
modular arithmetic
Given three integers a,b and c, find the remainder when a^b is divided by c. Here, a^b will be well beyond the largest 64 bit in...
3年弱 前
解決済み
grazing cows
Here is a fun problem I encountered in high school.
Two cows are grazing in an enclosed square-shaped field of side length s ...
3年弱 前
解決済み
Mongean Shuffle
A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.
* The top card of the deck is...
3年弱 前
解決済み
07 - Common functions and indexing 5
Create the vector _lin_:
<<http://samle.dk/STTBDP/Assignment1_7e.png>>
(the integers from 1 to 20)
Make every other val...
3年弱 前
解決済み
Create an 'arrow-head" matrix
Write a function that when given an odd number, produces an arrow-head function pointing to the right.
Examples
n = 3
...
3年弱 前
解決済み
root?
* Given a function 'foo', and a position 'there', find the root near 'there'.
* For example: If foo=@sin, and there=3.1, then r...
String vowel manipulation
Given a string, find all the vowels and shift them to the end of the string in the same order as they are found.
3年弱 前
解決済み
Draw the Greek letter 'α'
Given the dimensions of a matrix nRow and nCol where nCol > nRow, draw the Greek letter 'α' with 1's and 0's. You can consider t...
Calculate solution of given polynomial
For example,
y=function([3 -2 -4])
In here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.
y=[1.5...
3年弱 前
解決済み
determine if
determine if the elements of a matrix is a nan and return true
Momentum Calculation
A shopping cart of mass 'm1' is traveling with velocity 'u' and collides with a second shopping cart of mass 'm2.' The two shopp...