/Beranda/SageMathCell

SageMathCell

SageMathCell // Make the div with id 'mycell' a Sage cell sagecell.makeSagecell({inputLocation: '#mycell', template: sagecell.templates.minimal, evalButtonText: 'Enable'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute',languages: ["sage","gap","gp","html","maxima","octave","python", "r"], evalButtonText: 'Evaluate'}); // Make the div with id 'selsaya' a Sage cell sagecell.makeSagecell({inputLocation: '#selsaya', template: sagecell.templates.minimal, evalButtonText: 'Enable'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute',languages: ["sage","gap","gp","html","maxima","octave","python", "r"], evalButtonText: 'Evaluate'}); // Make the div with id 'Sisthom' a Sage cell sagecell.makeSagecell({inputLocation: '#Sisthom', template: sagecell.templates.minimal, evalButtonText: 'Enable'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute',languages: ["sage","gap","gp","html","maxima","octave","python", "r"], evalButtonText: 'Evaluate'}); // Make the div with id 'Intent' a Sage cell sagecell.makeSagecell({inputLocation: '#Intent', template: sagecell.templates.minimal, evalButtonText: 'Enable'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute',languages: ["sage","gap","gp","html","maxima","octave","python", "r"], evalButtonText: 'Evaluate'}); // Make the div with id 'Intent' a Sage cell sagecell.makeSagecell({inputLocation: '#taylor', template: sagecell.templates.minimal, evalButtonText: 'Enable'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute',languages: ["sage","gap","gp","html","maxima","octave","python", "r"], evalButtonText: 'Evaluate'}); MathJax example MathJax = { tex: { inlineMath: [['$', '$'], ['\\(', '\\)']] } }; /* Basic styling */ body { font-family: Arial, sans-serif; margin: 0; padding: 0.0; } .navbar { height: 100vh; /* Full height */ width: 200px; /* Adjust width as needed */ background-color: #233; /* Navbar background color */ position: fixed; /* Fix it on the screen */ left: 0; top: 0; overflow-x: hidden; /* Hide horizontal scrollbar */ padding-top: 155px; /* Space at the top */ } .navbar a { padding: 10px; /* Padding for links */ text-decoration: none; /* Remove underline */ display: block; /* Make links block level */ color: white; /* Text color */ } .dropdown-content { display: none; /* Hide dropdown content by default */ background-color: #512; /* Dropdown background color */ } /* Show dropdown content when hovering over dropdown */ .dropdown:hover .dropdown-content { display: block; } /* Custom styling for horizontal lines */ .horizontal-line { border: none; height: 2px; /* Adjust the height of the line */ background-color: #333; /* Change the color of the line */ margin: 20px 0; /* Adjust the margin as needed */ } .tooltip { position: relative; display: inline-block; border-bottom: 1px dotted black; } .tooltip .tooltiptext { visibility: hidden; width: 200px; background-color: blue; color: #fff; text-align: justify; border-radius: 6px; padding: 5px; /* Position the tooltip */ position: absolute; z-index: 5; } .tooltip:hover .tooltiptext { visibility: visible; } .hidden { display: none; } .tooltip1 { position: relative; display: inline; border-bottom: 1px dotted black; } .tooltip1 .tooltiptext { visibility: hidden; width: 250px; background-color: blue; color: #fff; text-align: justify; border-radius: 10px; padding: 10px; /* Position the tooltip */ position: absolute; z-index: 1; top: 100%; left: 60%; margin-left: -60px; } .tooltip1:hover .tooltiptext { visibility: visible; } p.ex1 { margin-left: 200px; margin-right: 50px; } .tooltip2 { position: relative; display: inline; border-bottom: 1px dotted black; } .tooltip2 .tooltiptext { visibility: hidden; width: 200px; background-color: blue; color: #fff; text-align: justify; border-radius: 10px; padding: 10px; /* Position the tooltip */ position: absolute; z-index: 1; top: 100%; left: 60%; margin-left: -60px; } .tooltip2:hover .tooltiptext { visibility: visible; } p.ex1 { margin-left: 200px; margin-right: 50px; } .tooltip3 { position: relative; display: inline; border-bottom: 1px dotted black; } .tooltip3 .tooltiptext { visibility: hidden; width: 350px; background-color: blue; color: #fff; text-align: justify; border-radius: 10px; padding: 10px; /* Position the tooltip */ position: absolute; z-index: 1; top: 100%; left: 60%; margin-left: -60px; } .tooltip3:hover .tooltiptext { visibility: visible; } p.ex1 { margin-left: 200px; margin-right: 50px; }







Embedded SageMath Cell and Jupyter Notebooks

Laboratory of Analysis, Algebra and Mathematical learning
Department of Mathematics-ITS











1. Introduction


1.1. OBJECTIFITY

These SageMath Cells and Jupyter Notebooks serve as dedicated teaching aids for the mathematics department at the Sepuluh Nopember Institute of Technology (ITS). They provide a platform to showcase how ITS mathematics students can bridge the gap between theoretical knowledge and practical applications. By performing calculations based on mathematical reasoning, students can simultaneously verify their understanding of mathematical concepts.

Furthermore, students can validate the mathematical ideas they have studied by utilizing their programming skills in languages like Sage, Gap, GP, and Maxima, all of which are specifically designed for symbolic mathematics. Numerical validation can also be facilitated by languages like R and Python.. All resources and computations are conveniently cloud-based.

Whoever follows the road of knowledge-seeking, الله will facilitate his journey to جَنَّة .


1.2. About SageMath

A free and open-source mathematical software package with an emphasis on computer algebra is called SageMath. "Embedded SageMath Cell" refers to SageMath programme cells that can be put into other programmes because SageMath can be embedded in other programmes.

Sagemath is useful for a variety of mathematical problems, such as:

  • Symbolic and numerical computation
  • Algebra
  • Calculus
  • Differential equations
  • Numerical analysis
  • Statistics
  • Optimization
  • Graphing
  • Programming
  • SageMath Features

Among the many characteristics of Sagemath are the following:

  • A powerful and flexible syntax
  • A large library of mathematical functions
  • An extensive documentation
  • A vibrant community of users and developers
  • SageMath Applications

SageMath has several uses, some of which are as follows:

  • Mathematical research
  • Education
  • Engineering
  • Science
  • Finance
  • Business

A SageMath feature called "Embedded SageMath Cell" enables users to embed SageMath code in other documents, such Jupyter notebooks. This saves users from having to launch Sagemath (an interactive application) and use it as a calculator by enabling them to run SageMath code directly within the text. Furthermore, we can execute python code in SageMath Cell, including sympy (symbolic python), numpy (numerical python), scipy (scientific python), and so on.

SageMath is introduced in this section. "System for Algebra and Geometry Experimentation" was the original name of SAGE. Currently using SageMath. Its goal is to be a strong free open source substitute for open source MAPLE, MATHEMATICA, and MATLAB. It is free software, licenced under the GPL. SageMath is constructed upon numerous open source packages that already exist: The URL NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many others. Through an interface or wrapper, or directly through a common Python-based language, you can access their combined strength.

SageMath includes a large number of excellent open-source mathematical software programmes. Calculus, number theory (beginning to advanced), cryptography, commutative algebra, group theory, graph theory, exact and numerical linear algebra, and many more mathematical topics can all be discussed using the open-source SageMath programme. Furthermore, SageMath features interactive programmes that are simple to comprehend and, consequently, to construct, as well as graphical animations and capabilities. As a result, it will be highly beneficial for learning, particularly for maths. SageMath 10.2 is the most recent version, and it was released on December 3, 2023.

Python is the programming language utilised in SageMath. It was initially introduced by mathematician William Stein of the University of Washington, Seattle, who oversaw the development of SageMath.

History and Development of SageMath
The original intention behind the publication of SageMath's first edition, which was free and open-source software released under the GNU General Public Licence version 3, was to provide a "open source alternative to Magma, Maple, Mathematica, and MATLAB". Mathematical problems in algebra, number theory, geometry, and combinatorics can be resolved with the Magma computer algebra system. The programme, which is called after the algebraic structure magma, is compatible with both Windows and Unix-like operating systems. [Magma] is closed source software even if it is not non-commercial software (cost recovery, non-commercial proprietary). University of Washington mathematician William Stein is the creator and director of the SageMath project.

When creating SageMath, William Stein discovered that a number of open-source mathematical software packages—written in C, C ++, Common Lisp, Fortran, and Python—had already been developed in other languages.

Instead of creating the wheel, SageMath (primarily developed in Python and Cython) unifies a variety of specialised mathematical software products into a single interface that requires no programming knowledge beyond Python. Nevertheless, the hundreds of thousands of lines of original code that make up SageMath bring new functionality and provide the interface between its parts.

Professionals and students alike work on developing SageMath. Grants and volunteer labour are used to fund the development of SageMath. Still, the first full-time SageMath developer wasn't hired until 2016 (thanks to an EU grant). The same year, Stein expressed his dissatisfaction with the dearth of university financing and certification programmes for software development, stating this as the rationale behind his choice to resign from his academic post and devote all of his time to the project at a recently established business, SageMath, Inc. Sagemath's official website, [SageMath], and [WikiSageMath] provide comprehensive material and can be used as a resource.

SageMath is a powerful software programme for studying a wide range of mathematical topics, including calculus, number theory (from elementary to advanced), cryptography, commutative algebra, group theory, graph theory, and both precise and numerical linear algebra. It can also generate user-friendly visualizations like images, animations, and interactive programs. This makes SageMath a valuable tool for learning mathematics, especially for visual learners. The SageMath Cell Server provides access to the latest version of SageMath. You can check the specific version by typing the command version() within a cell. For more information on SageMath development, please refer to [SageMath Development]. Based on the knowledge we given here, we took the initiative to construct the SageMath-ITS Cell. Computations can be done using Sage, Gap, GP, HTML, Maxima, Octave, Python, and R programming languages.

The Sage command line has a sage prompt in the input cell. If you are using a Sage notebook (the available input box), type, for example, 5+21 in the input box cell, and click the Evaluate button to calculate the corresponding output.

To calculate the power of a number, type the following in the input cell: 123**1245, which calculates \(123^{1245}\). Please try it by typing the input on line 2 and then clicking the Evaluate button. To find out the version of SageMath you are currently using, type version() on line \(3\) of the input, and then click the Evaluate button. Then copy and paste the following command on the next input line:
%display latex
A=matrix([[1,2], [3,4]])
print("A = ")
A

to display a matrix \(A=\left(\begin{array}{rr} 1 & 2 \\ 3 & 4 \end{array}\right)\) of size \(2\times 2\). To determine the inverse of \(A\), which is \(B=A^{-1}=\left(\begin{array}{rr} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{array}\right)\) copy and paste the following command:
print("B =")
A^-1

Copy and paste the following commands one by one:
print("AB = ")
A*A^-1

and
print("BA =")
A^-1*A

It can be seen that matrix \(A=\left(\begin{array}{rr} 1 & 2 \\ 3 & 4 \end{array}\right)\) has invers \(B=\left(\begin{array}{rr} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{array}\right)\).

The following integral is calculated: $$ \int\sqrt{x+1}\sqrt{x}\;dx $$ using the following command:
%display latex

x = var('x')
f=sqrt(x)*sqrt(1+x)
print("f(x) = ")
f

and
g=integrate(f, x)
print("The integral of f(x) with respect to x is: ", g)

Next, we test the anti-derivative of \(f(x)\), which is \(F(x)\). We can verify this by differentiating \(F(x)\) and checking if it equals \(f(x)\). Do this with the following command:
%display latex
h=diff(g,x)
h.canonicalize_radical()

If you want to know information about the commands you have typed in the input cell box, type the following in the input cell box, for example:
diff?
or
integrate?
If you place the command %time at the beginning of an input line, the time it takes to execute the command will be displayed after the output. For example, we can compare the running times for certain exponential operations in a few ways. The timings below will likely be different on your computer, or even between different versions of SageMath. Try typing the following commands in the input cell box:
%time a = int(1938)^int(99484); print("a = ",a)


%time a = int(1938)^int(99484); print("a = ",a)

# This Sagemath cell is provided for practice! version()


# This Sagemath cell is provided for practice!


1.3. 2D Graph

Sage provides extensive 2D plotting functionality. The underlying rendering is done using the matplotlib Python library. To get information on 2D plots, type plot?. From this information, you can try drawing graphs from the existing examples.


plot?


f(x) = (floor(x)+0.5) / (1-(x-0.5)^2) plot(f, (x, -3.5, 3.5),gridlines='True', detect_poles='show', exclude=[-3..3],ymin=-5, ymax=5,figsize=4,title='Graphic: $f(x)=\\dfrac{\\lfloor x\\rfloor + 0.5}{(1-(x-0.5)^2)}$')


f(x) = x^2*sin(1/x) g1 = plot(f(x), (x, -2, 2),gridlines='True', axes_labels=['$x$', '$y$'],legend_label=r'$x^2\sin(1/x)$') g2 = plot(f(x), (x, -0.3, 0.3),gridlines='True', axes_labels=['$x$', '$y$'],color='red',frame=True) g1.inset(g2,pos=(0.129, 0.58, 0.25, 0.25))

f(x) = sin(x) g(x) = sin(2 * x) h(x) = sin(4 * x) p1 = plot(f, (-2 * pi,2 * pi), color=hue(0.5)) # long time p2 = plot(g, (-2 * pi,2 * pi), color=hue(0.9)) # long time p3 = parametric_plot((f,g), (0,2 * pi), color=hue(0.6)) # long time p4 = parametric_plot((f,h), (0,2 * pi), color=hue(1.0)) # long time ga = graphics_array(((p1,p2), (p3,p4))) # long time ga.show() # long time; same output as above

print() p1 = plot(sin(x^2), (x, 0, 6),axes_labels=[r'$\theta$', r'$\sin(\theta^2)$'], fontsize=8) p2 = plot(x^3, (x, 1, 100), axes_labels=[r'$x$', r'$y$'],scale='semilogy', frame=True, gridlines='minor') ga = graphics_array([p1, p2]) ga.show()

n, l, x, y = 10000, 1, 0, 0; p = [[0, 0]] for k in range(n): theta = (2*pi*random()).n(digits=5) x, y = x + l * cos(theta), y + l * sin(theta) p.append([x, y]) g1 = line([p[n], [0, 0]], color='red', thickness=2) g1 += line(p, thickness=.4); g1.show(aspect_ratio=1)

z = var('z') g1 = complex_plot(abs(cos(z^4))-1,(-3,3), (-3,3), plot_points=400) f = lambda x, y : (abs(cos((x + I * y) ** 4)) - 1) g2 = implicit_plot(f, (-3, 3), (-3, 3), plot_points=400) g1.show(aspect_ratio=1); g2.show(aspect_ratio=1)

t = var('t') x = cos(t) + cos(7*t)/2 + sin(17*t)/3 y = sin(t) + sin(7*t)/2 + cos(17*t)/3 g = parametric_plot((x, y), (t, 0, 2*pi)) g.show(aspect_ratio=1)

f2(x) = 1; f1(x) = -1 f = piecewise([[(-pi,0),f1],[(0,pi),f2]]) S = f.fourier_series_partial_sum(20,pi) g = plot(S, x, -8, 8, color='blue') saw(x) = x - 2 * pi * floor((x + pi) / (2 * pi)) g += plot(saw(x) / abs(saw(x)), x, -8, 8, color='red') g

a = animate([[sin(x), taylor(sin(x), x, 0, 2*k+1)]\ for k in range(0, 14)], xmin=-14, xmax=14,\ ymin=-3, ymax=3, figsize=[8, 4]) a.show()

# This Sagemath cell is provided for practice!

1.4. 3D Graph

Sage also provides extensive 3D plotting functionality. The underlying rendering is done using the matplotlib Python library. To get information on 3D plots, type plot3d?, from this information you can try drawing graphs from the existing examples. Click the left mouse button and move around. By doing this, you can see the image from different angles.

Given any 3D graphics object M one can compute a raytraced representation by typing M.show(viewer='tachyon'). For example, we draw two translucent spheres that contain a red tube, and render the result using Tachyon. SageMath's 3D graphics capabilities are truly remarkable, as evidenced by the various examples provided here. Readers can learn from the 3D graphics code presented here and experiment by modifying the commands to suit their needs.

