Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A;
Output: A=(Aij),where each entry Aij is either...
3年以上 前
解決済み
Convert yards to feet
The goal of this script is to convert a value given in yards to feet.
3年以上 前
解決済み
02 - Vector Variables 3
Make the following variable:
<<http://samle.dk/STTBDP/Assignment1_2c.png>>
(all the numbers from 5 to -5 in increments of ...
3年以上 前
解決済み
Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice.
Ex...
3年以上 前
解決済み
Isothermal Expansion
Given the initial pressure and volume of an ideal gas, calculate the new volume, given the new pressure.
Hint: <https://en.wi...
3年以上 前
解決済み
Dice roll - opposite faces
For this problem, you will be provided with the values of a dice roll (regular six-sided dice). The number of dice will be at le...
Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector).
Example:
Inpu...
3年以上 前
解決済み
There are 10 types of people in the world
Those who know binary, and those who don't.
The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...
Relative ratio of "1" in binary number
Input(n) is positive integer number
Output(r) is (number of "1" in binary input) / (number of bits).
Example:
* n=0; r=...
3年以上 前
解決済み
Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...