The length of a curve is
\(s = \int \sqrt{ \left( \frac{dx}{dt} \right)^2 + \left( \frac{dy}{dt} \right)^2 } dt \)
for {x,y} as functions of parameter t. A sine curve is y = a*sin(k*x), and using t = x, I find
\(s = \int \sqrt{ 1 + (ka)^2 \cos^2 kx } dx \)
This requires an elliptic integral of the second kind, though one could do it by numerical integration.
That depends on the wavelength, the amplitude, and the starting phase. If it is one cycle for the length of the field, and an amplitude that makes the wave stretch over the end of the field, then k = (2π)/(100 yds) and a = (1/2) * (53.3 yds). The starting phase is irrelevant in this case.
Doing the integral gives 151.369 yds.
\( s = \frac{1}{k} \sqrt{1 + (ka)^2} E(kx, m) ,\ m = \frac{(ka)^2}{1 + (ka)^2} \)
I wrote a Mathematica function that does that calculation, and I got 242.How many ways are there to make change of $1, using pennies, nickels, dimes, and quarters?
#1:
I wrote a Mathematica function that does that calculation, and I got 242.How many ways are there to make change of $1, using pennies, nickels, dimes, and quarters?
If you wish to do the comparable problem with British coinage, I've found these numbers: List of British banknotes and coins, Coins of the pound sterling
Decimal (Bank of England):
Coins: 1p, 2p, 5p, 10p, 20p, 50p, £1, £2
Bills: £5, £10, £20, £50
p = penny (British plural: pence), £ = pounds sterling
1 pound = 100 pence
I calculate 3953 splits of £1.
Before Decimal Day, 15 February 1971, the UK had used a much more complicated mix. Here are those that survived to that day or not long before:
Farthing: (1/4)d (discontinued 1960), Halfpenny: (1/2)d, One penny: 1d, Threepence: 3d, Sixpence: 6d, Shilling: 1s = 12d, Florin: 2s = 24d, Half-crown: 2s 6d = 30d (disc. 1969), Crown: 5s = 60d (disc. 1965)
Note: £1 = 20s = 240d
With only 1d, 3d, 6d, 1s, and 2s, I calculate 38841 splits of £1.
What is the optimal set of four coin denominations? (i.e. we are allowed 4 different denominations and want to minimize the average number of coins necessary to make change for any value from 1c to 99c, each equally likely)
In the previous one, if one wants to do (1 dollar) - (1 cent) and (1 pound) - (1 penny), one gets:
US: 213
Brit decimal: 3794
Brit predecimal (1d,3d,6d,1s,2s): 37070
What is the optimal set of four coin denominations? (i.e. we are allowed 4 different denominations and want to minimize the average number of coins necessary to make change for any value from 1c to 99c, each equally likely)
For US money, that's 470/99 ~ 4.75
For an optimal sizing of coins, we need only find all but the smallest one, because the smallest one would necessarily be 1c.
For a total amount N and sizings {c,1}, the average number of coins is {N/(2c),c/2} averaged over c. Repeating for {c1,c2,...,cn,1}, I find {N/(2c1), c1/(4c2), ..., cn-2/(2n-1cn-1), cn-1/2n-1} or more generally, {ck-1/(2k*ck)} with c0 = N and cn = 1/2.
Minimizing, this gives us ck-1/ck2 - 1/(2*ck+1) or
ck2 = 2*ck-1*ck+1
Taking the logarithm gives a linear recurrence. Solving it gives us
ck = 2-k(k+1)/2 * w0 * w1k
and plugging in the boundary conditions, the values for k = 0 and k = n, gives us
ck = 2-k(k+1)/2 + ((n+1)/2-1/n)*k * N(n-k)/n
I obtain splitting {75, 28, 5, 1}, which gives an average of 4.95 coins. The assumption of average behavior is somewhat violated here.
I created a hill-climbing minimizer, one that looks at all the neighbors of a point then selects the best one.
For {25, 10, 5, 1} and 1-step neighbors, I found {29, 11, 3, 1} with 4.16 coins
For {25, 10, 5, 1} and 2-step neighbors, I found {29, 11, 3, 1} with 4.16 coins
For {75, 28, 5, 1} and 1-step neighbors, I found {74, 28, 5, 1} with 4.93 coins
For {75, 28, 5, 1} and 2-step neighbors, I found {60, 17, 4, 1} with 4.38 coins
Turning {29, 11, 3, 1} into nice-looking numbers, I get {30, 10, 3, 1} with 4.24 coins
#1:
I wrote a Mathematica function that does that calculation, and I got 242.How many ways are there to make change of $1, using pennies, nickels, dimes, and quarters?
If you wish to do the comparable problem with British coinage, I've found these numbers: List of British banknotes and coins, Coins of the pound sterling
Decimal (Bank of England):
Coins: 1p, 2p, 5p, 10p, 20p, 50p, £1, £2
Bills: £5, £10, £20, £50
p = penny (British plural: pence), £ = pounds sterling
1 pound = 100 pence
I calculate 3953 splits of £1.
Before Decimal Day, 15 February 1971, the UK had used a much more complicated mix. Here are those that survived to that day or not long before:
Farthing: (1/4)d (discontinued 1960), Halfpenny: (1/2)d, One penny: 1d, Threepence: 3d, Sixpence: 6d, Shilling: 1s = 12d, Florin: 2s = 24d, Half-crown: 2s 6d = 30d (disc. 1969), Crown: 5s = 60d (disc. 1965)
Note: £1 = 20s = 240d
With only 1d, 3d, 6d, 1s, and 2s, I calculate 38841 splits of £1.
Since 3 is smaller than 7, let us first consider 3.If you repeatedly play a game where you can randomly win either $3 or $7, what is the largest dollar amount that it is not possible for you to cumulatively win? What about other $a and $b?
Since 3 is smaller than 7, let us first consider 3.If you repeatedly play a game where you can randomly win either $3 or $7, what is the largest dollar amount that it is not possible for you to cumulatively win? What about other $a and $b?
The winning values can be divided into 3 types: 3n, 3n+1, and 3n+2. The first one is a multiple of 3, so it's always possible. The second and third ones are not possible unless they are greater than appropriate multiples of 7. The second one's possible values are 3n+7, while the third one's possible values are 3n+14. The first one's largest impossible value is 4, while the second one's is 11.
Thus, 11 is the largest number that cannot be the combination of winnings.
For a and b more generally, where a and b are both positive integers, there will be a maximum impossible value only if gcd(a,b) = 1. Otherwise, there will be an infinity of winning values not divisible by gcd(a,b), and thus impossible.
Let a be the smaller one and b the larger one. Then all the n*a values are possible, while for k = 1 to (a-1), the n*a+k values need not be. Find k for b, then for 2b, then for multiples of b up to (a-1)*b. They will be distinct values, from relative primeness, and thus will cover all the possible n*a+k sets. The largest of these values that starts a possible set of n*a+k is (a-1)*b, and thus the largest impossible value is (a-1)*b - a.
That value equals (a-1)*(b-1) - 1, which is symmetric in a and b.
The optimal set is the set that needs the smallest average number of coins to make change, and that was what I was trying to calculate.What he asked was 'What is the optimal set of four coin denominations? ' to make change. I take the average comment to be extraneous.
The optimal set is the set that needs the smallest average number of coins to make change, and that was what I was trying to calculate.What he asked was 'What is the optimal set of four coin denominations? ' to make change. I take the average comment to be extraneous.
I make it 3.929. There are two equally good solutions.You can do better. IIRC, opt is around 3.9.
32 cents.As a somewhat easier followup, what denomination should we add to {25,10,5,1} to give the best average?
I'd likely have to write a C++ version to go through all the possible values, since Mma has a lot of object-management overhead.You can do better. IIRC, opt is around 3.9.
As a somewhat easier followup, what denomination should we add to {25,10,5,1} to give the best average?
I make it 3.929. There are two equally good solutions.
{25,18,5,1}
{29,18,5,1}
32 cents.As a somewhat easier followup, what denomination should we add to {25,10,5,1} to give the best average?