In addition to the 3D graphics presented here, you can interact with the Three.js JavaScript WebGL Renderer. A web-based interactive viewer using the Three.js JavaScript library maintained by https://threejs.org.

The viewer is invoked by adding the keyword argument viewer='threejs' to the command show() or any three-dimensional graphic. The scene is rendered and displayed in the users’s web browser. Interactivity includes

  • Zooming in or out with the mouse wheel or pinching on a touch pad
  • Rotation by clicking and dragging with the mouse or swiping on a touch pad
  • Panning by right-clicking and dragging with the mouse or swiping with three fingers on a touch pad

The generated HTML file contains all data for the scene apart from the JavaScript library and can be saved to disk for sharing or embedding in a web page. The option online can be set to true to provide links to the required files in an online content delivery network. Alternately the required files can be downloaded from the Three.js GitHub repository and linked directly from the web server.


import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # Generate data x = np.linspace(-5, 5, 100) y = np.linspace(-5, 5, 100) x, y = np.meshgrid(x, y) z = np.sin(np.sqrt(x**2 + y**2)) # Plot fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.plot_surface(x, y, z, cmap='viridis') # Set labels and title ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') ax.set_title('3D Surface Plot') plt.show()


plot3d?


from sage.plot.plot3d.shapes import * S = Sphere(.5, color='yellow') S += Cone(.5, .5, color='red').translate(0,0,.3) S += Sphere(.1, color='white').translate(.45,-.1,.15) S += Sphere(.05, color='black').translate(.51,-.1,.17) S += Sphere(.1, color='white').translate(.45, .1,.15) S += Sphere(.05, color='black').translate(.51, .1,.17) S += Sphere(.1, color='yellow').translate(.5, 0, -.2) S.scale(1,1,2).show(frame=False)


x,y = var('x,y') plot3d(sin(x - y)*y*cos(x), (x, -3, 3), (y, -3, 3),mesh=True)


x, y = var('x y') W = plot3d(sin(pi*((x)^2 + (y)^2))/2, (x, -1, 1), (y, -1, 1),frame=False, color='purple', opacity=0.8) S = sphere((0, 0, 0), size=0.3, color='red', aspect_ratio=[1,1,1]) show(W + S, figsize=8)

def f(x,y): return math.sin(y^2 + x^2)/math.sqrt(x^2 + y^2 + 0.0001) P = plot3d(f, (-3, 3),(-3, 3), adaptive=True,color=rainbow(60, 'rgbtuple'), max_bend=.1, max_depth=15) P.show()

def f(x,y): return math.exp(x/5)*math.sin(y) P = plot3d(f, (-5, 5), (-5, 5), adaptive=True, color=['red', 'yellow']) from sage.plot.plot3d.plot3d import axes S = P + axes(6, color='black') S.show()

x, y = var('x y') cm = colormaps.hsv def c(x, y): return float((x + y + x*y)/15) % 1 plot3d(x*x + y*y, (x, -4, 4), (y, -4, 4), color=(c, cm))

T = Cylindrical('height', ['radius', 'azimuth']) r, theta, z = var('r theta z') T.transform(radius=r, azimuth=theta, height=z) plot3d(9-r^2, (r, 0, 3), (theta, 0, pi), transformation=T)

S = Cylindrical('radius', ['azimuth', 'height']) theta, z = var('theta, z') plot3d(3, (theta, 0, 2*pi), (z, -2, 2), transformation=S)

T = Spherical('radius', ['azimuth', 'inclination']) r, phi, theta = var('r phi theta') T.transform(radius=r, azimuth=theta, inclination=phi) plot3d(phi * theta, (theta, 0, pi), (phi, 0, 1), transformation=T)

S = Spherical('inclination', ['radius', 'azimuth']) r, theta = var('r,theta') plot3d(10, (r,0,5), (theta, 0, 2*pi), transformation=S)

SE = SphericalElevation('elevation', ['radius', 'azimuth']) r, theta = var('r,theta') plot3d(10, (r, 0, 5), (theta, 0, 2*pi), transformation=SE)

SE = SphericalElevation('elevation', ['radius', 'azimuth']) r, theta = var('r,theta') P1 = plot3d((pi/12)*sin(8*theta), (r,0.99,1), (theta, 0, 2*pi),transformation=SE, plot_points=(10,200)) P2 = sphere(center=(0,0,0), size=1, color='red', opacity=0.3) P1 + P2

r, phi, theta = var('r phi theta') SE = SphericalElevation('elevation', ['radius', 'azimuth']) angles = [pi/18, pi/12, pi/6] P1 = [plot3d(a, (r,0,3), (theta, 0, 2*pi), transformation=SE, opacity=0.85, color='blue') for a in angles] S = Spherical('inclination', ['radius', 'azimuth']) P2 = [plot3d(a, (r,0,3), (theta, 0, 2*pi), transformation=S, opacity=0.85, color='red') for a in angles] show(sum(P1+P2), aspect_ratio=1)

r, u, v = var('r,u,v') f = u*v; urange = (u, 0, pi); vrange = (v, 0, pi) T = (r*cos(u), r*sin(u), v, [u, v]) plot3d(f, urange, vrange, transformation=T)

theta, z = var('theta,z') cylindrical_plot3d(2, (theta, 0, 3*pi/2), (z, -2, 2))

theta, z = var('theta,z') cylindrical_plot3d(cosh(z), (theta, 0, 2*pi), (z, -2, 2))

theta, z = var('theta,z') cylindrical_plot3d(e^(-z^2)*(cos(4*theta) + 2) + 1, (theta, 0, 2*pi), (z, -2, 2), plot_points=[80, 80]).show(aspect_ratio=(1, 1, 1))

plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2))

plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2), adaptive=True)

plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2), adaptive=True, initial_depth=5)

var('x,y') plot3d(x^2 + y^2, (x,-2,2), (y,-2,2))

var('x,y') plot3d(sin(x*y), (x, -pi, pi), (y, -pi, pi))

var('x,y') plot3d(sin(x^2 + y^2), (x,-5,5), (y,-5,5), plot_points=200)

var('x,y') plot3d(sin(x^2 + y^2), (x, -5, 5), (y, -5, 5), plot_points=[10, 100])

var('x,y') plot3d(sin(x - y)*y*cos(x), (x, -3, 3), (y, -3, 3), mesh=True)

var('x,y') plot3d(sin(x - y)*y*cos(x), (x, -3, 3), (y, -3, 3), mesh=True, thickness=2, viewer='threejs')

x,y = var('x,y') P = plot3d(x + y + sin(x*y), (x, -10, 10), (y, -10, 10), opacity=0.87, color='blue') Q = plot3d(x - 2*y - cos(x*y),(x, -10, 10), (y, -10, 10), opacity=0.3, color='red') P + Q

x,y = var('x,y') L = plot3d(lambda x,y: 0, (-5,5), (-5,5), color="lightblue", opacity=0.8) P = plot3d(lambda x,y: 4 - x^3 - y^2, (-2,2), (-2,2), color='green') Q = plot3d(lambda x,y: x^3 + y^2 - 4, (-2,2), (-2,2), color='orange') L + P + Q

x, y = var('x y') plot3d(sin(pi*(x^2 + y^2))/2, (x, -1, 1), (y, -1, 1))

x, y = var('x y') plot3d(4*x*exp(-x^2 - y^2), (x, -2, 2), (y, -2, 2))

r, phi, z = var('r phi z') trans = (r*cos(phi), r*sin(phi), z) plot3d(cos(r), (r, 0, 17*pi/2), (phi, 0, 2*pi), transformation=trans, opacity=0.87).show(aspect_ratio=(1,1,2), frame=False)

phi, theta = var('phi, theta') Y = spherical_harmonic(2, 1, theta, phi) rea = spherical_plot3d(abs(real(Y)), (phi, 0, 2*pi), (theta, 0, pi), color='blue', opacity=0.6) ima = spherical_plot3d(abs(imag(Y)), (phi, 0, 2*pi), (theta, 0, pi), color='red', opacity=0.6) (rea + ima).show(aspect_ratio=1)

x,y = var('x,y') spherical_plot3d((2 + cos(2*x))*(y + 1), (x, 0, 2*pi), (y, 0, pi), rgbcolor=(1, .1, .1))

x,y = var('x,y') spherical_plot3d(1 + sin(5*x)/5, (x, 0, 2*pi), (y, 0, pi), rgbcolor=(1, 0.5, 0), plot_points=(80, 80), opacity=0.7)

x, y = var('x,y') spherical_plot3d(1 + 2*cos(2*y), (x, 0, 3*pi/2), (y, 0, pi)).show(aspect_ratio=(1, 1, 1))

S = sphere(opacity=0.8, aspect_ratio=[1,1,1]) L = line3d([(0,0,0),(2,0,0)], thickness=10, color='red') M = S + S.translate((2,0,0)) + L M.show(viewer='tachyon')

t = Tachyon(xres=500, yres=500, camera_position=(2,0,0)) t.light((4,3,2), 0.2, (1,1,1)) t.texture('t2', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1,0,0)) t.texture('t3', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(0,1,0)) t.texture('t4', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(0,0,1)) t.sphere((0,0.5,0), 0.2, 't2') t.sphere((0.5,0,0), 0.2, 't3') t.sphere((0,0,0.5), 0.2, 't4') t.show()

t = Tachyon(camera_position=(0,-4,1), xres=800, yres=600, raydepth=12, aspectratio=.75, antialiasing=4) t.light((0.02,0.012,0.001), 0.01, (1,0,0)) t.light((0,0,10), 0.01, (0,0,1)) t.texture('s', color=(.8,1,1), opacity=.9, specular=.95, diffuse=.3, ambient=0.05) t.texture('p', color=(0,0,1), opacity=1, specular=.2) t.sphere((-1,-.57735,-0.7071),1,'s') t.sphere((1,-.57735,-0.7071),1,'s') t.sphere((0,1.15465,-0.7071),1,'s') t.sphere((0,0,0.9259),1,'s') t.plane((0,0,-1.9259),(0,0,1),'p') t.show()

cedges = [[[1, 1, 1], [-1, 1, 1]], [[1, 1, 1], [1, -1, 1]], [[1, 1, 1], [1, 1, -1]], [[-1, 1, 1], [-1, -1, 1]], [[-1, 1, 1], [-1, 1, -1]], [[1, -1, 1], [-1, -1, 1]], [[1, -1, 1], [1, -1, -1]], [[-1, -1, 1], [-1, -1, -1]], [[1, 1, -1], [-1, 1, -1]], [[1, 1, -1], [1, -1, -1]], [[-1, 1, -1], [-1, -1, -1]], [[1, -1, -1], [-1, -1, -1]]] t = Tachyon(xres=800, yres=600, camera_position=(-1.5,0.0,0.0), zoom=.2) t.texture('t1', color=(0,0,1)) for ed in cedges: t.fcylinder(ed[0], ed[1], .05, 't1') t.light((-4,-4,4), .1, (1,1,1)) t.show()

cedges = [[[1, 1, 1], [-1, 1, 1]], [[1, 1, 1], [1, -1, 1]], [[1, 1, 1], [1, 1, -1]], [[-1, 1, 1], [-1, -1, 1]], [[-1, 1, 1], [-1, 1, -1]], [[1, -1, 1], [-1, -1, 1]], [[1, -1, 1], [1, -1, -1]], [[-1, -1, 1], [-1, -1, -1]], [[1, 1, -1], [-1, 1, -1]], [[1, 1, -1], [1, -1, -1]], [[-1, 1, -1], [-1, -1, -1]], [[1, -1, -1], [-1, -1, -1]]] t = Tachyon(xres=800, yres=600, camera_position=(-1.5,0.0,0.0), projection='fisheye', frustum=(-1.2, 1.2, -1.2, 1.2)) t.texture('t1', color=(0,0,1)) for ed in cedges: t.fcylinder(ed[0], ed[1], .05, 't1') t.light((-4,-4,4), .1, (1,1,1)) t.show()

T = Tachyon(xres=800, antialiasing=4, raydepth=10, projection='perspective_dof', focallength='1.0', aperture='.0025') T.light((0,5,7), 1.0, (1,1,1)) T.texture('t1', opacity=1, specular=.3) T.texture('t2', opacity=1, specular=.3, color=(0,0,1)) T.texture('t3', opacity=1, specular=1, color=(1,.8,1), diffuse=0.2) T.plane((0,0,-1), (0,0,1), 't3') ttlist = ['t1', 't2'] tt = 't1' T.cylinder((0,0,.1), (1,1/3,0), .05, 't3') for q in srange(-3, 100, .15): if tt == 't1': tt = 't2'; else: tt = 't1' T.sphere((q, q/3+.3*sin(3*q), .1+.3*cos(3*q)), .1, tt) T.show()

p1 = sphere(color='red', opacity='.5') p2 = sphere((-1,-1,1), color='cyan', opacity='.3') p3 = sphere((1,-1,-1), color='yellow', opacity='.7') show(p1 + p2 + p3, viewer='threejs')

def build_frame(t): e = parametric_plot3d([sin(x-t), 0, x], (x, 0, 2*pi), color='red') m = parametric_plot3d([0, -sin(x-t), x], (x, 0, 2*pi), color='green') return e + m frames = [build_frame(t) for t in (0, pi/32, pi/16, .., 2*pi)] plot = animate(frames).interactive() show(plot, delay=5, auto_play=False, projection='orthographic')

We present examples of animations created with the Three.js JavaScript WebGL Renderer.


# This Sagemath cell is provided for practice!

# This Sagemath cell is provided for practice!

# This Sagemath cell is provided for practice!

2. Data Structures

Data structures A data organization, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data, i.e., it is an algebraic structure about data. [Source] are fundamental building blocks in computer science Computer science is the study of computation, information, and automation. Computer science spans theoretical disciplines (such as algorithms, theory of computation, and information theory) to applied disciplines (including the design and implementation of hardware and software). [Source]. They organize and store data efficiently, enabling easy access, modification, and retrieval. These structures are crucial for writing efficient algorithms and managing large datasets A data set (or dataset) is a collection of data. In the case of tabular data, a data set corresponds to one or more database tables, where every column of a table represents a particular variable, and each row corresponds to a given record of the data set in question. The data set lists values for each of the variables, such as for example height and weight of an object, for each member of the data set. Data sets can also consist of a collection of documents or files. [Source] in software development.

Here are some common data structures:

  1. Arrays: A collection of elements stored in contiguous memory locations. Arrays offer constant-time access to elements but may have limitations when resizing.
  2. Linked Lists: A sequence of elements where each element points to the next one in the sequence. Linked lists allow for efficient insertion and deletion but may have slower access times compared to arrays.
  3. Stacks: A Last-In-First-Out (LIFO) data structure. Elements are added and removed from the same end, called the top. Common operations include push (add) and pop (remove).
  4. Queues: A First-In-First-Out (FIFO) data structure. Elements are added at the rear and removed from the front. Common operations include enqueue (add) and dequeue (remove).
  5. Trees: Hierarchical data structures composed of nodes. Trees have a root node, parent nodes, and child nodes. Examples include binary trees, binary search trees, and AVL trees.
  6. Graphs: A collection of nodes (vertices) connected by edges. Graphs can be directed or undirected and may have weighted edges.
  7. Hash Tables: Data structures that store key-value pairs. They use a hash function to compute an index into an array of buckets or slots, where the value can be stored or retrieved with an associated key.

These are just some of the foundational data structures, and there are many variations and combinations used in different scenarios depending on the requirements of the problem at hand. Understanding data structures and their properties is essential for designing efficient algorithms and building robust software systems.

2.1. Greedy algorithm

The greedy algorithmA greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally optimal solutions that approximate a globally optimal solution in a reasonable amount of time. [Source] can be used to determine the minimum number of bills to give when making a refund in a cash transaction. Here's how it works in practice: Imagine you need to return change for an amount like 678, using only bills of denominations 500, 100, 50, 20, 10, 5, and 1. How many bills would you need to minimize the total number given?

