or rather the last m calculated
banned-users
Phi Kappa Chi ΦΚΧ <a:yeah:589703000977571860><a:ppHop:536353159615086612>
Jump to date
Friday, September 22, 2017
I might have been able to do this Kappa
Running a test with large L
will take 6 years to run this test
seems to be summing each individual thing and printing each individual sum Kappa
Seems to only run each possible combination of i, j, k
minus 0,0,0 since I restricted that
correct value is -1.748 according to wikipedia
that is with L = 15, so it is working kind of
Just need to get it to only print the last value
permutations
order matters
it is a point in 3d space
yeah, if I can just get this thing to print the last calculated sum, I am good
Saturday, September 23, 2017
Fucking liar
Fucking
no shit
A month late
being bilingual is required though
is it, for english speakers?
for being an elected official
It is required that we teach french in schools and Quebec teaches english in theirs though
i wholesomely enjoy Justin Trudeau
I do not
fuck that guy
and everything about him
Haha my dudes I did it
you ended it all?
nice.
Got it to work
you shouldn't need to cast as float when you specify 1.0
I did not specify as 1.0 at first
forgot to take that out
wanna see my version? Kappa
doesn't python 3 need things casted
and sure
specifying the decimal casts to float
alright
i was bored so i wrote a much more in depth version of what you were working on
Already excited
from math import sqrt
import numpy as np
import matplotlib.pyplot as plt
def centeredgen(L):
for i in range(L+1):
for j in range(L+1):
for k in range(L+1):
yield i,j,k
if k > 0:
yield i,j,-k
if j > 0:
yield i,-j,k
if k > 0:
yield i,-j,-k
if i > 0:
yield -i,j,k
if k > 0:
yield -i,j,-k
if j > 0:
yield -i,-j,k
if k > 0:
yield -i,-j,-k
if __name__ == "__main__":
L = 30
M = 0.0
a = []
gen = centeredgen(L)
next(gen) # skip the 0,0,0
sign2 = lambda n: " " if n >= 0 else ""
sign = lambda n: " "*(3-len(str(n)))
for i,j,k in gen:
h = ((-1.0)**(i+j+k))/sqrt(i*i+j*j+k*k)
M += h
a += [M]
print("%s%d,%s%d,%s%d -> %s%01.4f => %s%01.4f"%(sign(i),i,sign(j),j,sign(k),k,sign2(h),h,sign2(M),M))
print("\nMean estimate: %.4f" % np.mean(a))
plt.plot(a)
plt.show()
rip me
are you using 2.7 or 3.X?
I used 2.7 to do this, I have no fucking idea what the course wants
he told us we were using 3, but told us to download 2.7
in 2.7 you should use xrange instead of range
what is the difference?
in 2.7 range creates a list of all of the values and then iterates through them
xrange is a generator
so it spends time allocating all the values and wastes memory
will keep that in mind for next time. After spending 10 hours on this, I am fine with it as is
having wrote and rewrote it from the ground up 3 times
my centeregen is a generator
it goes through the code until it hits yield, then continues the next time its used
How many times did your thing run it?
i did L=30
ah, thats why
it is much more accurate than mine for L=30 lol
but thats fine with me
well i wrote it so i could take a mean safely
I’ve made a new icon and banner for myself
good banner
Kappa
It is pretty good
Kapap
Nice joke twitter
Haha my dude
fuck you m8
Kappa
Put all your points in bartering
