Community Profile

# Roger Stafford

2008년부터 활동

All

배지 보기

#### Content Feed

보기 기준

문제

Sum the Infinite Series II
For any x in the range 0 < x and x < 2*pi radians, find the sum of the following infinite series: c = 1 + 1/2*cos(x) + 1/2*3...

11년 이하 전 | 1 | 솔버 수: 18

문제

Sum the Infinite Series
Given that 0 < x and x < 2*pi where x is in radians, write a function [c,s] = infinite_series(x); that returns with the...

11년 이하 전 | 9 | 솔버 수: 114

문제를 풀었습니다

Nonuniform quantizer as a piecewise constant function
Implement a nonuniform quantizer as the following piecewise function: y = -3.5, x < 3 y = -1.5, -3 &#8804; x < -1 y = -...

11년 이하 전

문제를 풀었습니다

Mechanics 1
I thought I would make a mechanics problem for all those physics lovers out there. Imagine two solid, rigid spheres B1 and B...

11년 이하 전

문제

Compute Area from Fixed Sum Cumulative Probability
In Matlab the code v = rand(1,3); v = v/sum(v); is sometimes suggested as a convenient means of generating three rando...

11년 이하 전 | 1 | 솔버 수: 6

문제를 풀었습니다

Triangle Numbers Below N
This is an offshoot of <http://www.mathworks.com/matlabcentral/cody/problems/5-triangle-numbers Cody Problem 5: Triangle Numbers...

11년 이하 전

문제를 풀었습니다

How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

11년 이하 전

문제를 풀었습니다

Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

11년 이하 전

문제를 풀었습니다

chance in percent for minimum K heads when a good coin is tossed N times?
For example, chance is 100% for minimum 0 heads when a coin is tossed 7 times. Chance is 50% for minimum 2 heads when a coin is...

11년 이하 전

문제를 풀었습니다

Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

11년 이하 전

문제를 풀었습니다

Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

11년 이하 전

문제를 풀었습니다

Great Circle Distance
Find shortest between two points on a ball given their azimuthal and polar angles (in degrees) as well as the radius of the sphe...

11년 이하 전

문제를 풀었습니다

Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

11년 이하 전

문제를 풀었습니다

Project Euler: Problem 5, Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

11년 이하 전

문제를 풀었습니다

Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

11년 이하 전

문제를 풀었습니다

Angle of triangle
For three unknown points a b c, given three sides ab bc ca, find three angles abc bca cab in radians. Your function should b...

11년 이하 전

문제를 풀었습니다

Spiraling out of control....
Imagine a square with corners at the origin and at (1,1). An interesting spiral can be created by tracing the path of a moving ...

11년 이하 전

문제

Subdivide the Segment
Two points, P1 and P2, with integer x-y coordinates are given. These uniquely determine a third point, P0, on the extended line...

11년 이하 전 | 2 | 솔버 수: 9

문제를 풀었습니다

What are the odds?
Two numbers, A and B are drawn randomly and uniformly on [-R,R]. What is the probability that A*B < A+B. Your function should ...

11년 이하 전

문제를 풀었습니다

Subdivide the Segment
Two points, P1 and P2, with integer x-y coordinates are given. These uniquely determine a third point, P0, on the extended line...

11년 이하 전

문제를 풀었습니다

Connect Four Win Checker
<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

11년 이하 전

문제를 풀었습니다

Knight's Tour Checker
Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

11년 이하 전

문제를 풀었습니다

Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

11년 이하 전

문제를 풀었습니다

Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

11년 이하 전

문제를 풀었습니다

Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

11년 이하 전

문제를 풀었습니다

Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

11년 이하 전

문제를 풀었습니다

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

11년 이하 전

문제를 풀었습니다

Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

11년 이하 전

문제를 풀었습니다

inner product of two vectors
inner product of two vectors

11년 이하 전

문제를 풀었습니다

Longest Divisor Run
Given the vector a, find the longest run of consecutive numbers that can be evenly divided by the same number d where d > 1. ...

11년 이하 전