Let us understand this with the help of an example: If you have 1,000 and needs to return 678. We will start with 500 (the highest denomination) and find the number of bills of this denomination required by dividing the amount to be returned by the denomination (and then taking the floor), which is 678/500, which is 1. Now, the remaining balance can be found by subtracting from 678, which gives 178. This is followed by repeating the process with the next highest denomination. That is, for finding the number of denominations of 100, divide the remaining, i.e., 178 by 100 (and then take the floor), which gives 1. The remaining amount in the next step will be 78. Likewise, the number of notes of 50, 20, 10, 5, and 1 will be 1, 1, 0, 1, and 3. That is, the number of bills required for change are [1, 1, 1, 1, 0, 1, 3].

Here is the Python code to solve the problem mentioned before.


def coin_changing(L, amount): denomination = [] i=0 while(i<len(L)): num = floor(amount/L[i]) amount = amount - num*L[i] denomination.append(num) i+=1 return denomination L=[500, 100, 50, 20, 10, 5, 1] # List of changeable denominations print(len(L)) den=coin_changing(L, 678) # The return amount is 678. You can change it. print(den)

2.2. NumPy array

NumPy is not imported into sage initially. To use NumPy, you first need to import it. The basic object of computation in NumPy is an array. It is simple to create an array.


import numpy as np a = np.array([1,24, 3, 2]) a

NumPy arrays can store any type of python object. However, for speed, numeric types are automatically converted to native hardware types (i.e., int, float, etc.) when possible. If the value or precision of a number cannot be handled by a native hardware type, then an array of Sage objects will be created. You can do calculations on these arrays, but they may be slower than using native types. When the numpy array contains Sage or python objects, then the data type is explicitly printed as object. If no data type is explicitly shown when NumPy prints the array, the type is either a hardware float or int.

import numpy as np a = np.array([2**40, 3**40, 4**40]) a

import numpy as np a = 2.0000000000000000001 print(a.prec()) # higher precision than hardware floating point numbers print(np.array([a,2*a,3*a]))

The dtype attribute of an array tells you the type of the array. For fast numerical computations, you generally want this to be some sort of float. If the data type is float, then the array is stored as an array of machine floats, which takes up much less space and which can be operated on much faster.


import numpy as np l = np.array([1.0, 2.0, 3.0]) l.dtype

You can create an array of a specific type by specifying the dtype parameter. If you want to make sure that you are dealing with machine floats, it is good to specify dtype=float when creating an array.


import numpy as np l = numpy.array([1,2,3], dtype=float) l.dtype

You can access elements of a NumPy array just like any list, as well as take slices


import numpy as np l = numpy.array(range(10),dtype=float) print("l =",l) print("l[3] =",l[3]) print("l[3:6] =",l[3:6])

You can do basic arithmetic operations


import numpy as np l = numpy.array(range(10),dtype=float) print("l =",l) print("l + l =",l+l) print("2.5*l =",2.5*l)

Note that l*l will multiply the elements of l componentwise. To get a dot product, use numpy.dot().


import numpy as np l = numpy.array(range(10),dtype=float) print("l =",l) print("l*l =",l*l) print("numpy.dot(l,l) =",numpy.dot(l,l))

We can also create two dimensional arrays


import numpy as np m = np.array([[1,2],[3,4]]) print("m =",m) print("m[1,1] =",m[1,1])

This is basically equivalent to the following


import numpy as np m = np.matrix([[1,2],[3,4]]) print("m =",m) print("m[1,1] =",m[1,1])

The difference is that with np.array(), m is treated as just an array of data. In particular m*m will multiply componentwise, however with np.matrix(), m*m will do matrix multiplication. We can also do matrix vector multiplication, and matrix addition.


import numpy as np n = np.matrix([[1,2],[3,4]],dtype=float) v = np.array([[1],[2]],dtype=float) print("n*v =",n*v) print("n+n =",n+n)

If n was created with numpy.array(), then to do matrix vector multiplication, you would use numpy.dot(n,v).

All NumPy arrays have a shape attribute. This is a useful attribute to manipulate


n = numpy.array(range(25),dtype=float) print("n =",n) n.shape = (5,5) print("n =",n)

This changes the one-dimensional array into a $5\times 5$ array.

NumPy arrays can be sliced as well


n = numpy.array(range(25),dtype=float) n.shape = (5,5) print("n[2:4,1:3] =",n[2:4,1:3])

It is important to note that the sliced matrices are references to the original.


n = numpy.array(range(25),dtype=float) n.shape = (5,5) m = n[2:4,1:3] m[0,0] = 100 print("n =",n) print("m =",m)

You will note that the original matrix changed. This may or may not be what you want. If you want to change the sliced matrix without changing the original you should make a copy.


n = numpy.array(range(25),dtype=float) n.shape = (5,5) m = n[2:4,1:3].copy() print("m =",m)

Some particularly useful commands are


x = numpy.arange(0,2,.1,dtype=float) print("x =",x)

You can see that numpy.arange() creates an array of floats increasing by 0.1 from 0 to 2. There is a useful command numpy.r_() that is best explained by example.


from numpy import r_ j = complex(0,1) RealNumber = float Integer = int n = r_[0.0:5.0] print("n =",n) n = r_[0.0:5.0, [0.0]*5] print("n =",n) j

numpy.r_() provides a shorthand for constructing NumPy arrays efficiently. Note in the above 0.0:5.0 was shorthand for 0.0, 1.0, 2.0, 3.0, 4.0. Suppose we want to divide the interval from 0 to 5 into 10 intervals. We can do this as follows


from numpy import r_ j = complex(0,1) r_[0.0:5.0:11*j]

The notation 0.0:5.0:11*j expands to a list of 11 equally space points between 0 and 5 including both endpoints. Note that j is the NumPy imaginary number, but it has this special syntax for creating arrays. We can combine all of these techniques.


from numpy import r_ j = complex(0,1) n = r_[0.0:5.0:11*j,int(5)*[0.0],-5.0:0.0] n

Another useful command is numpy.meshgrid(), it produces meshed grids. As an example suppose you want to evaluate $f(x,y)=x^2+y^2$ on a an equally spaced grid with $\Delta x=\Delta y = 0.25$ for $0\leq x,y\leq 1$. You can do that as follows


import numpy j = complex(0,1) def f(x,y): return x**2+y**2 from numpy import meshgrid x = numpy.r_[0.0:1.0:5*j] y = numpy.r_[0.0:1.0:5*j] xx,yy = meshgrid(x,y) print("xx =",xx) print("yy =",yy) print("f(xx,yy) =",f(xx,yy))

You can see that numpy.meshgrid() produces a pair of matrices, here denoted $xx$ and $yy$, such that $(xx[i,j],yy[x,j])$ has coordinates $(x[i],y[j])$. This is useful because to evaluate $f$ over a grid, we only need to evaluate it on each pair of entries in $xx, yy$. Since NumPy automatically performs arithmetic operations on arrays componentwise, it is very easy to evaluate functions over a grid with very little code.

A useful module is the numpy.linalg module. If you want to solve an equation $Ax=b$ do


import numpy from numpy import linalg A = numpy.random.randn(5,5) b = numpy.array(range(1,6)) x = linalg.solve(A,b) numpy.dot(A,x)

This creates a random $5\times 5$ matrix $A$, and solves $Ax=b$ where $b=[1.0,2.0,3.0,4.0,5.0]$. There are many other routines in the numpy.linalg module that are mostly self-explanatory. For example there are qr and lu routines for doing QR and LU decompositions. There is also a command eigs for computing eigenvalues of a matrix. You can always do ? to get the documentation which is quite good for these routines.

Hopefully this gives you a sense of what NumPy is like. You should explore the package as there is quite a bit more functionality.


3. Indefinite Integrals

Click the "Enable" button below to calculate indefinite integrals. To perform the computation, click the "Update" button. Please type other functions in the available box to perform indefinite integration of the functions you want.

x=var('x') @interact def _(f = input_box(default = x^3/(x^2-1),width=25),auto_update=False): q=integrate(f,x) pretty_print(html(r"The value of integral: $$\int\left(%s\right)\\ dx=%s+c$$"%(latex(f),latex(q))))

You can also perform indefinite integral computations using Geogebra as follows. Try observing and comparing the computation results in the SageMath Cell with the results in Geogebra.
">


4. Exercises!

