Sage Days 12 Talk
system:sage

{{{id=157|
factor(2009)
///


[7 2]

[41 1]
}}}

{{{id=91|
factor(2009).unit()
///

1
}}}

{{{id=158|
Factorization?
///
}}}

{{{id=90|
time n = number_of_partitions(10^8)
///
}}}

{{{id=89|
integrate(sin(x)*exp(x),x)
///
}}}

{{{id=88|
time w = pi.str(10^6)
///
}}}

{{{id=92|

///
}}}

{{{id=149|
G = AlternatingGroup(4)
///
}}}

{{{id=150|
G.gens()
///
[(1,2,3), (2,3,4)]
}}}

{{{id=87|
H = G.cayley_graph(); H.show3d()
///
}}}

{{{id=93|
A = H.automorphism_group(); A
///
}}}

{{{id=97|
A.order()
///
}}}

{{{id=96|
for n in [3..7]:
          An = AlternatingGroup(n); G = An.cayley_graph()
          print n, An.order(), G.automorphism_group().order()
///
}}}

{{{id=95|

///
}}}

{{{id=98|
E = EllipticCurve([12,3,4,5,6]); show(E)
///

<html><div class="math">y^2 + 12xy + 4y = x^3 + 3x^2 + 5x + 6 </div></html>
}}}

{{{id=153|
E
///

Elliptic Curve defined by y^2 + 12*x*y + 4*y = x^3 + 3*x^2 + 5*x + 6 over Rational Field
}}}

{{{id=152|
E.plot(xmin=-1,xmax=5)
///
}}}

{{{id=94|
factor(E.conductor())
///

2^4 * 5 * 11 * 13 * 277
}}}

{{{id=99|
time E.rank()
///

2
CPU time: 0.01 s,  Wall time: 0.25 s
}}}

{{{id=100|
time E.gens()
///

[(-6 : 66 : 1), (-2 : 20 : 1)]
CPU time: 0.15 s,  Wall time: 1.10 s
}}}

{{{id=101|

///
}}}

{{{id=102|
def data(E, D):
    F = E.quadratic_twist(D).minimal_model()
    rE = E.rank(); rF = F.rank()
    T = E.torsion_order()*F.torsion_order()
    cqprod = E.tamagawa_product()
    L_E = E.lseries().dokchitser().derivative(1, rE)
    L_F = F.lseries().dokchitser().derivative(1, rF)
    om2 = 2*abs(E.period_lattice().basis_matrix().det())
    sha = round( abs((L_E*L_F / (factorial(rE) * factorial(rF)) ) 
         * T^2 * sqrt(abs(D),prec=53) / 
        (om2 * E.regulator() * F.regulator() * cqprod^2)) )
    sha = odd_part(sha)
    return odd_part(T), odd_part(cqprod), sqrt(sha)
///
}}}

{{{id=103|
E = EllipticCurve('1862a1'); E.rank()
///
}}}

{{{id=105|
D = E.heegner_discriminants_list(1)[0]
time print D, data(E,D)
///
}}}

{{{id=106|

///
}}}

{{{id=109|

///
}}}

{{{id=108|
N = 2^217-1; M = 2^218-1; ls = [N,M]
time factor(N)
///

127 * 5209 * 62497 * 2147483647 * 6268703933840364033151 * 378428804431424484082633
Time: CPU 0.97 s, Wall: 1.03 s
}}}

{{{id=107|
time [ factor(x) for x in ls ]
///

[127 * 5209 * 62497 * 2147483647 * 6268703933840364033151 * 378428804431424484082633, 3 * 104124649 * 745988807 * 870035986098720987332873 * 2077756847362348863128179]
CPU time: 2.29 s,  Wall time: 2.49 s
}}}

{{{id=113|
@parallel(2)
def f_para(n): 
    return factor(n)
///
}}}

{{{id=112|
%time
for z in f_para(ls):
   print z
///

(((210624583337114373395836055367340864637790190801098222508621955071,), {}), 127 * 5209 * 62497 * 2147483647 * 6268703933840364033151 * 378428804431424484082633)
(((421249166674228746791672110734681729275580381602196445017243910143,), {}), 3 * 104124649 * 745988807 * 870035986098720987332873 * 2077756847362348863128179)
CPU time: 0.02 s,  Wall time: 1.47 s
}}}

