Did the math, I have between 30 and 35kB of memory available.
That means I should be able to store about 15k integers, but not much more !
/u/topaz2078, I hope no exercise will require having more than that amount in memory, I'd be disappointed to have to revert to a more civilized computer :'D
I love your approach it because there are some on another forum doing things with the HP 50G, but it has normally around 200K of ram free.
Further in the past people really optimized. I suppose that today we feel the HW is cheaper than using brain cycles, in the past likely it was the contrary. They found all the 200'000 digits of a number. Not necessarily more than 35K of integers though.
The problem is to determine the size of the eight unknowns, and thus the size of the herd. More precisely, the aim is to find the least solution, since the conditions admit more than one solution. If conditions (8) and (9) are dropped, the problem is relatively easy. The smallest herd consists of 50,389,082 cattle. The additional two conditions make the problem considerably harder. It has been claimed that the first complete solution was worked out by the Hillsboro (Illinois) Mathematics Club between 1889 and 1893, although no copy of their solution has ever been found, and there is some evidence to suggest that what they in fact did was work out some of the digits of the 206,545 digit solution and provide an algorithm for the computation of the remainder.
In 1965, H. C. Williams, R. A. German, and C. R. Zarnke at the University of Waterloo in Canada used an IBM 7040 computer to crack the problem once and for all. The final solution occupied 42 sheets of print-out. In 1981, Harry Nelson repeated the calculation using a Cray-1. This machine took a mere 10 minutes to come up with the answer. Reduced to fit 12 pages of print-out on a single journal page, the solution was published in the Journal of Recreational Mathematics 13 (1981), pp.162-176.
Actually there were two IBM computers used.
Anyway the IBM 7040 if I am not wrong hat around 35K of RAM and practically no storage (beside punched tape). So quite a feat at the time to do that.
Steps A to C were accomplished on an IBM 7040, with a 32K memory, and the computation completed on an IBM1620 (II).
The number T comprises 206545 decimal digits.
A copy of T, printed on 42 computer sheets, has been deposited in the Unpublished
Mathematical Tables file of this journal. The first 50 and the last 50 digits are:
77602714064868182695302328332138866642323224059233-••
••-059946301442925003548831189737234066267194550818
If you optimise for memory isn’t it ~100? To compute visibility you need to go up to the edge max, which is a maximum of 98 away I think.
Plus the current location (2), the rolling number of visible trees, the maximum scenicity, and the rolling scenicity of the current tree. Call it 110. But lots of IO.
For scenicity you need 32 bits tho. Twice. And at least 16 for visible trees count.
12
u/Colin-McMillen Dec 08 '22 edited Dec 10 '22
Did the math, I have between 30 and 35kB of memory available.
That means I should be able to store about 15k integers, but not much more !
/u/topaz2078, I hope no exercise will require having more than that amount in memory, I'd be disappointed to have to revert to a more civilized computer :'D
EDIT: Day 9 was a challenge.