Roll the Dice!
Description
Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice.
Example
[x1,x2] = rollDice(...
4日 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input...
4日 前
解決済み
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...
4日 前
解決済み
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 number of...
Pi Estimate 1
Estimate Pi as described in the following link:
<http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>
4日 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
4日 前
解決済み
Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.]
Non-scored bonus...
Current through resistor
Three resistors (R2, R3, R4) are connected in parallel as shown in the figure. If this combination is connected in series with ...
4日 前
解決済み
Calculate Parallel Resistance
Three resistors connected in parallel have resistances R1, R 2, and R 3, respectively. Return the total resistance R total of ...
4日 前
解決済み
Resistance of a light bulb
The current through two identical light bulbs connected in series is C Amperes. The total voltage across both bulbs is V Volts....
4日 前
解決済み
Electrical Diode Current Calculation
In engineering, there is not always a single equation that describes a phenomenon accurately enough to be applied in all instanc...
4日 前
解決済み
An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:*
Many important observations in math and science can be described by short, but powerful, equations...