{{{id=114|

///
}}}

{{{id=111|

///
}}}

{{{id=117|
#  Steiner surface/Roman's surface with embedded sphere
u, v = var('u,v')
fx = sin(2*u) * cos(v) * cos(v); fy = sin(u) * sin(2 * v)
fz = cos(u) * sin(2*v)
(sphere((0,0,0), 0.7, opacity=0.5) + 
   parametric_plot3d([fx, fy, fz], (u, -pi/2, pi/2), 
   (v, -pi/2,pi/2), frame=False, color="red"))
///
}}}

{{{id=116|

///
}}}

{{{id=124|

///
}}}

{{{id=123|
a = animate([circle((i,i), 1-1/(i+1), hue=i/10) 
             for i in srange(0,2,0.2)], 
             xmin=0,ymin=0,xmax=2,ymax=2,figsize=[2,2])
show(a)
///
}}}

{{{id=122|

///
}}}

{{{id=115|

///
}}}

{{{id=128|
gp(2) + singular(5)
///
}}}

{{{id=129|
var('x')
f = sin(x^2) + pi/2
show(f.integrate())
///
}}}

{{{id=127|
# g = mathematica(f); # license crap...
# g.Integrate(x)
///
}}}

{{{id=126|
n = 47
///
}}}

{{{id=154|
n._
///
}}}

