Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...
3年弱 前
解決済み
Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series:
pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...
For a given numbe...
sum all digits
input = 123456789, output = 1+2+3+4+5+6+7+8+9 = 45
3年弱 前
解決済み
Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer:
e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2
3年弱 前
解決済み
concatenate the elements
you should concatenate the elements of a matrix in one dimensional array, for example if the input is
A = [1 2 3; 4 5 6; 7 ...
matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below.
...
3年弱 前
解決済み
Min of a Matrix
Return the minimum value in the given matrix.
3年弱 前
解決済み
Negative matrix
Change the sign of all elements in given matrix.
3年弱 前
解決済み
Remove the positive integers.
Given array,x, remove all the positive numbers and display ouput as y.
Example x=[1 -2 3 -4] , output is y=[-2 -4].
3年弱 前
解決済み
Simple polynomial evaluation
Compute the value of a polynomial of degree n with all coefficients '1', at value x. n is always n>=0.
p(x)=1+x+x^2+...+x^n...