We provide some problems, you can try solving them with SageMath.

  1. Find the integral: \(\operatorname{\Large\int} \dfrac{\sqrt{3}}{\sqrt{3x^2-2}}\; dx\).
    // JavaScript function to toggle the text visibility function toggleText() { var text = document.getElementById("toggle-text"); if (text.style.display === "none") { text.style.display = "block"; } else { text.style.display = "none"; } } Solution: Click to display/hide!

    To solve this problem, we need a geometric diagram of the following right triangle:

    \begin{tikzpicture} \draw node at (-1.0cm,-0.85cm){$\theta$}; \coordinate [label=left:$C$] (A) at (-1.5cm,-1.cm); \coordinate [label=right:$A$] (C) at (1.5cm,-1.0cm); \coordinate [label=above:$B$] (B) at (1.5cm,1.0cm); \draw (A) -- node[above] {$a$} (B) -- node[right] {$c$} (C) --node[below] {$b$} (A); \draw (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm); \end{tikzpicture}

    If \(a=u\) and \(b=1\), then \(c=\sqrt{u^{2} - 1}\). This leads to \(\sec(\theta)=u\) and \(\tan(\theta)=\sqrt{u^{2} - 1}\). We will also be utilizing the following trigonometric identities: \begin{equation} \fbox{\(\tan^2(\theta)=\sec^{2} - 1\)}.\label{eqn1}\tag{1} \end{equation} and (the reader is encouraged to verify) the equation: \begin{equation} \fbox{\(\int\; \sec(\theta)\;d\theta=\ln|\sec(\theta)+\tan(\theta)|+k\)}.\label{eqn2}\tag{2} \end{equation} Now, we are ready to calculate the requested integral. \begin{eqnarray*} \operatorname{\Large\int} \dfrac{\sqrt{3}}{\sqrt{3x^2-2}}\; dx &=& \operatorname{\Large\int} \dfrac{\sqrt{3}}{\sqrt{2(\frac{3}{2}x^2-1)}}\; dx\\ &=& \operatorname{\huge\int} \dfrac{\sqrt{3}}{\sqrt{2}}\dfrac{1}{\sqrt{\left(\frac{\sqrt{3}}{\sqrt{2}}x\right)^2-1)}}\; dx,\\ && \qquad{\rm{let,}}\ u=\frac{\sqrt{3}}{\sqrt{2}}x\Rightarrow du=\frac{\sqrt{3}}{\sqrt{2}}dx\\ &=& \operatorname{\Large\int} \dfrac{1}{\sqrt{u^2-1}}\; du. \end{eqnarray*} To calculate the last integral that appears here, we substitute \(u=\sec(\theta)\). We discussed the reason for this substitution when we discussed the trigonometric diagram. This gives us \(du=\sec(\theta)\tan(\theta)d\theta\). Using Equation (\ref{eqn1}) and Equation (\ref{eqn2}), we have \[ \begin{eqnarray*} \operatorname{\Large\int} \dfrac{1}{\sqrt{u^2-1}}\; du &=& \operatorname{\Large\int} \dfrac{\sec(\theta)\tan(\theta)}{\sqrt{\sec^2(\theta)-1}}\; d\theta\\ &=& \operatorname{\Large\int} \dfrac{\sec(\theta)\tan(\theta)}{\sqrt{\tan^2(\theta)}}\; d\theta\\ &=& \operatorname{\Large\int} \dfrac{\sec(\theta)\tan(\theta)}{\tan(\theta)}\; d\theta\\ &=& \int\; \sec(\theta)\;d\theta\\ &=& \ln|\sec(\theta)+\tan(\theta)|+k\\ &=& \ln|u + \sqrt{u^{2} - 1}|+k\\ &=& \ln\left| \frac{\sqrt{3}}{\sqrt{2}}x +\sqrt{\frac{3}{2}x^2 -1} \right| + k\\ &=& \ln\left| \frac{6}{2\sqrt{6}}x +\frac{1}{\sqrt{2}}\sqrt{3x^2 -2} \right| + k\\ &=& \ln\left| \frac{6}{2\sqrt{6}}x +\frac{2\sqrt{3}}{2\sqrt{6}}\sqrt{3x^2 -2} \right| + k\\ &=& \ln\left|\frac{1}{2\sqrt{6}} \left(6x +2\sqrt{3}\sqrt{3x^2 -2}\right) \right| + k\\ &=& \ln\left|6x +2\sqrt{3}\sqrt{3x^2 -2}\right| + \ln\left(\frac{1}{2\sqrt{6}}\right)+k,\\ &&\qquad\qquad \ c=\ln\left(\frac{1}{2\sqrt{6}}\right)+k \\ &=& \ln\left|6x +2\sqrt{3}\sqrt{3x^2 -2}\right| + c. \end{eqnarray*} \] The reader is invited to verify this result using SageMath computation, noting that \(\ln\) in SageMath is represented as \(\log\).\(\qquad\bigstar\)

  2. Compute \(\operatorname{\Large\int} \dfrac{1}{2+x^2}\; dx\).
    // JavaScript function to toggle the text visibility function toggleText1() { var text = document.getElementById("toggle-text1"); if (text.style.display === "none") { text.style.display = "block"; } else { text.style.display = "none"; } } Solution: Click to display/hide!

    \[ \begin{eqnarray*} \operatorname{\Large\int} \dfrac{1}{2+x^2}\; dx &=& \operatorname{\huge\int} \dfrac{1}{2\left(1+\left(\frac{x}{\sqrt{2}}\right)^{2}\right)}\; dx,\\ &&\qquad {\rm{suppose}}\ \tan(\theta)=\frac{x}{\sqrt{2}}\Rightarrow \sqrt{2}\sec^{2}(\theta)d\theta=dx\\ &=& \operatorname{\Large\int} \dfrac{\sqrt{2}\sec^{2}(\theta)}{2(1+\tan^2(\theta)}\; d\theta\\ &=&\frac{\sqrt{2}}{2}\int \frac{\sec^2(\theta)}{\sec^2(\theta)}\;d\theta\\ &=& \frac{\sqrt{2}}{2}\int d\theta\\ &=& \frac{\sqrt{2}}{2}\theta +c\\ &=& \frac{\sqrt{2}}{2}\arctan\left(\frac{1}{2}\sqrt{2}x\right)+c.\quad\bigstar \end{eqnarray*} \]

  3. Compute \(\operatorname{\Large\int} \dfrac{e^{x}}{\sqrt{1-e^{2x}}}\;dx\).
    // JavaScript function to toggle the text visibility function toggleText2() { var text = document.getElementById("toggle-text2"); if (text.style.display === "none") { text.style.display = "block"; } else { text.style.display = "none"; } } Solution: Click to display/hide!

    \[ \begin{eqnarray*} \operatorname{\Large\int} \dfrac{e^{x}}{\sqrt{1-e^{2x}}}\;dx &=& \operatorname{\Large\int} \dfrac{e^{x}}{\sqrt{1-(e^{x})^2}}\;dx\\ &&\qquad {\rm{suppose}}\ \sin(\theta)=e^{x}\Rightarrow \cos(\theta)d\theta=e^{x}dx\\ &=& \operatorname{\Large\int} \dfrac{\cos(\theta)}{\sqrt{1-\sin^2(\theta)}}\;d\theta\\ &=& \operatorname{\Large\int} \dfrac{\cos(\theta)}{\sqrt{\cos^2(\theta)}}\;d\theta\\ &=& \operatorname{\Large\int} \dfrac{\cos(\theta)}{\cos(\theta)}\;d\theta\\ &=& \int d\theta\\ &=& \theta + c\\ &=& \arcsin(e^x)+c.\quad\bigstar \end{eqnarray*} \]

  4. Compute \(\operatorname{\Large\int}\dfrac{x}{4x^2+12x+13}\,dx\).
    // JavaScript function to toggle the text visibility function toggleText3() { var text = document.getElementById("toggle-text3"); if (text.style.display === "none") { text.style.display = "block"; } else { text.style.display = "none"; } } Solution: Click to display/hide!

    From Exercise 2, we can conclude that \(\fbox{\(\int\frac{1}{1+u^2}\;du=\arctan(u)+c\)}\). We use this result: \begin{eqnarray*} \operatorname{\Large\int}\dfrac{x}{4x^2+12x+13}\;dx &=& \frac{1}{4}\operatorname{\Large\int}\dfrac{x}{x^2+3x+\frac{9}{4}+1}\;dx\\ &=& \frac{1}{4}\operatorname{\Large\int}\dfrac{x}{\left(x+\frac{3}{2}\right)^2+1}\;dx,\\ &&\qquad {\rm{suppose}}\ u=x+\frac{3}{2}\Rightarrow du=dx, x=u-\frac{3}{2}\\ &=& \frac{1}{4}\operatorname{\Large\int}\dfrac{u-\frac{3}{2}}{u^2+1}\;du\\ &=& \frac{1}{4}\operatorname{\Large\int}\dfrac{u}{u^2+1}\;du-\frac{3}{8}\operatorname{\Large\int}\dfrac{1}{u^2+1}\;du\\ &=&\frac{1}{4}\operatorname{\Large\int}\dfrac{u}{u^2+1}\;du-\frac{3}{8}\arctan(u)+k\\ &=&\frac{1}{4}\operatorname{\Large\int}\dfrac{u}{u^2+1}\;du-\frac{3}{8}\operatorname{\Large\int}\dfrac{1}{u^2+1}\;du\\ &=&\frac{1}{4}\operatorname{\Large\int}\dfrac{u}{u^2+1}\;du-\frac{3}{8}\arctan(x+\frac{3}{2})+k\\ &=&\frac{1}{8}\operatorname{\Large\int}\dfrac{2udu}{u^2+1}-\frac{3}{8}\arctan(x+\frac{3}{2})+k,\\ &&\qquad {\rm{suppose}}\; v=u^2+1\Rightarrow dv=2udu\\ &=& \frac{1}{8}\operatorname{\Large\int}\dfrac{dv}{v}-\frac{3}{8}\arctan(x+\frac{3}{2})+k\\ &=& \frac{1}{8}\ln(v)-\frac{3}{8}\arctan(x+\frac{3}{2})+k\\ &=& \frac{1}{8}\ln(u^2+1)-\frac{3}{8}\arctan(x+\frac{3}{2})+k\\ &=& \frac{1}{8}\ln(x^2+3x+\frac{13}{4})-\frac{3}{8}\arctan(x+\frac{3}{2})+k\\ &=& \frac{1}{8}\ln\left(\frac{1}{4}(4x^2+12x+13)\right)-\frac{3}{8}\arctan(x+\frac{3}{2})+k\\ &=& \frac{1}{8}\ln(4x^2+12x+13)-\frac{3}{8}\arctan(x+\frac{3}{2})+\frac{1}{8}\ln(\frac{1}{4})+k\\ &=& \frac{1}{8}\ln(4x^2+12x+13)-\frac{3}{8}\arctan(x+\frac{3}{2})+c,\\ &&\qquad\text{where}\ c=\frac{1}{8}\ln(\frac{1}{4})+k.\ \qquad\bigstar \end{eqnarray*}


# Please do the computation in SageMath yourself!

5. Definite Integral

This computational tool calculates definite integrals of the form: \(\mathop{\int}\limits_{a}^{b}f(x)dx\) where \(f(x)\) is defined on the closed interval \([a,b]\). The tool requires two conditions:

  1. \(f(x)\) must be Riemann integrable on the interval \([a,b]\).
  2. The antiderivative of \(f(x)\), denoted by \(F(x)\), must satisfy the equation \(F'(x) = f(x)\) for all \(x\)-values within the interval.

If these conditions are not met, an "integral divergence error message" will appear.

To use the tool:

  1. Click the "Enable" button below to calculate a definite integral.
  2. Click the "Update" button to change the integration limits \(a\) and \(b\) using the provided boxes.
  3. Enter your desired function in the designated box.
  4. Specify the desired integration limits \(a\) and \(b\) in the corresponding boxes.

x=var('x') @interact def _(f = -2*sin(x)+x,a=-3,b=5,auto_update=False): q=integrate(f,x).canonicalize_radical() p=integrate(f,x,a,b) r=plot([f],x,a,b,gridlines='minor',\ legend_label='automatic',fill = true) r.show(figsize=4) pretty_print(html("The value of the integral:\ $$\\int\\limits_{%s}^{%s}\\left(%s\\right)\\,dx=\ \\left.%s\\right|_{%s}^{%s}=%s\ \\approx %s$$"%(latex(a),latex(b),latex(f),latex(q),\ latex(a),latex(b),latex(p),latex(n(p)))))

Geogebra can also be used to perform definite integral computations. Readers can then compare the results obtained with Geogebra to those produced by SageMath. ">


6. Non-Homogeneous System of Equations

To solve the non-homogeneous system of equations \(Ax=b\):

  • Click the "Enable" button.
  • Enter the respective values of \(A\) and \(b\) in the provided boxes.
  • Click the "Update" button to perform the computation.

You can convert the system to a homogeneous system of equations by setting \(b=0\). To demonstrate the role of pivots, try changing the value of \(a_{1,1}\) to \(0\). This will result in row swapping. Enjoy!

def SLE_as_latex(A, b, variables): nvars = A.ncols() pretty_print(html( r'$$\left\{\begin{array}{%s}'%latex('r'*(nvars+1))+ r'\\'.join('%s=&%s'%( (' & '.join((r'%s%s\cdot %s'%('+' if c>0 else '',c,v) if c else '') for c,v in zip(row, variables)) if not row.is_zero() else '&'*(nvars-1)+'0',y) ) for row,y in zip(A,b))+ r'\end{array}\right.$$')) def extended_matrix_as_latex(M): A = M[:,:-1] b = M.column(-1) nvars = A.ncols() pretty_print(html( r'$$\left(\begin{array}{%s}'%latex('r'*nvars+ '|r')+ r'\\'.join('%s&%s'%( ' & '.join('%s'%c for c in row) ,y) for row,y in zip(A,b))+ r'\end{array}\right)$$')) @interact def SEL(M_A='[(1,1,1,2),(-1,3,2,5),(1,-7,1,-2)]', M_b='[2,1,3]', auto_update=False ): %display latex A = matrix(eval(M_A)) b = vector(eval(M_b)) M = A.augment(b) neqs = len(b) nvars = A.ncols() var_names = ','.join('x%s'%j for j in [1..nvars]) ##### variables = var(var_names) pretty_print(html(r'Variables: $%s$'%latex(variables))) for row,y in zip(A,b): pretty_print(html(sum(c*v for c,v in zip(row, variables))==y)) SLE_as_latex(A, b, variables) pretty_print(html( 'We create an augmented matrix')) extended_matrix_as_latex(M) pivot = {} ibound_variables = [] for m,row in enumerate(A): for k in range(m,nvars): lista = [(abs(M[j,k]),j) for j in range(m,neqs)] maxi, c = max(lista) if maxi > 0: ibound_variables.append(k) if M[m,k]==0: M[c,:],M[m,:]=M[m,:],M[c,:] pretty_print( html('Swap rows: %d and %d'%(m+1,c+1))) extended_matrix_as_latex(M) pivot[m] = k break a=M[m,k] for n in range(m+1,neqs): if M[n,k]!=0: pretty_print(html("We add the elements of row %s multiplied by %d to row %d"%(m+1, -M[n,k]/a, n+1))) M=M.with_added_multiple_of_row(n,m,-M[n,k]/a) extended_matrix_as_latex(M) A = M[:,:-1] b = M.column(-1) SLE_as_latex(A, b, variables) SEL_type = 'compatible' null_rows = None for k,(row,y) in enumerate(zip(A,b)): if row.is_zero(): if y==0 and null_rows is None: null_rows = k break elif y!=0: SEL_type = 'incompatible' if SEL_type == 'incompatible': pretty_print(html('The system has no solution.')) return if null_rows: pretty_print(html('We eliminate the trivial equation 0=0.')) A = A[:null_rows,:] b = b[:null_rows] SLE_as_latex(A, b, variables) ifree_variables = [k for k in range(nvars) if k not in ibound_variables] bound_variables = [variables[k] for k in ibound_variables] free_variables = [variables[k] for k in ifree_variables] pretty_print(html('Free Variables: $%s$'%latex(free_variables))) pretty_print(html('Dependent variables: $%s$'%latex(bound_variables))) reduced_eqs = [ sum(c*v for c,v in zip(row, variables))==y for row,y in zip(A,b) ] xvector = vector(variables) if len(bound_variables)==1: soldict = solve(reduced_eqs, bound_variables[0], solution_dict=True)[0] else: soldict = solve(reduced_eqs, bound_variables, solution_dict=True)[0] pretty_print(html('Solution in terms of parameters')) parametric_sol = matrix( xvector.apply_map(lambda s:s.subs(soldict)) ).transpose() show(parametric_sol) pretty_print(html('Solution in vector form')) pretty_print(html( r'$$ %s + \left\langle %s\right\rangle$$'%( latex(parametric_sol.subs(dict(zip(free_variables, [0]*len(free_variables))))), ','.join(latex( parametric_sol.apply_map(lambda s:s.diff(v)) ) for v in free_variables) if free_variables else latex(matrix([0]*nvars).transpose())) )) pretty_print(html('Its dimension is %d'%len(free_variables)))

7. Cycloid Animation

Click the "Enable" button below to see the cycloid motion animation. Please try it!

#cycloid animation a = 0.2 v = [] t = var("t") for s in srange(0.01, 4.0*pi, a): sikloida = parametric_plot((t-sin(t),1-cos(t)), (t, 0, s),thickness=3) t_sikloida = (s-sin(s),1-cos(s)) lingkaran = circle((s,1),1,thickness=2,rgbcolor='green') lingkaran1 = circle((s,1),0.5,thickness=4,fill=True,edgecolor='red') titik = point(t_sikloida, pointsize=90, rgbcolor="brown") garis = line([(s, 1),t_sikloida], thickness=4,color="red") v.append(sikloida + lingkaran + lingkaran1 + titik + garis) a = animate(v, figsize=[7,2], aspect_ratio=1, xmin=0.5,xmax=20, ymin=0, ymax=2.2) show(a)

Cycloid Animation using Geogebra
>


8. Using Your Personal Computer in Math: Powerful Tools and Applications

Perform SageMath Computations Independently. Follow the commands provided below:

  1. Click "Evaluate" to see the results.
  2. Feel free to replace the commands with other SageMath commands that you are familiar with.
# Graphing cos(x) on the interval 0<= x <= 2*pi plot(cos(x), (x, 0, 2*pi))

Surface Area of a Revolved Solid Given a curve \(y=f(x)\) and \(x\in [a,b]\). If the object is bounded by \(f(x)\) and \(x=a, x=b\) and rotated about the \(x\)-axis, then the surface area of the revolved solid is \(A\) with \(dA=2\pi\ y\ ds\) so that we get: $$ A=2\pi\mathop{\int}\limits_{a}^{b}f(x)\sqrt{1+\left(f'(x)\right)^2}dx. $$ Example
Given the curve \(y=f(x)=x\) and \(x\in [-1,1]\). If the object is bounded by \(f(x)\) and \(x=-1, x=1\) and rotated about the \(x\)-axis, then the surface area of the revolved solid is \(A\) with \(dA=2\pi\ y\ ds\) so that we get: \[ A=2\pi\int_{-1}^{1}f(x)\sqrt{1+\left(f'(x)\right)^2}dx. \] Note: You can replace \(y=f(x)\) and the domain interval \([a,b]\) as desired!
The computational result is given in the SageMath cell as follows:


var('x y') y=(x) dy=diff(y,x) t = integrate(y*sqrt(1+dy^2),x) A = integrate(y*sqrt(1+dy^2),x,0,1) pretty_print(html("$f(x)=%s$"%latex(y))) pretty_print(html("$A=2\\pi\\int\\limits_{0}^{1}f(x)\ \\sqrt{1+f'(x)^2}\\ dx=\\left.\\left(%s\\right)\\right|_{0}^{1}$"\ %latex(t))) pretty_print(html("$\\ \\ \\ =%s$"%latex(A)))


The following SageMath cell can be used to practice drawing various types of functions, including implicit functions. For example: \(y^3-3x^2+2x+5 = 0,\ -4\leq x\leq 4,\ -4\leq y \leq 4\). About plotting, we recommend that our readers see more details at [plotting].


# Please use this SageMath Cell to draw other functions as you wish! var('x y') implicit_plot( y^3-3*x^2+2*x+5 == 0, (x,-4,4), (y,-4,4), color="red")

Let's give an example to calculate the value: $$ \int \sqrt{x}\;\sqrt{1+x}\;dx. $$ To get an exact result, we use the canonicalize_radical() command as follows:

%display latex x = var('x') f=sqrt(x)*sqrt(1+x) g=integrate(f, x).canonicalize_radical() pretty_print(html(r"$f(x) = %s$"%latex(f))) pretty_print(html(r"The value of $\int f(x)\; dx$ is : $$%s + c$$"%latex(g)))


Mathematical Applications

1. Simulation of Dynamical Systems

SageMath can be used to simulate dynamical systems, such as the predator-prey system or the Lotka-Volterra model. Here is an example of a simulation of a predator-prey system:


# Simulation of a predator-prey model import matplotlib.pyplot as plt import numpy as np # Parametric model a = 1.0 b = 0.2 c = 0.5 d = 0.1 # time simulation t = np.linspace(0, 100, 1000) # Model Solution x = np.zeros(len(t)) y = np.zeros(len(t)) x[0] = 10 y[0] = 5 dt = 0.01 # Simulation for i in range(1, len(t)): x[i] = x[i-1] + a*x[i-1]*dt - b*x[i-1]*y[i-1]*dt y[i] = y[i-1] - c*y[i-1]*dt + d*x[i-1]*y[i-1]*dt # Solution plot plt.plot(t, x, label="Prey") plt.plot(t, y, label="Predator") plt.legend() plt.title("Lotka-Volterra model simulation results:") plt.show()

Let's delve deeper into the Lotka-Volterra equations, previously mentioned. These equations, also known as the Lotka-Volterra predator-prey model, are a pair of first-order, nonlinear differential equations. They're frequently used to describe the dynamics of biological systems where two species interact: one as a predator and the other as prey. Population changes over time according to the following equation: \begin{eqnarray*} \frac{dx}{dt} &=& \alpha x - \beta xy\\ \frac{dy}{dt} &=& \delta xy - \gamma y \end{eqnarray*} where

  • the variable \(x\) represents the population density of the prey (e.g., the number of rabbits per square kilometer);
  • the variable \(y\) represents the population density of a predator (e.g., the number of foxes per square kilometer);
  • \(\frac{dx}{dt}\) and \(\frac{dy}{dt}\) represent the instantaneous rates of change of the two populations;
  • \(t\) represents time.
  • The prey model considers two factors affecting prey populations; \(\alpha\) represents the maximum rate at which prey can reproduce per individual \(\beta\), on the other hand, reflects the increased mortality rate of prey due to the presence of predators.
  • The predator model also relies on two key parameters, \(γ\) and \(δ\); \(γ\) represents the per capita death rate of the predator, while \(δ\) captures the impact of prey presence on the predator's growth rate.
  • All parameters are positive and real.

The solution to the differential equation is deterministic and continuous. This, in turn, implies that the generations of predators and prey continuously overlap.

The Lotka–Volterra equation system is an example of a Kolmogorov model, which is a more general framework that can model the dynamics of ecological systems with predator-prey interactions, competition, disease, and mutualism.

We simulate Lotka-Volterra Population Dynamics in a SageMath Cell. With the following code:

# Simulating Lotka-Volterra population dynamics, generating a vector field # Arrows indicate the direction of population evolution # Blue contours represent one potential stable loop var('t R F R0 F0 a b c d') # constant a = 0.04 # rabbit birth rate b = 0.0005 # predator probability per encounter c = 0.1*0.0005 # probability of predation per encounter, rabbit -> fox conversion efficiency d = 0.2 # fox death rate ## Kondisi awal R0 = 5000 #initial number of rabbits F0 = 200 #initial number of foxes ## Differentialial equation de_R = (diff(R,t) == a*R - b*R*F) de_F = (diff(F,t) == c*R*F - d*F) ## PARAMETER CALCULATION titik_akhir = 500 stepsize = 1.0 steps = titik_akhir/stepsize ics = [0,R0,F0] des = [de_R.rhs(), de_F.rhs()] ## NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS sol = desolve_system_rk4(des,[R,F],ics,ivar=t,end_points=titik_akhir,step=stepsize) sol_t=[]; sol_R=[]; sol_F=[] for i in srange(0,titik_akhir): sol_t.append(sol[i][0]) sol_R.append(sol[i][1]) sol_F.append(sol[i][2]) ## Figure of simulation results a = plot([],figsize=[6,4]) a += line(zip(sol_R,sol_F)) a += plot_vector_field((des[0], des[1]), (R,0,7000), (F,0,225),xmin=1500,color='orange') a.axes_labels(['Rabbit','Fox']); show(a)

2. Solving Differential Equations

SageMath can be used to model differential equations, both ordinary differential equations (ODEs) and partial differential equations (PDEs): Here is an example of modeling an ODE and solving it exactly if there is a solution.

Now, let's consider the following ODE (Ordinary Differential Equation): $$ \frac{dy}{dx} + y - 1 = 0, $$ We'll solve it in a SageMath cell as shown below


%display latex x = var('x') y = function('y')(x) pdb = diff(y,x) + y - 1 solpdb = desolve(diff(y,x) + y - 1, y) pretty_print(html(r"The solution to the ODE: $%s = 0$ is: $y(x) = %s$ "%(latex(pdb),latex(solpdb))))

The following is a second-order linear ODE: $$ \frac{d^2 y}{dx^2}+2\frac{dy}{dx} + y -\cos(x)=0,\ y(0)=3,\ y^{\prime}(0)=1. $$ Here's the solution code in a SageMath cell:


%display latex x = var('x') y = function('y')(x) pdb = diff(y,x,2)+2*diff(y,x)+y - cos(x) solpdb = desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,1]) pretty_print(html(r"The solution to the ODE: $%s = 0,\ y(0)=3, y'(0)=1$ is: $y(x) = %s.$ "%(latex(pdb),latex(solpdb)))) </script



Next, we consider a higher-order linear ODE, in this case: $$ -2 \, x^{4} + x^{3} \frac{d^{3}}{(d x)^{3}}y\left(x\right) + x^{2} \frac{d^{2}}{(d x)^{2}}y\left(x\right) - 2 \, x \frac{d}{d x}y\left(x\right) + 2 \, y\left(x\right) = 0. $$ The solution is given in a SageMath cell using sympy as follows:


from sympy import Function, dsolve, Derivative from sympy.abc import x from sympy.interactive.printing import init_printing init_printing(use_unicode=False, wrap_line=False) from sympy import * y = Function('y') # Selesaikan ODE p = x^3*Derivative(y(x), x,x,x) + x^2*Derivative(y(x),x,x)-2*x*Derivative(y(x),x) + 2*y(x)-2*x^4 hasil = dsolve(p, y(x)) print("Higher-order ODE forms:") display(p) print("ODE solution:") display(hasil) </script

3. Fitting Data to a Mathematical Model

SageMath can be used to fit data to a mathematical model. Here is an example of fitting data to a linear regression model:


import numpy as np import matplotlib.pyplot as plt # Data x = np.array([1, 2, 3, 4, 5]) y = np.array([5, 2, 6, 7, 10]) # Third degree polynomial linear regression model a, b, c, d = np.polyfit(x, y, 3) # Plot data and models plt.plot(x, y, 'o') plt.plot(x, a*x**3 + b*x**2+c*x+d) plt.show()

4. Optimization

SageMath can be used to solve optimization problems, such as finding the maximum or minimum value of a function. Here is an example of finding the maximum value of the function \(f(x) = x^2 - 4x + 3\):


import sympy # function f = sympy.Function('f') f(x) = x^2 - 4*x + 3 # Finding the maximum value x = sympy.Symbol('x') max_x = sympy.solve(f(x).diff(x) == 0, x) # Calculating the maximum value max_value = f(max_x[0]) print("The maximum value of f(x) is", max_value, "for x = ", max_x[0])

5. Mathematical Visualization

SageMath can be used to visualize mathematical objects, such as curves, surfaces, and graphs. Here is an example of visualizing a curve:


from sympy import symbols from sympy.plotting import plot, plot3d, PlotGrid x, y = symbols('x, y') p1 = plot((x**2, (x, -6, 6)), (x, (x, -5, 5))) p2 = plot(x**3, (x, -5, 5)) p3 = plot3d(x*y, (x, -5, 5), (y, -5, 5)) PlotGrid(1, 3, p1, p2, p3)

6. Analyzing a Matrix

A square matrix is provided. We will analyze its behavior in a SageMath cell as follows:


A = matrix([[6,-2,-1],[-2,6,-1],[-1,-1,5]]) p = charpoly(A,"lambda") h = A.eigenvectors_right() v1 = h[0][1][0] v2 = h[1][1][0] v3 = h[2][1][0] P = matrix([v1,v2,v3]) G,B = P.gram_schmidt() u1 = G.row(0) u2 = G.row(1) u3 = G.row(2) p1 = u1/norm(u1) p2 = u2/norm(u2) p3 = u3/norm(u3) P = transpose(matrix([p1,p2,p3])) D = transpose(P)*A*P a1 = (p1.column())*transpose(p1.column()) a2 = (p2.column())*transpose(p2.column()) a3 = (p3.column())*transpose(p3.column()) x = matrix([[1],[2],[3]]) a1x = a1*x pretty_print(html(r"Given a symmetric matrix $A=%s$"%latex(A))) pretty_print(html(r"Characteristic polynomial of the matrix $A$: $p(\lambda)=%s=%s$"%(latex(p),latex(factor(p))))) pretty_print(html(r"The eigenvalues are obtained: :$\lambda_1=%s,\ \lambda_2=%s$ and $\lambda_3=%s$, always real (because $A$ is symmetric)."%(h[0][0],h[1][0],h[2][0]))) pretty_print(html(r"The eigenvectors corresponding to the eigenvalues: $\mathbf{v_1}=%s,\ \mathbf{v_2}=%s$ and $\mathbf{v_3}=%s$"%(latex(v1.column()),latex(v2.column()),latex(v3.column())))) pretty_print(html(r"and $\langle\mathbf{v_1,v_2}\rangle=%s,\ \langle\mathbf{v_1,v_3}\rangle=%s,\ \langle\mathbf{v_2,v_3}\rangle=%s$, always orthogonal (because $A$ is symmetric)."%(v1.dot_product(v2),v1.dot_product(v3),v2.dot_product(v3)))) pretty_print(html(r"The normalized vectors $\mathbf{v_1,v_2,v_3}$ are obtained: $\mathbf{u_1}=%s, \mathbf{u_2}=%s, \mathbf{u_3}=%s$"%(latex(p1.column()),latex(p2.column()),latex(p3.column())))) pretty_print(html(r"and an orthogonal matrix $P=[\mathbf{u_1\ u_2\ u_3}]=%s$"%latex(P))) pretty_print(html(r"Therefore, $A$ can be diagonalized as follows: \begin{eqnarray*}P'AP &=& %s%s%s\\ &=& %s\end{eqnarray*}"%(latex(transpose(P)),latex(A),latex(P),latex(D)))) pretty_print(html(r"The vectors $\pmb{u}_1, \pmb{u}_2$ dan $\pmb{u}_3$ related to each eigenvalue satisfy: $8\mathbf{u_1u_1'}+6\mathbf{u_2u_2'}+3\mathbf{u_3u_3'}=%s=A$"%latex(8*a1+6*a2+3*a3))) pretty_print(html(r"Given a vector $\pmb{x} = %s$, it can be shown that the projection of $\pmb{x}$ onto $\langle\pmb{u}_1\rangle$ is $(\pmb{u}_1 \pmb{u}_1')\pmb{x}$ as follows:"%latex(x))) pretty_print(html(r"$(\pmb{u}_1\pmb{u}_1')\pmb{x} = %s %s = %s$"%(latex(a1),latex(x),latex(a1x)))) pretty_print(html(r"The projection of $\pmb{x}$ onto $\langle\pmb{u}_1\rangle$ is given by $(\langle\pmb{x},\pmb{u}_1\rangle/\langle\pmb{u}_1,\pmb{u}_1\rangle)\pmb{u}_1$:")) pretty_print(html(r"that is: $(\langle\pmb{x},\pmb{u}_1\rangle/\langle\pmb{u}_1,\pmb{u}_1\rangle)\pmb{u}_1 = \left\{\begin{pmatrix}1 & 2 & 3\end{pmatrix}\begin{pmatrix}-\frac{1}{\sqrt{2}}\cr \frac{1}{\sqrt{2}}\cr 0\end{pmatrix}\right\}\begin{pmatrix}-\frac{1}{\sqrt{2}}\cr \frac{1}{\sqrt{2}}\cr 0\end{pmatrix}=\begin{pmatrix}-\frac{1}{2}\cr \frac{1}{2}\cr 0\end{pmatrix}$"))

7. Animation Simulation of Taylor Series Expansion

We provide the Taylor Series Expansion of the function: $$ f(x) = e^{-x}\sin(x). $$ Please click the Enable box and move the slider to the desired order.


x = SR.var('x') x0 = 0 f = sin(x) * e^(-x) v = [] @interact def _(order=slider([1 .. 12])): p = plot(f, -1, 5, thickness=2) dot = point((x0, f(x=x0)), pointsize=80, rgbcolor=(1, 0, 0)) ft = f.taylor(x, x0, order) pt = plot(ft, -1, 5, color='green', thickness=2) pretty_print(html(r'$f(x)\;=\;%s$' % latex(f))) pretty_print(html(r'$\hat{f}(x;%s)\;=\;%s+\mathcal{O}(x^{%s})$' % (x0, latex(ft), order+1))) v.append(dot + p + pt) a = animate(v, figsize=[7,3], xmin=0,xmax=8, ymin=-1, ymax=3) show(a)

8. Numerical and exact values of an integral

To calculate the integral $$ \int_{0}^{\infty}e^{-x^2} dx $$ we need the SciPy module scipy.integrate, which contains several integration routines such as the Trapezoidal and Simpson's Rules. The workhorse for numerical integration in Python is the quad function (for quadrature, the traditional term for numerical integration). The quad function itself is not a single method but a collection of routines that work together to achieve an accurate answer efficiently. The algorithm behind quad was originally written in Fortran in a package called QUADPACK. Here is the basic syntax for the quad function:


import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integrate f = lambda x: np.exp(-x**2) integral, error = integrate.quad(f, 0, np.inf) print("The numerical result of the integral is: ",integral) print("The error value is: ",error)

Next, we calculate the exact value of $$ \int_{0}^{\infty}e^{-x^2} dx $$ as well as its numerical value using SageMath as follows:


ni = integral(exp(-x**2),(x, 0, oo)) ne = ni.n() pretty_print(html(r"The value of the integral: $$\int_{0}^{\infty}e^{-x^2} dx = %s\ \approx %s.$$"%(latex(ni),latex(ne))))

9. Taylor Series

Compute and plot the partial sum of the Taylor series for: $$ \ln(1 + x) $$ At what value of \(x\) does the Taylor series converge?

Recall that the Taylor series for a continuous differentiable function \(f\) expanded about \(x = 0\) (also known as the Maclaurin series) is given by: \begin{equation} f(x) = f(0) + f'(0)x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!} x^3 + \cdots = \sum_{n=0}^{\infty}\frac{f^{(n)}}{n!}x^n. \tag{1} \end{equation} For the given function, we obtain: $$ \ln(1 + x) = \sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}x^n.\tag{2} $$ Plotting the graph of \(y=\ln(1 + x)\) together with the partial sums of the Taylor series up to the term \(x^{20}\) is given in the SageMath cell below. Because of the large number of lines, it may be helpful to start plotting only the partial sums up to the \(5\)th and so on. The first few partial sums do not tell you much more than the fact that they are poor approximations.

Systematically coloring the different curves can also be helpful. In our plot, we gradually adjust the values of (r, g, b) to make the curves 'bluer' as the number of terms increases (i.e., by increasing the value of b from 0 to 1 and keeping r = g = 0).
The (r, g, b) values are the red, green, and blue components of the color, respectively. By increasing the value of b from \(0\) to \(1\), we are making the curves bluer. Keeping \(r = g = 0\) means that the curves will have no red or green components.

From the graph (and further experimentation with the number of terms in the partial sum), we can make the following observations:
The Taylor series for \(\ln(1+x)\) appears to converge to \(\ln(1+x)\) for \(x\in(−1,1)\), possibly also at \(x=1\). However, for \(x > 1\), the graphs with a large number of terms \(n\) show divergence (i.e., the \(y\) values become very large around \(x=1\) from the right).

Explanation:
The Taylor series for \(\ln(1+x)\) is given by: $$ \ln(1 + x) = \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n $$ This series converges for all values of \(x\) in the interval \((−1,1]\). However, it diverges for all values of \(x\) outside of this interval.
The graphs in the SageMath cell above show the partial sums of the Taylor series for \(\ln(1+x)\) up to the term-\(x^{20}\). As you can see, the partial sums converge to \(\ln(1+x)\) for \(x\in(−1,1)\). However, they diverge for \(x > 1\).
This is because the Taylor series for \(\ln(1+x)\) is an alternating series. Alternating series are known to converge if the terms decrease in absolute value and approach zero. However, the terms of the Taylor series for \(\ln(1+x)\) do not decrease in absolute value for \(x > 1\). This is why the series diverges for \(x > 1\).
Conclusion:
The Taylor series for \(\ln(1+x)\) converges to \(\ln(1+x)\) for \(x\in(−1,1]\). However, it diverges for \(x > 1\).


import matplotlib.pyplot as plt import numpy as np def ln(x): return sum((-1)**(n+1)/n * x**n for n in range(1, 21)) x = np.linspace(-1, 1, 1000) for n in range(5, 21): y = [sum((-1)**(k+1)/k * xi**k for k in range(1, n+1)) for xi in x] # Set the color of the curve if n == 5: color = (0, 0, 0) elif n == 10: color = (0, 0, 0.25) elif n == 15: color = (0, 0, 0.5) elif n == 20: color = (0, 0, 0.75) else: color = (0, 0, 1) plt.plot(x, y, color=color, label="Partial sum to $x^{%d}$" % n) plt.legend() plt.show()

We perform computations with SageMath to determine the Taylor series of the previously discussed function as follows:


%display latex f = log(x+1) g = f.taylor(x, 0,20) pretty_print(html(r"Taylor series of $y=\ln(1+x)$ is : $$%s$$"%latex(g)))

Next, we show the graph of the function \(f(x) = \ln(x+1)\) and the graph of \(g(x)\) which is the result of the Taylor series of \(f(x)\):


%display latex f = log(x+1) g = f.taylor(x, 0,20) p1 = plot(log(x+1), (x, -0.1, 1),color='red',legend_label=r'$f(x)=\log(x+1)$', legend_color='red') p2 = plot(g, (x, -0.1, 1),color='green', legend_label=r'$g(x)$', legend_color='green') (p1 + p2).show(frame=True, axes=False, aspect_ratio=0.75)

10. Plotting 3D surfaces in SageMath

SageMath has a great ability to display a surface in 3D. This is very useful for analyzing the behavior of 3D surfaces, especially those related to Differential Geometry. To see the image from different angles, click the left cursor and move it!

1. Cylinder
u, v = var('u', 'v', domain='real') formula = (cos(u), sin(u), v) parameters = ((u, -pi, pi), (v, -5, 5)) surface = ParametrizedSurface3D(formula, parameters) show(surface.plot(aspect_ratio=1, color='lightblue'),viewer='threejs')

2. Paraboloid
u, v = var('u', 'v', domain='real') formula = (u, v, u^2+v^2) parameters = ((u, -2, 2), (v, -2, 2)) surface = ParametrizedSurface3D(formula, parameters) show(surface.plot(aspect_ratio=1, color='lightblue'),viewer='threejs')

3. Sphere
t, theta = var('t, theta', domain='real') x(t) = cos(t) z(t) = sin(t) formula = (x(t)*cos(theta), x(t)*sin(theta), z(t)) parameters = ((t, -pi/2, pi/2), (theta, -pi, pi)) surface = ParametrizedSurface3D(formula, parameters) show(surface.plot(aspect_ratio=1, color='lightgrey'),viewer='threejs')

4. Catenoid
t, theta = var('t, theta', domain='real') x(t) = cosh(t) z(t) = t formula = (x(t)*cos(theta), x(t)*sin(theta), z(t)) parameters = ((t, -3, 3), (theta, -pi, pi)) surface = ParametrizedSurface3D(formula, parameters) show(surface.plot(aspect_ratio=1, color='yellow'),viewer='threejs')

5. Helicoid
u, v = var('u', 'v', domain='real') formula = (u*cos(v), u*sin(v), v) parameters = ((u, -5, 5), (v, -5, 5)) surface = ParametrizedSurface3D(formula, parameters) show(surface.plot(aspect_ratio=1, color='yellow'),viewer='threejs') show(surface.shape_operator())

6. Enneper surface
u, v = var('u', 'v', domain='real') formula = (u - u^3/3 + u*v^2, v - v^3/3 + v*u^2, u^2 - v^2) parameters = ((u, -3, 3), (v, -3, 3)) surface = ParametrizedSurface3D(formula, parameters) show(surface.plot(aspect_ratio=1, color='orange'),viewer='threejs')

7. 600-cells polytope

These are two different Schlegel projections. The first is projected onto an icosahedron. The SageMath code is below the diagram.

show(polytopes.six_hundred_cell() .plot(color='grey', projection_direction=[1,1,1,1], radius=0.01, frame=False), viewer='threejs', online=True)

show(polytopes.six_hundred_cell() .plot(color='blue', radius=0.01, frame=False), viewer='threejs', online=True)

11. Data Fitting with SageMath

A common situation in science and engineering: you have collected a bunch of data and you want to fit a function to it. SageMath trivializes this procedure.
First, we will create some data that has some inherent variance using list comprehension and the normalvariate() function and store it in the array data; then we will propose a model with some adjustable parameters, and find the parameter values that fit best. Finally, we will plug those parameter values back into the model and plot it alongside the data.


# for this example, we first create some data with built-in variance: data = [(i, 1.2 * sin(0.5*i-0.2) + 0.1 * normalvariate(0, 1)) for i in xsrange(0, 4*pi, 0.2)] # design a model with parameters a,b,c that can be adjusted and describe the data var('a, b, c, x') model(x) = a * sin(b * x - c) # calculate the parameter values that best fit the model and data sol = find_fit(data,model) show(sol) # determine f(x), a model with parameters set to appropriate values f(x) = model(a=sol[0].rhs(),b=sol[1].rhs(),c=sol[2].rhs()) # creates an empty plot object a = plot([]) # Add a plot of the model, against x from -0.5 to 12.5 a += plot(f(x),x,[-0.5,12.5]) # add data plot, colored red a += list_plot(data,color='red') show(a)

9. Cayley graph of an Abelian group using SageMath

A natural source of graphs, known as Cayley graphs, In mathematics, a Cayley graph, also known as a Cayley color graph, Cayley diagram, group diagram, or color group, is a graph that encodes the abstract structure of a group. Its definition is suggested by Cayley's theorem (named after Arthur Cayley), and uses a specified set of generators for the group. It is a central tool in combinatorial and geometric group theory. The structure and symmetry of Cayley graphs makes them particularly good candidates for constructing expander graphs. [Source] comes from group theory. Representation theory Representation theory is a branch of mathematics that studies abstract algebraic structures by representing their elements as linear transformations of vector spaces, and studies modules over these abstract algebraic structures. In essence, a representation makes an abstract algebraic object more concrete by describing its elements by matrices and their algebraic operations (for example, matrix addition, matrix multiplication). The theory of matrices and linear operators is well-understood, so representations of more abstract objects in terms of familiar linear algebra objects helps glean properties and sometimes simplify calculations on more abstract theories. [Source] motivates us to analyze the eigenvalues of Cayley graphs at least for Abelian groups.

Definition
Let \(G\) be a finite group. In abstract algebra, a finite group is a group whose underlying set is finite. Finite groups often arise when considering symmetry of mathematical or physical objects, when those objects admit just a finite number of structure-preserving transformations. Important examples of finite groups include cyclic groups and permutation groups. The study of finite groups has been an integral part of group theory since it arose in the 19th century. One major area of study has been classification: the classification of finite simple groups (those with no nontrivial normal subgroup) was completed in 2004. [Source] A symmetric subset of \(G\) is a subset \(S\subseteq G\) that satisfies the following conditions:

  1. The identity element \(1\) is not in \(S\).
  2. If \(s\) is in \(S\), then the inverse \(s^{-1}\) is also in \(S\).

If \(S\) is a symmetric subset of \(G\), then the graph of \(G\) associated with \(S\) is the graph with vertex set \(G\) and with an edge \(\{g,h\}\) connecting \(g\) to \(h\) if and only if \(gh^{-1}\in S\) or equivalently \(hg^{-1}\in S\).
In other words, the graph of \(G\) associated with \(S\) is the graph that has a vertex for each element of \(G\) and an edge between two vertices \(g\) and \(h\) if and only if \(gh^{-1}\in S\) or \(hg^{-1}\in S\).

This graph is called the Cayley graph of G with respect to \(S\). It is a useful tool for studying the properties of \(G\). For example, the diameter of the Cayley graph is equal to the length of the longest word in \(G\).

Note: In the definition, \(S\) can be the empty set. In this case, the Cayley graph has no edges. Also, as is known, any finite group \(G\) is isomorphic to a permutation group \(G_p\). Therefore, to determine the graph of a group \(G\), we do it through the permutation group In mathematics, a permutation group is a group \(G\) whose elements are permutations of a given set \(M\) and whose group operation is the composition of permutations in \(G\) (which are thought of as bijective functions from the set \(M\) to itself). The group of all permutations of a set \(M\) is the symmetric group of \(M\), often written as Sym(\(M\)). The term permutation group thus means a subgroup of the symmetric group. If \(M = \{1, 2,\ldots, n\}\) then Sym(\(M\)) is usually denoted by \(S_n\), and may be called the symmetric group on \(n\) letters. By Cayley's theorem, every group is isomorphic to some permutation group. The way in which the elements of a permutation group permute the elements of the set is called its group action. Group actions have applications in the study of symmetries, combinatorics and many other branches of mathematics, physics and chemistry. [Source] \(G_p\).

We can verify that the Cayley graph is connected (every two vertices are connected by a path) if and only if \(S\) generates \(G\).

Example
Let \(G=\mathbb{Z}/ 4\mathbb{Z}\) and \(S=\{\pm [1]_4\}\). To obtain the Cayley graph associated with \(S\); in SageMath cell, do the following:
1. Create the Abelian group \(G=\mathbb{Z}/ 4\mathbb{Z}\).
2. Construct the permutation group \(G_p\) from the Abelian group \(G\).
3. Determine the generators of the group \(G_p\).
​4. From the available generators, create the symmetric set \(S\).
5. Associated with the group \(G_p\), create the adjacency matrix \(A\) with the generator \(S\).
6. From the adjacency matrix \(A\), create the Cayley graph.


G = AdditiveAbelianGroup([4]) G1 = Set(G.list()) Gp = G.permutation_group() Gp1 = Set(Gp.list()) g0= Gp.gens() g1=g0[0] S=[g1,g1^-1] S1=set(S) A = Gp.cayley_graph(generators=S,simple=True).adjacency_matrix() Gamma = Graph(A) pretty_print(html(r" $G = \{%s\}$"%G1)) pretty_print(html(r" $G_p = \{%s\}$"%Gp1)) pretty_print(html(r"A generator of group $G_p$ is: $%s$"%g0[0])) pretty_print(html(r"Simmetric set: $S = \{%s\}$"%S1)) pretty_print(html(r"Adjacency matrix $A=%s$"%latex(A))) pretty_print(html(r"Graph $\Gamma$ of adjacency matrix $A$ :")) Gamma.show(layout="circular",dpi = 60)

The SageMath commands for generating a Cayley graph can be a bit tricky. We want to make sure to select the "simple" option and to choose a symmetric generating set, as shown in the two examples below of Cayley graphs of the Abelian group \(\mathbb{Z}/6\mathbb{Z}\) for the symmetric sets \(S_1=\{\pm 1,\pm 2\}\) and \(S_2=\{\pm 1,\pm 3\}\):


G = AdditiveAbelianGroup([6]) G1 = Set(G.list()) Gp = G.permutation_group() Gp1 = Set(Gp.list()) g1,g2 = Gp.gens() S1=[g1*g2,(g1*g2)^-1,(g1*g2)^2,(g1*g2)^-2] A1 = Gp.cayley_graph(generators=S1,simple=True).adjacency_matrix() Gamma1 = Graph(A1) pretty_print(html(r" $G = \{%s\}$"%G1)) pretty_print(html(r" $G_p = \{%s\}$"%Gp1)) pretty_print(html(r"Simmetric set $S_1 = \{%s\}$"%set(S1))) pretty_print(html(r"Adjacency matrix $A_1 = %s$"%latex(A1))) pretty_print(html(r"Graph $\Gamma_1$ of Adjancency matrix $A_1$ :")) Gamma1.show(layout="circular", dpi = 60)

G = AdditiveAbelianGroup([6]) G1 = Set(G.list()) Gp = G.permutation_group() Gp1 = Set(Gp.list()) g1,g2 = Gp.gens() S2=[g1*g2,(g1*g2)^-1,(g1*g2)^3,(g1*g2)^-3] A2 = Gp.cayley_graph(generators=S2,simple=True).adjacency_matrix() Gamma2 = Graph(A2) pretty_print(html(r" $G = \{%s\}$"%G1)) pretty_print(html(r" $G_p = \{%s\}$"%Gp1)) pretty_print(html(r"Simmetric set $S_2 = \{%s\}$"%set(S2))) pretty_print(html(r"Adjacency matrix $A_2 = %s$"%latex(A2))) pretty_print(html(r"Graph $\Gamma_2$ of adjancency matrix $A_2$ :")) Gamma2.show(layout="circular", dpi = 60)

Next, we discuss the Cayley graph \(\Gamma\) of \(\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z}\), with the generator set \(S=\{±(0,1),±(1,0),±(1,1)\}\). We implement this in SageMath as follows:

Here is the SageMath code that implements the Cayley graph \(\Gamma\):

G = AdditiveAbelianGroup([4,4]) G1 = Set(G.list()) GP = G.permutation_group() GP1 = Set(GP.list()) g0 = GP.gens()[0] g1 = GP.gens()[1] S = [g0,g1, g0^(-1), g1^(-1),(g0*g1)^(-1),g0*g1] s1 = Set(S) Gamma = GP.cayley_graph(side='left', generators = S) A = Gamma.adjacency_matrix() Gamma1 = Graph(A, format = "adjacency_matrix") Gam = Gamma1.show(layout="circular", dpi = 70) pretty_print(html(r"The Cayley graph $\Gamma$ of group $\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z}$ generated by $S$")) Gam pretty_print(html(r"$S = \{%s\}$"%s1)) pretty_print(html(r"$\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z} = \{%s\}$"%G1)) pretty_print(html(r"It should be noted here that:: $\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z}\cong G_p =$ $\{%s\}$"%GP1))

The following shows the Cayley graph of the group \(\mathbb{Z}/24\mathbb{Z}\) with the symmetry set \(S=\{[8]_{24},[16]_{24},[3]_{24},[21]_{24}\}\).


G = AdditiveAbelianGroup([24]) Gp = G.permutation_group() g1,g2 = Gp.gens() S2 = [g1,g1^-1,g2,g2^-1] A2 = Gp.cayley_graph(generators=S2,simple=True).adjacency_matrix() Gamma2 = Graph(A2) pretty_print(html(r"Adjacency matrix $A_2 = %s$"%latex(A2))) pretty_print(html(r"Graph $\Gamma$ of the adjacency_matrix $A_2$ :")) Gamma2.show(layout="circular", dpi = 60)

The following shows the Cayley graph of the group \(\mathbb{Z}/24\mathbb{Z}\) with the symmetry set $$ S_1=\{\pm [2]_{24},\pm [4]_{24},\pm [6]_{24},\pm [8]_{24},\pm [10]_{24}\}. $$


G = AdditiveAbelianGroup([24]) Gp = G.permutation_group() g1,g2 = Gp.gens() S1 = [(g1*g2)^2,(g1*g2)^-2,(g1*g2)^4,(g1*g2)^-4,(g1*g2)^6,(g1*g2)^-6,\ (g1*g2)^8,(g1*g2)^-8,(g1*g2)^10,(g1*g2)^-10] A1 = Gp.cayley_graph(generators=S1,simple=True).adjacency_matrix() Gamma1 = Graph(A1) p1=Gamma1.characteristic_polynomial().factor() pretty_print(html(r"Adjacency matrix $A_1 = %s$"%latex(A1))) pretty_print(html(r"The characteristic polynomial of the graph $\Gamma_1 = %s$"%latex(p1))) pretty_print(html(r"Graph $\Gamma_1$ of the adjacency matrix $A_1$ :")) Gamma1.show(layout="circular", dpi = 70)

The following shows the Cayley graph of the group \(\mathbb{Z}/24\mathbb{Z}\) with the symmetry set $$ S_2=\{\pm [2]_{24},\pm [4]_{24},\pm [6]_{24},\pm [8]_{24},\pm [10]_{24},\pm [12]_{24}\}. $$


G = AdditiveAbelianGroup([24]) Gp = G.permutation_group() g1,g2 = Gp.gens() S2 = [(g1*g2)^2,(g1*g2)^-2,(g1*g2)^4,(g1*g2)^-4,(g1*g2)^6,(g1*g2)^-6,\ (g1*g2)^8,(g1*g2)^-8,(g1*g2)^10,(g1*g2)^-10,(g1*g2)^12,(g1*g2)^-12] A2 = Gp.cayley_graph(generators=S2,simple=True).adjacency_matrix() Gamma2 = Graph(A2) p2=Gamma2.characteristic_polynomial().factor() pretty_print(html(r"Adjacency matrix $A_2 = %s$"%latex(A2))) pretty_print(html(r"The characteristic polynomial of the graph $\Gamma_2 = %s$"%latex(p2))) pretty_print(html(r"Graph $\Gamma_2$ of the adjacency matrix $A_2$ :")) Gamma2.show(layout="circular", dpi = 70)

At first glance, graphs \(\Gamma_1\) and \(\Gamma_2\) appear to be the same. However, they are actually different, as evidenced by their distinct characteristic polynomials. Furthermore, it can be demonstrated that graphs \(\Gamma_1\) and \(\Gamma_2\) are not isomorphic, and thus \(\Gamma_1\) and \(\Gamma_2\) are indeed different. We will show this as follows:


G = AdditiveAbelianGroup([24]) Gp = G.permutation_group() g1,g2 = Gp.gens() S1 = [(g1*g2)^2,(g1*g2)^-2,(g1*g2)^4,(g1*g2)^-4,(g1*g2)^6,(g1*g2)^-6,\ (g1*g2)^8,(g1*g2)^-8,(g1*g2)^10,(g1*g2)^-10] S2 = [(g1*g2)^2,(g1*g2)^-2,(g1*g2)^4,(g1*g2)^-4,(g1*g2)^6,(g1*g2)^-6,\ (g1*g2)^8,(g1*g2)^-8,(g1*g2)^10,(g1*g2)^-10,(g1*g2)^12,(g1*g2)^-12] S1 = [(g1*g2)^2,(g1*g2)^-2,(g1*g2)^4,(g1*g2)^-4,(g1*g2)^6,(g1*g2)^-6,\ (g1*g2)^8,(g1*g2)^-8,(g1*g2)^10,(g1*g2)^-10] A1 = Gp.cayley_graph(generators=S1,simple=True).adjacency_matrix() Gamma1 = Graph(A1) A2 = Gp.cayley_graph(generators=S2,simple=True).adjacency_matrix() Gamma2 = Graph(A2) a = Gamma1.is_isomorphic(Gamma2) pretty_print(html(r"Are $\Gamma_1$ and $\Gamma_2$ isomorphic? $%s$"%latex(a)))

To get complete information about a graph in SageMath Cell, use the command Graph?.


Graph?

Before we conclude our discussion of Cayley graphs, let us introduce a different topic from before: Cayley graphs generated from a non-commutative group. For example, if G is a group and \(C\subseteq G\) (i.e., a list of some elements of \(G\)), then we can generate the Cayley graph \(X(G,C)\) as follows:


G = DihedralGroup(5) C = [G.gen(0), G.gen(1)] CG = G.cayley_graph( generators = C) CG.show(dpi = 80)

The output is a directed graph, even if \(C\) is closed under inversion; in the latter case we can turn \(G\) into a graph as follows:


G = DihedralGroup(5) C = [G.gen(0), G.gen(1)] CG = G.cayley_graph( generators = C) CGU = CG.to_undirected() CGU.show(dpi = 80)

Note that C is not required to construct G. There are a number of keywords for this command (e.g., side and simple).

Also, note that the command _Graph() makes it easy to create your own Cayley graphs. For example, the cube-like graph is the Cayley graph for \(GF(2)^d\). We can construct it using the command _Graph(). In the following example, _vector_list_ is a list of \(01\)-vectors of length \(d\).


def cubelike(d, vector_list): VS = VectorSpace(GF(2),d) vxs = range(2^d) return Graph([vxs, lambda i,j: VS[i]-VS[j] in vector_list]) V = GF(2)^5 vl = [V([0,1,1,0,0]), V([1,1,0,1,1]), V([1,0,0,0,1])] T = cubelike(5, vl) show(T, layout='circular')

For a general group, we can use the following construction to create an undirected Cayley graph.

G = DihedralGroup(6) C = [G.gen(0), G.gen(0)^-1, G.gen(1), G.gen(1)^-1] CG = Graph( [ G.list(), lambda g, h: h*g^(-1) in C]) CG.show()

We can also use a free group In mathematics, the free group \(F_S\) over a given set \(S\) consists of all words that can be built from members of \(S\), considering two words to be different unless their equality follows from the group axioms (e.g. \(st = suu^{-1}t\) but \(s\neq t^{-1}\) for \(s,t,u\in S\)). The members of \(S\) are called generators of \(F_S\), and the number of generators is the rank of the free group. An arbitrary group \(G\) is called free if it is isomorphic to \(F_S\) for some subset \(S\) of \(G\), that is, if there is a subset \(S\) of \(G\) such that every element of \(G\) can be written in exactly one way as a product of finitely many elements of \(S\) and their inverses (disregarding trivial variations such as \(st = suu^{-1}t\)). [Source] \(G\) generated by elements through a set of relations to construct a Cayley graph. Here is an example:



We will next illustrate the concept of a total graph The total graph \(T = T(G)\) of a graph G is a graph such that (i) the vertex set of \(T\) corresponds to the vertices and edges of \(G\) and (ii) two vertices are adjacent in \(T\) if and only if their corresponding elements are either adjacent or incident in \(G\). [Source] for a ring. Here's an example for the ring of integers modulo \(R\), along with the corresponding SageMath code.


# Importing required libraries from sage.graphs.graph import Graph n = 4 # you can change the value of integer n > 1 # Define the ring Z_n R = Integers(n) # Get the elements of the ring elements = list(R) # Create the total graph total_graph = Graph() # Add vertices to the graph total_graph.add_vertices(elements) # Add edges between all pairs of vertices for i in range(len(elements)): for j in range(i + 1, len(elements)): total_graph.add_edge(elements[i], elements[j]) # Plot the total graph total_graph.show(layout='circular')

10. SAGEMATH CELL FOR PRACTICE!

We provide ten SageMath Cells that you can use as practice to verify mathematical theories learned in lectures!


# This Sagemath cell is provided for practice! 0+1

# This Sagemath cell is provided for practice! 1+2

# This Sagemath cell is provided for practice! 1+2+3

# This Sagemath cell is provided for practice! 1+2+3+4

# This Sagemath cell is provided for practice! 1+2+3+4+5

# This Sagemath cell is provided for practice! 1+2+3+4+5+6

# This Sagemath cell is provided for practice! 1+2+3+4+5+6+7

# This Sagemath cell is provided for practice! 1+2+3+4+5+6+7+8

# This Sagemath cell is provided for practice! 1+2+3+4+5+6+7+8+9

# This Sagemath cell is provided for practice! 1+2+3+4+5+6+7+8+9+10

11. JupyterLab and Jupyter Notebooks


JupyterLab is a next-generation web-based user interface for Project Jupyter. It enables you to work with documents and activities such as Jupyter notebooks, text editors, terminals, and custom components in a flexible, integrated, and extensible manner. It is the interface that you're looking at right now.

Jupyter Notebooks are a community standard for communicating and performing interactive computing. They are a document that blends computations, outputs, explanatory text, mathematics, images, and rich media representations of objects

To start a Jupyter notebook, click the File menu, then select New and Notebook.

To carry out activities in Jupyter Notebook, click Code and choose one option: Code, Markdown, or Raw.

In Jupyter Notebook, cells containing code are called code cells. These cells are where you write and execute programming instructions. The default kernel in Jupyter Notebook typically runs Python code, but you can use other languages depending on the chosen kernel. Here are some key points about code cells:

  • They allow multiline text input with syntax highlighting for easier code readability.
  • You can run the code in a cell by using the "Run" button, keyboard shortcuts (like Shift+Enter), or selecting the option from the "Cell" menu.
  • The output from the code execution, such as text, plots, or tables, is displayed below the code cell.

Jupyter Notebook also offers other cell types for different purposes:

  • Markdown cells: Used for formatted text explanations, notes, or documentation within the notebook using Markdown syntax.
  • Raw cells: Intended for arbitrary content that isn't evaluated by the kernel. They are useful for including things like system commands or notes that you don't want to execute.

If you need help with Jupyter Notebook, click Help and select the information you need.

This section provides access to computing facilities through a Jupyter notebook. To deepen your understanding of Jupyter notebooks' role in mathematics, particularly mathematical modeling, we've included the "On-Jupyter-Maths.ipynb" file. Click on this file to launch it in the Jupyter Notebook environment and explore the concepts discussed.


">

polestoto

lahirtoto

warung403

warung403 login

situs warung403

lahirtoto

LAHIRTOTO

LAHIRTOTO LOGIN

lahirtoto

imgstock

Hosting Gambar

Kasino Online dan Risiko Penyalahgunaan Deep Link dalam Aplikasi Digital

Ketika Sistem Kasino Digital Menghadapi Gangguan Akibat Lonjakan Pengunjung

Memahami Peran Token Akses dalam Menjaga Keamanan Akun Kasino Online

Kasino Digital dan Fenomena Penipuan Melalui Pesan Notifikasi Palsu

Di Balik Layanan Kasino Online, Ada Sistem Antrean Data yang Menjaga Kestabilan

Kasino Online dalam Sorotan Penggunaan Teknologi Analisis Perilaku Pengguna

Ketika Kasino Digital Menghadapi Tantangan Keamanan pada Sistem Pembayaran Otomatis

Memahami Risiko Penyimpanan Kata Sandi pada Browser saat Mengakses Kasino Online

Kasino Digital dan Peran Teknologi Load Balancing dalam Menangani Lalu Lintas Server

Menelusuri Ancaman Session Hijacking terhadap Keamanan Akun Kasino Online

Kasino Online dan Fenomena Penyebaran Informasi melalui Grup Percakapan Digital

Ketika Sistem Kasino Digital Memanfaatkan Machine Learning untuk Mendeteksi Aktivitas Mencurigakan

Memahami Pentingnya Validasi Data dalam Pengelolaan Layanan Kasino Online

Kasino Digital dan Tantangan Menjaga Keamanan Informasi pada Perangkat Lama

Di Balik Sistem Kasino Online, Ada Proses Pemulihan Data saat Terjadi Gangguan

Kasino Online dalam Pembahasan tentang Risiko Penggunaan Jaringan Wi-Fi Terbuka

Ketika Kasino Digital Menghadapi Ancaman Manipulasi Permintaan pada Sistem Web

Memahami Peran Log Aktivitas dalam Menelusuri Gangguan Keamanan Kasino Online

Kasino Digital dan Fenomena Akun Tiruan yang Menyamar sebagai Layanan Resmi

Menelusuri Hubungan antara Kasino Online dan Perkembangan Teknologi Perlindungan Identitas

Ketika Video Scatter Hitam Mahjong Ways 2 Menggunakan Suara AI, Mengenal Cara Audio Sintetis Memengaruhi Kepercayaan

Mengenal Bias Otomasi dalam Analisis Pola Gates of Olympus, Mengapa Hasil AI Tidak Selalu Lebih Akurat

Shio Kuda Api pada November 2026, Memahami Mengapa Ramalan Musiman Kembali Ramai dalam Komunitas Digital

Fenomena Klaim Scatter Hitam pada Mahjong Wins 3, Mengapa Kesamaan Warna Tidak Membuktikan Adanya Fitur Baru

Ketika Data RTP Pragmatic Play Disajikan dalam Persentase Harian, Mengenal Risiko Kesalahan Membaca Angka

Mengenal Pengaruh Kompresi Video terhadap Detail Simbol Mahjong Ways 2 di Media Sosial

Shio Kelinci dan Filosofi Kehati-hatian dalam Fortune Rabbit, Memahami Perbedaan Simbol Budaya dan Peluang

Mengapa Riwayat Starlight Princess yang Dibagikan Sebagian Bisa Membentuk Gambaran Statistik Keliru

Ketika Tautan Pola Mahjong Ways Beredar di Telegram, Mengenal Risiko Pengalihan ke Situs Tidak Resmi

Mengenal Perbedaan Animasi Lokal dan Respons Server pada Gates of Olympus saat Koneksi Tidak Stabil

Fenomena Gambar Scatter Hitam Mahjong Ways 2 yang Diperbesar AI, Mengapa Detail Tambahan Belum Tentu Asli

Shio Naga dan Anggapan Energi Keberuntungan, Memahami Pengaruh Bahasa Simbolis dalam Komunitas Mahjong Ways

Ketika AI Membandingkan Ribuan Screenshot Gates of Olympus, Mengenal Masalah Data Ganda dan Bias Sampel

Mengenal Pengaruh Notifikasi Media Sosial terhadap Fokus Pengguna saat Membuka Mahjong Wins 3

Mengapa Klaim RTP Terbaru PG Soft Perlu Disertai Tanggal, Versi Permainan, dan Sumber yang Jelas

Shio Ular dan Simbol Transformasi dalam Tradisi Tiongkok, Mengenal Pengaruhnya pada Ilustrasi Fortune Dragon

Ketika Video Starlight Princess Menggunakan Efek Slow Motion, Mengapa Urutan Animasi Bisa Terlihat Berbeda

Mengenal Risiko Izin Akses Berlebihan pada Aplikasi Tidak Resmi yang Mengatasnamakan Pragmatic Play

Mengapa Grafik Pola Mahjong Ways yang Terlihat Rapi Belum Tentu Memiliki Dasar Statistik Kuat

Ketika Komunitas Gates of Olympus Membahas Prediksi AI, Memahami Perbedaan Kemungkinan Statistik dan Kepastian Hasil

Kasino Online dan Risiko Pencurian Identitas Melalui Halaman Verifikasi Palsu

Ketika Teknologi AI Digunakan untuk Membuat Ulasan Kasino Digital yang Menyesatkan

Memahami Peran WebSocket dalam Komunikasi Real Time pada Kasino Online

Kasino Digital dan Tantangan Melindungi Informasi Pengguna dari Serangan Siber

Di Balik Tampilan Kasino Online, Ada Proses Pemrosesan Data yang Tidak Terlihat

Kasino Online dalam Sorotan Fenomena Penipuan Menggunakan Identitas Platform Terkenal

Ketika Kasino Digital Menghadapi Risiko Penyalahgunaan Akses oleh Pihak Tidak Berwenang

Memahami Hubungan antara Kasino Online dan Perkembangan Sistem Autentikasi Modern

Kasino Digital dan Fenomena Manipulasi Testimoni dalam Ekosistem Internet

Menelusuri Peran Firewall dalam Menjaga Infrastruktur Layanan Kasino Online

Kasino Online dan Tantangan Menghadapi Ancaman Malware pada Perangkat Pengguna

Ketika Sistem Kasino Digital Mengalami Keterlambatan Pemrosesan Transaksi

Kasino Digital dalam Pembahasan tentang Risiko Penyalahgunaan Informasi Pembayaran

Memahami Mengapa Keamanan API Menjadi Penting bagi Platform Kasino Online

Kasino Online dan Fenomena Rekayasa Sosial yang Menargetkan Pengguna Internet

Di Balik Aktivitas Kasino Digital, Ada Sistem Pencatatan yang Mendukung Keamanan

Kasino Online dan Tantangan Menghadapi Penyebaran Tautan Berbahaya di Media Sosial

Ketika Teknologi Biometrik Menjadi Bagian dari Sistem Verifikasi Kasino Digital

Kasino Digital dan Pentingnya Memahami Risiko Penyimpanan Informasi di Cloud

Menelusuri Hubungan antara Kasino Online dan Perkembangan Teknologi Keamanan Jaringan

Ketika AI Membuat Rekaman Scatter Hitam Mahjong Ways 2 Terlihat Nyata, Mengenal Tantangan Verifikasi Video Digital

Mengapa Grafik Hasil Gates of Olympus Bisa Terlihat Membentuk Siklus, Memahami Ilusi Pola dalam Data Acak

Shio Kuda Api dan Percakapan Komunitas Starlight Princess pada 2026, Mengenal Pengaruh Tradisi terhadap Persepsi

Fenomena Konten RTP Live Pragmatic Play yang Dibagikan Ulang, Mengapa Informasi Lama Bisa Dianggap Terbaru

Mengenal Pengaruh Mode Gelap Smartphone terhadap Keterbacaan Simbol Mahjong Wins 3

Ketika Shio Naga Dikaitkan dengan Angka Keberuntungan Fortune Dragon, Memahami Batas Simbol Budaya dan Statistik

Mengapa Cuplikan Video Pola Mahjong Ways Lebih Mudah Viral daripada Penjelasan Statistik yang Lengkap

Risiko Situs Tiruan yang Mengatasnamakan PG Soft, Mengenal Cara Memeriksa Keaslian Halaman Digital

Mengenal Pengaruh Efek Getaran pada Gates of Olympus terhadap Respons dan Perhatian Pengguna

Ketika AI Menyusun Ringkasan Pola Starlight Princess dari Forum, Mengapa Banyaknya Komentar Bukan Bukti Akurat

Ketika Video Scatter Hitam Mahjong Ways 2 Beredar Tanpa Sumber, Mengenal Pentingnya Verifikasi Konten Digital

Mengenal Data Drift dalam Analisis Mahjong Ways, Mengapa Perubahan Grafik Tidak Selalu Menandakan Sistem Baru

Shio Kuda Api dan Perbincangan Keberuntungan Menjelang Akhir 2026, Memahami Pengaruh Tradisi pada Konten Digital

Ketika Chatbot AI Memberikan Jawaban tentang RTP Gates of Olympus, Mengapa Sumber Informasi Perlu Diperiksa

Mengapa Animasi Scatter pada Starlight Princess Dapat Membentuk Ekspektasi Berbeda bagi Setiap Pengguna

Fenomena Pola Berulang dalam Mahjong Wins 3, Mengenal Perbedaan Korelasi dan Hubungan Sebab Akibat

Shio Naga dan Filosofi Kekuatan dalam Fortune Dragon, Memahami Peran Simbol Budaya pada Ilustrasi Modern

Ketika Konten Pragmatic Play Dibagikan Melalui Grup Pesan, Mengenal Risiko Tautan dan File yang Tidak Terverifikasi

Mengenal Pengaruh Frame Rate terhadap Animasi Mahjong Ways 2 pada Smartphone dengan Spesifikasi Berbeda

Mengapa Klaim Prediksi Pola Gates of Olympus dari AI Tidak Bisa Diterima Tanpa Pengujian

Fenomena Poster Scatter Hitam yang Dibuat dengan AI, Memahami Mengapa Detail Visual Bisa Menyesatkan

Shio Ular dan Makna Kebijaksanaan dalam Tradisi Tiongkok, Mengenal Pengaruhnya pada Diskusi Mahjong Ways

Ketika Riwayat Gates of Olympus Diubah Menjadi Infografik, Mengapa Pemilihan Skala Dapat Mengubah Persepsi

Mengenal Risiko Aplikasi Modifikasi Mahjong Ways yang Menjanjikan Fitur Tambahan Tidak Resmi

Mengapa Komentar tentang Jam Keberuntungan Starlight Princess Mudah Dipercaya dalam Komunitas Online

Simbol Kelinci dalam Fortune Rabbit dan Tradisi Tiongkok, Memahami Peran Warna Emas dalam Desain Digital

Ketika AI Merangkum Diskusi Pola Pragmatic Play, Mengenal Risiko Informasi Keliru yang Terlihat Konsisten

Perbedaan Cache Browser dan Data Permainan Mahjong Wins 3, Memahami Mengapa Tampilan Bisa Berubah Setelah Pembaruan

Shio Kerbau dan Simbol Ketekunan dalam Konten Gates of Olympus, Memisahkan Nilai Budaya dari Peluang Permainan

Mengenal Survivorship Bias dalam Unggahan Hasil Mahjong Ways, Mengapa Cerita Populer Tidak Mewakili Semua Pengalaman

Ketika Deepfake Digunakan untuk Menampilkan Klaim Pola Mahjong Ways 2, Mengenal Risiko Manipulasi Identitas

Mengenal Perbedaan Latensi Jaringan dan Respons Server saat Mengakses Gates of Olympus

Shio Monyet dan Simbol Kecerdikan dalam Budaya Tiongkok, Mengapa Tafsirnya Tidak Menjadi Bukti Pola Starlight Princess

Ketika Data Mahjong Wins 3 Dibaca Menggunakan Grafik Heatmap, Memahami Risiko Melihat Pola yang Sebenarnya Acak

Fenomena Akun Palsu yang Membagikan Informasi RTP Pragmatic Play, Mengenal Tanda Penipuan Digital

Mengenal Pengaruh Kecerahan Adaptif terhadap Detail Simbol Fortune Dragon pada Layar Smartphone

Shio Ayam dan Simbol Ketelitian dalam Diskusi Gates of Olympus, Memahami Perbedaan Karakter Budaya dan Analisis Data

Ketika Video Starlight Princess Diputar Ulang dalam Gerakan Lambat, Mengapa Detail Animasi Bisa Ditafsirkan Berbeda

Mengenal Risiko QR Code Tidak Dikenal dalam Komunitas Mahjong Ways, Dari Pengalihan Situs hingga Pencurian Data

Mengapa Pembahasan Algoritma Rahasia PG Soft Sering Muncul Kembali, Mengenal Pengaruh Memori dan Bias Pengulangan

Kasino Online dan Fenomena Dark Pattern dalam Desain Layanan Digital

Ketika Kasino Digital Menghadapi Ancaman Serangan DDoS pada Infrastruktur Server

Memahami Peran DNS dalam Menghubungkan Pengguna dengan Layanan Kasino Online

Kasino Digital dan Tantangan Menjaga Keamanan Sesi Login Pengguna

Di Balik Kecepatan Akses Kasino Online, Ada Teknologi CDN yang Mendukung Distribusi Konten

Kasino Online dalam Pembahasan tentang Risiko Aplikasi dari Sumber Tidak Resmi

Ketika Sistem Kasino Digital Menggunakan CAPTCHA untuk Membatasi Aktivitas Bot

Kasino Digital dan Fenomena Informasi yang Terpotong dalam Konten Video Pendek

Memahami Peran Pembaruan Browser dalam Menjaga Keamanan Akses Kasino Online

Kasino Online dan Pentingnya Mengenali Risiko Penggunaan Perangkat Bersama

Kasino Online dan Fenomena Deepfake yang Mengaburkan Keaslian Konten Promosi

Memahami Peran Cache Browser dalam Menampilkan Informasi Kasino Digital

Ketika Kasino Online Menghadapi Risiko Kebocoran Data dari Pihak Ketiga

Kasino Digital dan Tantangan Mengenali Manipulasi Visual dalam Konten Internet

Di Balik Penggunaan QR Code pada Kasino Online, Ada Risiko Keamanan yang Perlu Dikenali

Kasino Online dalam Sorotan Perkembangan Teknologi Identifikasi Perangkat

Mengenali Pengaruh Social Proof dalam Membentuk Kepercayaan terhadap Kasino Digital

Kasino Digital dan Pentingnya Memahami Risiko Penggunaan Kata Sandi Berulang

Ketika Konten Kasino Online Menyebar Melalui Algoritma Rekomendasi Media Sosial

Kasino Online dan Tantangan Menjaga Privasi dalam Ekosistem Periklanan Digital

Baidu Perkenalkan ERNIE 5.5 Flash, Model AI Baru Mulai Tersedia di OpenRouter

OpenAI Hadirkan Alat Keamanan AI untuk Membantu Perusahaan Menghadapi Serangan Siber

Telkom Perkenalkan Ekosistem Sovereign AI untuk Mendukung Inovasi Digital Indonesia

MIT Susun Panduan Baru untuk Mengurangi Risiko Penggunaan AI di Perusahaan

Insight Luncurkan Agent Store untuk Mempermudah Penerapan AI di Dunia Kerja

Komdigi Siapkan Pengawasan Teknologi Digital Berdasarkan Tingkat Risiko

Orca Security dan Flashpoint Jadi Sorotan dalam Perkembangan Keamanan Siber

Indonesia dan Estonia Perkuat Kerja Sama Keamanan Data dan Identitas Digital

Visure X Hadir dengan Teknologi AI untuk Membantu Pengelolaan Kebutuhan Perangkat Lunak

Nvidia dan AMD Bergabung dalam Konsorsium SGLang untuk Pengembangan AI

Fenomena Deepfake dalam Konten Mahjong Ways 2, Mengenal Cara Video Buatan AI Memengaruhi Kepercayaan Penonton

Ketika Data Gates of Olympus Dianalisis Menggunakan AI, Mengapa Hasil Simulasi Tidak Sama dengan Prediksi Nyata

Shio Kuda Api dan Tradisi Keberuntungan Tahun 2026, Memahami Pengaruh Simbol Budaya pada Komunitas Starlight Princess

Mengenal Fenomena FOMO dalam Komunitas Mahjong Wins 3, Ketika Konten Viral Memengaruhi Keputusan Pengguna

Perbedaan RTP Teoretis dan Statistik Sesi Pendek pada PG Soft, Mengapa Angka yang Terlihat Bisa Berbeda Jauh

Ketika Shio Ayam Dikaitkan dengan Ketelitian Membaca Pola Mahjong Ways, Memahami Batas Tafsir Simbolis

Pengaruh Algoritma Rekomendasi TikTok terhadap Penyebaran Video Scatter Hitam Mahjong Ways 2

Mengenal Risiko Ekstensi Browser Tidak Resmi yang Mengklaim Bisa Membaca Pola Gates of Olympus

Simbol Keberuntungan Fortune Rabbit dalam Desain Mobile, Memahami Hubungan Warna dan Persepsi Pengguna

Mengapa Hasil Mahjong Ways yang Dibagikan Komunitas Tidak Selalu Mewakili Peluang Sebenarnya

Kasino Online dan Peran Teknologi Browser dalam Menjaga Kelancaran Akses Digital

Di Balik Sistem Kasino Digital, Ada Proses Sinkronisasi Data yang Jarang Dibahas

Ketika Kasino Online Menghadapi Tantangan Keamanan pada Perangkat Seluler

Memahami Pengaruh Latensi Jaringan terhadap Respons Layanan Kasino Digital

Kasino Digital dan Fenomena Penggunaan Informasi Pribadi dalam Ekosistem Internet

Menelusuri Cara Sistem Kasino Online Menangani Gangguan Koneksi Mendadak

Kasino Online dan Pentingnya Mengenali Risiko Ekstensi Browser yang Tidak Terpercaya

Ketika Pembaruan Sistem Mengubah Tampilan dan Navigasi Kasino Digital

Kasino Digital dalam Pembahasan tentang Keamanan Penyimpanan Data Pengguna

Memahami Hubungan antara Kasino Online dan Perkembangan Teknologi Deteksi Aktivitas Tidak Wajar

Microsoft 365 Alami Gangguan Global, Outlook dan Teams Ikut Terdampak

Google Perkenalkan Gemini 4 Hydrogen dengan Kemampuan AI yang Lebih Cepat

Samsung Galaxy Z Fold8 Raih Penghargaan Gadget Terbaik Tahun 2026

Vivo V80 Series Hadir dengan Kamera ZEISS dan Dukungan Fitur AI

Huawei Watch D3 Hadirkan Pemantauan Tekanan Darah Lewat Smartwatch

Cisco Gandeng Anthropic untuk Menguji Keamanan Teknologi Agen AI

Ancaman Krisis RAM Membayangi Industri Smartphone Menjelang 2027

Apple Dikabarkan Tingkatkan Produksi MacBook Neo Generasi Terbaru

Modus Foto KTP Deepfake Ditemukan dalam Registrasi Kartu SIM

Registrasi SIM Berbasis Biometrik Mulai Mengubah Kebiasaan Pengguna Seluler

Serangan Phishing Jadi Perhatian Setelah Gangguan Microsoft 365

Google Find Hub Membantu Pengguna Melacak Smartphone Android yang Hilang

Akamai Perkenalkan Teknologi Isolasi untuk Melindungi Data dari Agen AI

Samsung Galaxy S27 Ultra Mulai Jadi Sorotan Lewat Bocoran Spesifikasi

Teknologi Pendinginan Pusat Data Semakin Penting di Tengah Pertumbuhan AI

Nokia Perluas Bisnis Jaringan AI dan Perkuat Kerja Sama dengan Indosat

Penipuan Menggunakan Suara AI Meningkatkan Risiko Keamanan Identitas Digital

Serangan Siber Berbasis AI Agent Mendorong Penguatan Keamanan Jaringan

Microsoft Ungkap Dugaan Penyebab Gangguan Outlook dan Teams

Pertumbuhan Layanan AI Mendorong Kebutuhan Memori Komputer Semakin Besar

Fenomena Video Scatter Hitam Mahjong Ways 2 yang Diedit AI, Memahami Mengapa Tampilan Realistis Belum Tentu Asli

Ketika Pola Gates of Olympus Dibahas oleh Komunitas Digital, Mengenal Pengaruh Pengulangan Informasi terhadap Kepercayaan

Shio Kuda Api dalam Kalender Tiongkok, Memahami Mengapa Ramalan Keberuntungan Sering Dikaitkan dengan Mahjong Ways

Peran Machine Learning dalam Membaca Data Starlight Princess, Mengapa Model AI Tidak Selalu Mampu Mengenali Pola Nyata

Mengenal Efek Ilusi Kontrol dalam Permainan Mahjong Wins 3, Ketika Pilihan Pengguna Terasa Memengaruhi Hasil Acak

Simbol Shio Naga dan Ular dalam Konten Fortune Dragon, Memahami Perbedaan Makna Tradisional dan Interpretasi Digital

Fenomena RTP Live pada Permainan Pragmatic Play, Mengenal Perbedaan Informasi Resmi dan Angka yang Beredar di Internet

Ketika Screenshot Mahjong Ways Dibagikan Tanpa Konteks, Memahami Risiko Kesimpulan dari Satu Hasil Permainan

Pengaruh Latensi Internet terhadap Animasi Gates of Olympus, Mengenal Perbedaan Gangguan Tampilan dan Hasil Permainan

Shio Monyet dan Anggapan Kemampuan Membaca Pola, Memahami Hubungan Simbol Kecerdikan dengan Persepsi Pemain

Fenomena Scatter Hitam Mahjong Ways 2 dalam Konten AI, Mengenal Risiko Gambar Buatan yang Dianggap Sebagai Fitur Asli

Ketika Pola Mahjong Ways Dibahas Melalui Live Streaming, Memahami Pengaruh Komentar Penonton terhadap Persepsi Hasil

Shio Anjing dan Makna Kesetiaan dalam Tradisi Tiongkok, Mengenal Hubungannya dengan Komunitas Gates of Olympus

Penggunaan AI untuk Membandingkan RTP Permainan Digital, Mengapa Data dari Sumber Berbeda Tidak Selalu Setara

Mengapa Simbol yang Hampir Sama pada Starlight Princess Bisa Memicu Anggapan tentang Pola Tersembunyi

Shio Ular Kayu dan Filosofi Perubahan, Memahami Perbedaan Tafsir Budaya dengan Mekanisme Fortune Dragon

Riwayat Putaran Mahjong Wins 3 dalam Bentuk Grafik, Mengapa Visualisasi Data Bisa Menimbulkan Tafsir Berbeda

Fenomena Klaim Pola Terbaru Gates of Olympus di Media Sosial, Mengenal Pentingnya Bukti dan Konteks Informasi

Pengaruh Animasi Berkecepatan Tinggi pada Mahjong Ways 2, Memahami Hubungan Gerakan Visual dengan Perhatian Pengguna

Ketika Chatbot AI Menafsirkan Angka Keberuntungan Shio, Mengenal Batas Penjelasan Budaya dan Prediksi Statistik

Istilah Pola Tangga pada Mahjong Ways, Mengapa Susunan Hasil Acak Bisa Terlihat Memiliki Arah Tertentu

Efek Suara Gates of Olympus dan Persepsi Keberhasilan, Mengenal Cara Audio Memengaruhi Pengalaman Digital

Ketika Ramalan Shio Dibagikan Bersama Konten Starlight Princess, Memahami Peran Algoritma Media Sosial

Mengenal Gambler's Fallacy dalam Diskusi Mahjong Wins 3, Mengapa Hasil Sebelumnya Tidak Menjamin Hasil Berikutnya

Poster Scatter Emas dan Scatter Hitam di Internet, Mengenal Tanda Ilustrasi yang Tidak Mewakili Fitur Resmi

PG Soft dan Desain Antarmuka Mobile, Memahami Pengaruh Ukuran Layar terhadap Pengalaman Mahjong Ways

Shio Kerbau dan Filosofi Ketekunan, Mengapa Makna Tradisional Tidak Dapat Menentukan Hasil Gates of Olympus

Membaca Grafik Riwayat Starlight Princess, Mengenal Perbedaan Tren Visual dan Bukti Perubahan Sistem

Mengapa Video Pola Mahjong Ways Sering Terlihat Meyakinkan, Mengenal Pengaruh Penyuntingan dan Pemilihan Adegan

Fortune Dragon dan Ornamen Naga Asia, Mengenal Cara Desain Modern Mengadaptasi Warisan Visual Tradisional

Mengenal Confirmation Bias dalam Komunitas Pragmatic Play, Ketika Pengalaman Pribadi Dianggap Sebagai Bukti Pola

Mode Hemat Baterai saat Membuka Mahjong Wins 3, Memahami Pengaruhnya terhadap Animasi dan Respons Layar

Shio Kambing dan Simbol Harmoni dalam Budaya Tiongkok, Memahami Penggunaannya pada Konten Permainan Digital

Perbedaan Simulasi AI dan Prediksi Hasil Mahjong Ways, Mengapa Model Statistik Memiliki Batas Kemampuan

Fenomena Near Miss pada Gates of Olympus, Mengenal Mengapa Hasil yang Hampir Sesuai Terasa Begitu Berarti

Mengenal Pengaruh Refresh Rate Smartphone terhadap Tampilan Animasi Starlight Princess

Shio Babi dan Anggapan Kemakmuran dalam Konten Mahjong Ways, Memahami Batas antara Tradisi dan Statistik

Ketika Angka RTP Dibagikan Tanpa Sumber, Mengenal Cara Memeriksa Informasi Permainan PG Soft

Wild Bounty Showdown dan Desain Simbol Bergaya Barat, Mengenal Pengaruh Tema Visual terhadap Pengalaman Pengguna

Mengapa Klaim Algoritma Rahasia Mahjong Ways Mudah Menyebar, Memahami Peran Rasa Penasaran dan Literasi Digital