{{{id=125|
var('x')
x0  = 0
@interact
def _(f=input_box(sin(x)*e^(-x)),order=(1..12)):
  p   = plot(f,-1,5, thickness=2)
  dot = point((x0,f(x0)),pointsize=80,rgbcolor=(1,0,0))
  ft = f.taylor(x,x0,order)
  pt = plot(ft,-1, 5, color='green', thickness=2)
  html('$f(x)\;=\;%s$'%latex(f))
  html('$\hat{f}(x;%s)\;=\;%s+\mathcal{O}(x^{%s})$'%(x0,latex(ft),order+1))
  show(dot + p + pt, ymin = -.5, ymax = 1)
///

<html><!--notruncate--><div padding=6 id='div-interact-125'> <table width=800px height=20px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">f&nbsp;</font></td><td><input type='text' value='e^(-x)*sin(x)' size=80 onchange='interact(125, "sage.server.notebook.interact.update(125, \"f\", 1, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'></input></td></tr>
<tr><td align=right><font color="black">order&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-order-125' class='ui-slider ui-slider-3' style='margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-order-125-lbl'></font></td></tr></table><script>(function(){ var values = ["1","2","3","4","5","6","7","8","9","10","11","12"]; setTimeout(function() {
    $('#slider-order-125').slider({
    	stepping: 1, min: 0, max: 11, startValue: 0,
    	change: function (e,ui) { var position = ui.value; if(values!=null) $('#slider-order-125-lbl').text(values[position]); interact(125, "sage.server.notebook.interact.update(125, \"order\", 2, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function(e,ui) { if(values!=null) $('#slider-order-125-lbl').text(values[ui.value]); }
    });
    if(values != null) $('#slider-order-125-lbl').text(values[$('#slider-order-125').slider('value')]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-125'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=133|

///
}}}

{{{id=132|

///
}}}

{{{id=131|
a = random_matrix(ZZ, 200, x=-2^128,y=2^128)
time d = a.det()
///
}}}

{{{id=134|

///
}}}

{{{id=135|

///
}}}

{{{id=136|

///
}}}

{{{id=141|
def mysum(N):
    s = int(0)
    for k in range(1,N):
        s += k
    return s
///
}}}

{{{id=142|
time mysum(10^6)
///

499999500000L
CPU time: 0.26 s,  Wall time: 0.27 s
}}}

{{{id=143|
%cython
def mysum_cython(N):
    cdef int k
    cdef long long s = 0
    for k in range(N):
        s += k
    return s
///
}}}

{{{id=130|
time mysum_cython(10^6)
///
}}}

{{{id=140|
timeit('mysum(10^6)')
///
}}}

{{{id=144|
timeit('mysum_cython(10^6)')
///
}}}

{{{id=139|

///
}}}

{{{id=138|

///
}}}

{{{id=137|

///
}}}

{{{id=121|
from scipy import io
x = io.loadmat(DATA + 'yodapose.mat')
from sage.plot.plot3d.index_face_set import IndexFaceSet
V = x['V']; F3 = x['F3']-1; F4 = x['F4']-1
Y = (IndexFaceSet(F3, V, color = Color('#00aa00')) + 
    IndexFaceSet(F4, V, color = Color('#00aa00')))
Y = Y.rotateX(-1)
Y.show(aspect_ratio = [1,1,1], frame = False, figsize = 4)
///
}}}

{{{id=120|

///
}}}

{{{id=119|

///
}}}

{{{id=118|

///
}}}

{{{id=78|

///
}}}

{{{id=77|

///
}}}

{{{id=76|

///
}}}

{{{id=73|

///
}}}

{{{id=44|

///
}}}

{{{id=62|

///
}}}

{{{id=81|

///
}}}

{{{id=72|
import pylab
A = pylab.imread(DATA + 'bug.png')
Agray = pylab.mean(A, 2)
def svd_image(Agray, i):
    siz   = pylab.shape(Agray)
    u,s,v = pylab.linalg.svd(Agray)
    Anew  = s[0]*pylab.outer(u[0:,0],v[0,0:])
    for j in range(i):
        uu   = u[0:,j+1]; vv = v[j+1,0:]      	  
        op   = pylab.outer(uu,vv)
        Anew = copy(Anew) + pylab.dot(s[j+1],op)
    pylab.figure(); pylab.subplot(121)
    pylab.imshow(Anew); pylab.gray()
    pylab.title('Using ' + str(i+1) + ' columns')
    pylab.subplot(122); pylab.imshow(Agray)
    pylab.gray(); pylab.title('Original'); pylab.savefig('x.png')
    
@interact
def energy_in_svd(i=slider(0,50,1)):
    svd_image(Agray,i)
///

<html><!--notruncate--><div padding=6 id='div-interact-72'> <table width=800px height=20px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">i&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-i-72' class='ui-slider ui-slider-3' style='margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-i-72-lbl'></font></td></tr></table><script>(function(){ var values = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50"]; setTimeout(function() {
    $('#slider-i-72').slider({
    	stepping: 1, min: 0, max: 50, startValue: 0,
    	change: function (e,ui) { var position = ui.value; if(values!=null) $('#slider-i-72-lbl').text(values[position]); interact(72, "sage.server.notebook.interact.update(72, \"i\", 3, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function(e,ui) { if(values!=null) $('#slider-i-72-lbl').text(values[ui.value]); }
    });
    if(values != null) $('#slider-i-72-lbl').text(values[$('#slider-i-72').slider('value')]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-72'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=54|

///
}}}

{{{id=58|
a = random_matrix(ZZ, 200, x=-2^128,y=2^128)
///
}}}

{{{id=56|
time d = a.det()
///
}}}

{{{id=155|

///
}}}

{{{id=82|
S = finance.Stock('java').close()
@interact
def _(days=(80,(20..len(S))), alpha=(0.2,(0,1))):
    print "Last %s days stock price and geom moving average"%days
    Z = S[-days:]
    G = Z.exponential_moving_average(alpha)[1:]
    (Z.plot() + G.plot(rgbcolor='red')).show(frame=True)
///

<html><!--notruncate--><div padding=6 id='div-interact-82'> <table width=800px height=20px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">days&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-days-82' class='ui-slider ui-slider-3' style='margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-days-82-lbl'></font></td></tr></table><script>(function(){ var values = ["20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100","101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","127","128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","177","178","179","180","181","182","183","184","185","186","187","188","189","190","191","192","193","194","195","196","197","198","199","200","201","202","203","204","205","206","207","208","209","210","211","212","213","214","215","216","217","218","219","220","221","222","223","224","225","226","227","228","229","230","231","232","233","234","235","236","237","238","239","240","241","242","243","244","245","246","247","248","249","250","251","252","253","254","255","256"]; setTimeout(function() {
    $('#slider-days-82').slider({
    	stepping: 1, min: 0, max: 236, startValue: 60,
    	change: function (e,ui) { var position = ui.value; if(values!=null) $('#slider-days-82-lbl').text(values[position]); interact(82, "sage.server.notebook.interact.update(82, \"days\", 4, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function(e,ui) { if(values!=null) $('#slider-days-82-lbl').text(values[ui.value]); }
    });
    if(values != null) $('#slider-days-82-lbl').text(values[$('#slider-days-82').slider('value')]);
    }, 1); })();</script></td></tr>
<tr><td align=right><font color="black">alpha&nbsp;</font></td><td><table><tr><td>
    	<div id='slider-alpha-82' class='ui-slider ui-slider-3' style='margin:0px;'><span class='ui-slider-handle'></span></div>
    	</td><td><font color='black' id='slider-alpha-82-lbl'></font></td></tr></table><script>(function(){ var values = ["0.0","0.00200400801603","0.00400801603206","0.0060120240481","0.00801603206413","0.0100200400802","0.0120240480962","0.0140280561122","0.0160320641283","0.0180360721443","0.0200400801603","0.0220440881764","0.0240480961924","0.0260521042084","0.0280561122244","0.0300601202405","0.0320641282565","0.0340681362725","0.0360721442886","0.0380761523046","0.0400801603206","0.0420841683367","0.0440881763527","0.0460921843687","0.0480961923848","0.0501002004008","0.0521042084168","0.0541082164329","0.0561122244489","0.0581162324649","0.060120240481","0.062124248497","0.064128256513","0.0661322645291","0.0681362725451","0.0701402805611","0.0721442885772","0.0741482965932","0.0761523046092","0.0781563126253","0.0801603206413","0.0821643286573","0.0841683366733","0.0861723446894","0.0881763527054","0.0901803607214","0.0921843687375","0.0941883767535","0.0961923847695","0.0981963927856","0.100200400802","0.102204408818","0.104208416834","0.10621242485","0.108216432866","0.110220440882","0.112224448898","0.114228456914","0.11623246493","0.118236472946","0.120240480962","0.122244488978","0.124248496994","0.12625250501","0.128256513026","0.130260521042","0.132264529058","0.134268537074","0.13627254509","0.138276553106","0.140280561122","0.142284569138","0.144288577154","0.14629258517","0.148296593186","0.150300601202","0.152304609218","0.154308617234","0.156312625251","0.158316633267","0.160320641283","0.162324649299","0.164328657315","0.166332665331","0.168336673347","0.170340681363","0.172344689379","0.174348697395","0.176352705411","0.178356713427","0.180360721443","0.182364729459","0.184368737475","0.186372745491","0.188376753507","0.190380761523","0.192384769539","0.194388777555","0.196392785571","0.198396793587","0.200400801603","0.202404809619","0.204408817635","0.206412825651","0.208416833667","0.210420841683","0.212424849699","0.214428857715","0.216432865731","0.218436873747","0.220440881764","0.22244488978","0.224448897796","0.226452905812","0.228456913828","0.230460921844","0.23246492986","0.234468937876","0.236472945892","0.238476953908","0.240480961924","0.24248496994","0.244488977956","0.246492985972","0.248496993988","0.250501002004","0.25250501002","0.254509018036","0.256513026052","0.258517034068","0.260521042084","0.2625250501","0.264529058116","0.266533066132","0.268537074148","0.270541082164","0.27254509018","0.274549098196","0.276553106212","0.278557114228","0.280561122244","0.282565130261","0.284569138277","0.286573146293","0.288577154309","0.290581162325","0.292585170341","0.294589178357","0.296593186373","0.298597194389","0.300601202405","0.302605210421","0.304609218437","0.306613226453","0.308617234469","0.310621242485","0.312625250501","0.314629258517","0.316633266533","0.318637274549","0.320641282565","0.322645290581","0.324649298597","0.326653306613","0.328657314629","0.330661322645","0.332665330661","0.334669338677","0.336673346693","0.338677354709","0.340681362725","0.342685370741","0.344689378758","0.346693386774","0.34869739479","0.350701402806","0.352705410822","0.354709418838","0.356713426854","0.35871743487","0.360721442886","0.362725450902","0.364729458918","0.366733466934","0.36873747495","0.370741482966","0.372745490982","0.374749498998","0.376753507014","0.37875751503","0.380761523046","0.382765531062","0.384769539078","0.386773547094","0.38877755511","0.390781563126","0.392785571142","0.394789579158","0.396793587174","0.39879759519","0.400801603206","0.402805611222","0.404809619238","0.406813627255","0.408817635271","0.410821643287","0.412825651303","0.414829659319","0.416833667335","0.418837675351","0.420841683367","0.422845691383","0.424849699399","0.426853707415","0.428857715431","0.430861723447","0.432865731463","0.434869739479","0.436873747495","0.438877755511","0.440881763527","0.442885771543","0.444889779559","0.446893787575","0.448897795591","0.450901803607","0.452905811623","0.454909819639","0.456913827655","0.458917835671","0.460921843687","0.462925851703","0.464929859719","0.466933867735","0.468937875752","0.470941883768","0.472945891784","0.4749498998","0.476953907816","0.478957915832","0.480961923848","0.482965931864","0.48496993988","0.486973947896","0.488977955912","0.490981963928","0.492985971944","0.49498997996","0.496993987976","0.498997995992","0.501002004008","0.503006012024","0.50501002004","0.507014028056","0.509018036072","0.511022044088","0.513026052104","0.51503006012","0.517034068136","0.519038076152","0.521042084168","0.523046092184","0.5250501002","0.527054108216","0.529058116232","0.531062124248","0.533066132265","0.535070140281","0.537074148297","0.539078156313","0.541082164329","0.543086172345","0.545090180361","0.547094188377","0.549098196393","0.551102204409","0.553106212425","0.555110220441","0.557114228457","0.559118236473","0.561122244489","0.563126252505","0.565130260521","0.567134268537","0.569138276553","0.571142284569","0.573146292585","0.575150300601","0.577154308617","0.579158316633","0.581162324649","0.583166332665","0.585170340681","0.587174348697","0.589178356713","0.591182364729","0.593186372745","0.595190380762","0.597194388778","0.599198396794","0.60120240481","0.603206412826","0.605210420842","0.607214428858","0.609218436874","0.61122244489","0.613226452906","0.615230460922","0.617234468938","0.619238476954","0.62124248497","0.623246492986","0.625250501002","0.627254509018","0.629258517034","0.63126252505","0.633266533066","0.635270541082","0.637274549098","0.639278557114","0.64128256513","0.643286573146","0.645290581162","0.647294589178","0.649298597194","0.65130260521","0.653306613226","0.655310621242","0.657314629259","0.659318637275","0.661322645291","0.663326653307","0.665330661323","0.667334669339","0.669338677355","0.671342685371","0.673346693387","0.675350701403","0.677354709419","0.679358717435","0.681362725451","0.683366733467","0.685370741483","0.687374749499","0.689378757515","0.691382765531","0.693386773547","0.695390781563","0.697394789579","0.699398797595","0.701402805611","0.703406813627","0.705410821643","0.707414829659","0.709418837675","0.711422845691","0.713426853707","0.715430861723","0.717434869739","0.719438877756","0.721442885772","0.723446893788","0.725450901804","0.72745490982","0.729458917836","0.731462925852","0.733466933868","0.735470941884","0.7374749499","0.739478957916","0.741482965932","0.743486973948","0.745490981964","0.74749498998","0.749498997996","0.751503006012","0.753507014028","0.755511022044","0.75751503006","0.759519038076","0.761523046092","0.763527054108","0.765531062124","0.76753507014","0.769539078156","0.771543086172","0.773547094188","0.775551102204","0.77755511022","0.779559118236","0.781563126253","0.783567134269","0.785571142285","0.787575150301","0.789579158317","0.791583166333","0.793587174349","0.795591182365","0.797595190381","0.799599198397","0.801603206413","0.803607214429","0.805611222445","0.807615230461","0.809619238477","0.811623246493","0.813627254509","0.815631262525","0.817635270541","0.819639278557","0.821643286573","0.823647294589","0.825651302605","0.827655310621","0.829659318637","0.831663326653","0.833667334669","0.835671342685","0.837675350701","0.839679358717","0.841683366733","0.843687374749","0.845691382766","0.847695390782","0.849699398798","0.851703406814","0.85370741483","0.855711422846","0.857715430862","0.859719438878","0.861723446894","0.86372745491","0.865731462926","0.867735470942","0.869739478958","0.871743486974","0.87374749499","0.875751503006","0.877755511022","0.879759519038","0.881763527054","0.88376753507","0.885771543086","0.887775551102","0.889779559118","0.891783567134","0.89378757515","0.895791583166","0.897795591182","0.899799599198","0.901803607214","0.90380761523","0.905811623246","0.907815631263","0.909819639279","0.911823647295","0.913827655311","0.915831663327","0.917835671343","0.919839679359","0.921843687375","0.923847695391","0.925851703407","0.927855711423","0.929859719439","0.931863727455","0.933867735471","0.935871743487","0.937875751503","0.939879759519","0.941883767535","0.943887775551","0.945891783567","0.947895791583","0.949899799599","0.951903807615","0.953907815631","0.955911823647","0.957915831663","0.959919839679","0.961923847695","0.963927855711","0.965931863727","0.967935871743","0.96993987976","0.971943887776","0.973947895792","0.975951903808","0.977955911824","0.97995991984","0.981963927856","0.983967935872","0.985971943888","0.987975951904","0.98997995992","0.991983967936","0.993987975952","0.995991983968","0.997995991984","1"]; setTimeout(function() {
    $('#slider-alpha-82').slider({
    	stepping: 1, min: 0, max: 499, startValue: 100,
    	change: function (e,ui) { var position = ui.value; if(values!=null) $('#slider-alpha-82-lbl').text(values[position]); interact(82, "sage.server.notebook.interact.update(82, \"alpha\", 5, sage.server.notebook.interact.standard_b64decode(\""+encode64(position)+"\"), globals())"); },
    	slide: function(e,ui) { if(values!=null) $('#slider-alpha-82-lbl').text(values[ui.value]); }
    });
    if(values != null) $('#slider-alpha-82-lbl').text(values[$('#slider-alpha-82').slider('value')]);
    }, 1); })();</script></td></tr>
</table><div id='cell-interact-82'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=83|

///
}}}

<p style="text-align: right;">This is my <strong>awesomely important </strong>formula:</p>
<p>$$ \alpha = \beta. $$</p>

{{{id=86|
\sage{random_matrix(ZZ,3,3).det()}
///

\left(\begin{array}{rrr}
1 & 4 & 1 \\
3 & 8 & 1 \\
-1 & 0 & 1
\end{array}\right)
}}}

{{{id=85|
ZZ.random_element?
///
}}}

{{{id=148|

///
}}}

{{{id=147|
def class_hierarchy(cls, v):
    v.append(str(cls))
    for supercls in cls.__bases__:
        class_hierarchy(supercls, v)
@interact
def foo(object=1):
    print '<html><h1>Inheritance hierarchy of %r</h1>'%object
    print '<font color="#333333"><pre>'
    v = []; class_hierarchy(object.__class__, v)
    print '\n'.join(['.'*(3*i)+w for i, w in
              enumerate(reversed(v))]).replace('<','&lt;')
    print '</pre></font></html>'
///

<html><!--notruncate--><div padding=6 id='div-interact-147'> <table width=800px height=20px bgcolor='#c5c5c5'
                 cellpadding=15><tr><td bgcolor='#f9f9f9' valign=top align=left><table><tr><td align=right><font color="black">object&nbsp;</font></td><td><input type='text' value='1' size=80 onchange='interact(147, "sage.server.notebook.interact.update(147, \"object\", 7, sage.server.notebook.interact.standard_b64decode(\""+encode64(this.value)+"\"), globals())")'></input></td></tr>
</table><div id='cell-interact-147'><?__SAGE__START>
        <table border=0 bgcolor='#white' width=100% height=100%>
        <tr><td bgcolor=white align=left valign=top><pre><?__SAGE__TEXT></pre></td></tr>
        <tr><td  align=left valign=top><?__SAGE__HTML></td></tr>
        </table><?__SAGE__END></div></td>
                 </tr></table></div>
                 </html>
}}}

{{{id=146|

///
}}}

{{{id=145|

///
}}}

{{{id=84|

///
}}}

{{{id=41|

///
}}}

{{{id=33|
E = EllipticCurve([12,3,4,5,6])
plot(E)
///
}}}

{{{id=32|

///
}}}

{{{id=36|

///
}}}

{{{id=37|

///
}}}

{{{id=26|

///
}}}

{{{id=25|

///
}}}

{{{id=24|

///
}}}

{{{id=3|

///
}}}

<a name="1">

<a name="2">

{{{id=14|

///
}}}

{{{id=11|

///
}}}

{{{id=2|

///
}}}

{{{id=17|

///
}}}

{{{id=18|

///
}}}