|
|
|
 |
Posted 2010-12-16, 01:25 AM
in reply to Knight Sir Rick's post starting "Not enough math in this "math" thread...."
|
 |
 |
 |
Not enough math in this "math" thread. Anyway, I found you a closed-form function for your problem:
 = \sum_{p=0}^7 \( \sum_{k=\frac{2^p + H[p-1] +1}{2}}^{2^p} \(2^{(8-p) H[n-k]} + H[n-2k] + H[n-2k+1] -1\) \)<br />
)
where is the discrete Heaviside step function defined as
|
While I understand what you wrote. Converting it to code it seems like it would take longer to compute than WW's answer. Considering for each sigma, there's a for loop that must be run. As well as calls to the function H.
For a completely math based, non-linear, answer though, very impressive. You compressed it into two functions worth. Still much better than my original way of doing it.
------------
Also, what I meant by the "[Math...]" and "...mathematically..." was just because it isn't just some regular programming stuff. It requires a bit of math knowledge to try and make something that works.

Work List
疲れていますから 寝むってありますね。 むずかしいです。 また、ケーキ屋で ケーキを食べていました。
I've considered being a translator, but I dunno. It feels like a lot of work. If someone gets angry then I have to deal with it, you know? I'd rather just relax.
Speed Test
Favorite Anime/Manga
#01 Clannad ~After Story~
#02 Trigun {Maximum}
#03 Koi Kaze
#04 Berserk
#05 Outlaw Star
#06 Slayers
#07 Desert Punk
#08 Spirited Away
#09 Fullmetal Alchemist
#10 Shakugan no Shana
#11 Death Note
#12 FLCL
#13 Tokyo Magnitude 8.0
#14 Toradora
#15 Gunslinger Girl
Anime List
|
 |
 |
 |
|
|
|
|
|
|
|