Skip to main content


Objetos taggeado con: math


Passwords and power laws

According to this
the empirical distribution of real passwords follows a power law. In the
authors’ terms, a Zipf-like distribution. The frequency of the rth
most common password is proportional to something like 1/r. More

f~r~ = C r^–s^

where s is on the order of 1. The value of s that best fit the data
depended on the set of passwords, but their estimates of s varied from
0.46 to 0.91.

This means that the most common passwords are very common and easy to

If passwords come from an alphabet of size A and have length n, then
there are A^n^ possibilities. For example, if a password has length
10 and consists of uppercase and lowercase English... ver más


Riemann hypothesis, the fine structure constant, and the Todd function

This morning Sir Michael Atiyah gave a presentation at the Heidelberg
Laureate Forum with a claimed proof of the Riemann hypothesis. The
Reimann hypothesis (RH) is the most famous open problem in mathematics,
and yet Atiyah claims to have a simple proof.

.size-medium width="500" height="375"}

Simple proofs of famous conjectures

If anyone else claimed a simple proof of RH they’d immediately be
dismissed as a crank. In fact, many people have sent me simple proofs of
RH just in the last few days in response to my blog
and I imagine they’re all cranks. But Atiyah is not a crank. He won the
Fields Medal in 1966 and the Abel prize... ver más


Three applications of Euler’s theorem

Fermat’s little theorem says that if p is a prime and a is not a
multiple of p, then

a^p-1^ = 1 (mod p).

Euler’s generalization of Fermat’s little theorem says that if a
is relatively prime to m, then

a^φ(m)^ = 1 (mod p)

where φ(m) is Euler’s so-called totient function. This function
counts the number of positive integers less than m and relatively
prime to m. For a prime number p, φ(p) = p-1, and to Euler’s
theorem generalizes Fermat’s theorem.

Euler’s totient function is multiplicative, that is, if a and b
are relatively prime, then φ(ab) = φ(a) φ(b). We will n... ver más


News regarding ABC conjecture and Riemann Hypothesis

There have been a couple news stories regarding proofs of major
theorems. First, an update on Shinichi Mochizuki’s proof of the abc
, then an announcement that Sir Michael Atiyah claims to
have proven the Riemann hypothesis.

Shinichi Mochizuki’s proof of the abc conjecture


has a story today saying that two mathematicians have concluded that
Shinichi Mochizuki’s proof of the ABC conjecture is flawed beyond
repair. The story rightly refers to a “clash of Titans” because Shinichi
Mochizuki and his two critics Peter Scholze and Jakob Stix are all three
highly respected.

I first wrote about the abc conjecture when it came out in
... ver más


Footnote on fifth root trick

Numberphile has a nice video on the fifth root trick: someone raises a
two-digit number to the 5th power, reads the number aloud, and you tell
them immediately what the number was.

Here’s the trick in a nutshell. For any number n, n^5^ ends in the
same last digit as n. You could prove that by brute force or by
Euler’s theorem. So when someone tells you n^5^, you immediately know
the first digit. Now you need to find the first digit, and you can do
that by learning, approximately, the powers (10k)^5^ for i = 1, 2, 3,
…, 9. Then you can determine the first digit by the range.

Here’s where the video is a little vague. It says that you don’t need to
know the powers of 10k very accurately. This is true, but just how
accurately do you need to know the ranges?

If the two-digit number is a power of 10, you’ll recogniz... ver más


An empirical look at the Goldbach conjecture

The Goldbach conjecture says that every even number bigger than 2 is the
sum of two primes. I imagine he tried out his idea on numbers up to a
certain point and guessed that he could keep going. He lived in the 18th
century, so he would have done all his calculation by hand. What might
he have done if he could have written a Python program?

Let’s start with a list of primes, say the first 100 primes. The 100th
prime is p = 541. If an even number less than p is the sum of two
primes, it’s the sum of two primes less than p. So by looking at the
sums of pairs of primes less than p, we’ll know whether the Goldbach
conjecture is true for numbers less than p. And while we’re at it, we
could keep track not just of whether a number is the sum of two
primes, but also how many ways it is a sum of two primes.
from sympy... ver más

Doing stuff with data is hard...I love how the data points are exactly the same for each cell 😀 Hat tip to @🛫 Brad Koehn 🛬 and #math #science #geek #humor

Doing stuff with data is hard...I love how the data points are exactly the same for each cell 😀 Hat tip to @🛫 Brad Koehn 🛬 and #math #science #geek #humor


Group statistics

I just ran across FiniteGroupData and related functions in
Mathematica. That would have made some of my earlier

easier to write had I used this instead of writing my own code.

Here’s something I find interesting. For each n, look at the groups of
order at most n and count how many are Abelian versus non-Abelian. At
first there are more Abelian groups, but the non-Abelian groups soon
become more numerous. Also, the number of Abelian groups grows smoothly,
while the number of non-Abelian groups has big jumps, particularly at
powers of 2.

.size-medium width="480" height="297"}

Here’s the Mathematica code:
fgc = FoldList[Plus, 0, Table[... ver más

This story is incredible, in a good way! This goes back to underscoring how math is a universal language of sorts. #math #science

This story is incredible, in a good way! This goes back to underscoring how math is a universal language of sorts. #math #science


The permutation symbol

Sometimes simple notation can make a big difference. One example of this
is the Kronecker delta function δ~ij~ which is defined to be 1
if i = j and zero otherwise. Because branching logic is built into
the symbol, it can keep branching logic outside of your calculation.
That is, you don’t have to write “if … else …” in when doing your
calculation. You let the symbol handle it.

The permutation symbol ε~ijk~ is similar. It has some branching
logic built into its definition, which keeps branching out of your
calculation, letting you handle things more uniformly. In other words,
the symbol encapsulates some complexity, keeping it out of your
calculation. This is analogous to how you might reduce the complexity of
a computer program.


The permutation symbol, sometimes called the... ver más


A strange sort of product rule

Let u be a real-valued function of n variables, and let v be a
vector-valued function of n variables, a function from n variables
to a vector of size n. Then we have the following product rule:

D(uv) = v Du + u Dv.

It looks strange that the first term on the right isn’t Du v.

The function uv is a function from n dimensions to n dimensions,
so it’s derivative must be an n by n matrix. So the two terms on the
right must be n by n matrices, and they are. But Du v is a 1 by
1 matrix, so it would not make sense on the right side.

Here’s why the product rule above looks strange: the multiplication by
u is a scalar product, not a matrix product. Sometimes you can
think of re... ver más


China now the most prolific contributor to physical sciences, engineering, math

Your usage has been flagged as a violation of our terms of service. For inquiries related to this message please contact support. For sales inquiries, please visit…
Article word count: 52

HN Discussion:
Posted by petethomas (karma: 23316)
Post stats: Points: 145 - Comments: 103 - 2018-09-12T22:59:19Z

\#HackerNews #china #contributor #engineering #... ver más


Duplicates in the classification of finite simple groups

The previous

defined the groups PSL(n, q) where n is a positive integer and q
is a prime power. These are finite simple groups for n ≥ 2 except for
PSL(2, 2) and PSL(2, 3).

Duplicates among PSL(n, q)

There are a couple instances where different values of n and q lead
to isomorphic groups: PSL(2, 4) and PSL(2, 5) are isomorphic, and PSL(2,
7) and PSL(3, 2) are isomorphic. These are the only instances [1].

With the exceptions stated above, distinct values of n and q lead to
distinct groups. Is it possible for different choices of n and q to
lead to groups of the same size, even though the groups are not
isomorphic to each other? Yes, PSL(3, 4) and PSL(4, 2) both... ver más

Der Spruch gefällt mir. Mit dem Bild wird es irgendwie greifbarer!
Der Spruch auf Deutsch:

"Ich hätte lieber Fragen, die nicht beantwortet werden können, als Antworten, die nicht befragt werden können."

Na ja, befragt... wer hat ne bessere Formulierung?

Bild/FotoDonna Schwieder wrote the following post Sat, 08 Sep 2018 18:45:52 +0200

“I would rather have questions that can't be answered than answers that can't be questioned.”~Richard Feynman

\#questions #answers #science #math #FreeSpeech
view full size


How a Kalman filter works, in pictures

Surprisingly few software engineers and scientists seem to know about it, [even if] it is such a general and powerful tool for combining information in the presence of uncertainty. (...)

You can use a Kalman filter in any place where you have uncertain information about some dynamic system, and you can make an educated guess about what the system is going to do next. Even if messy reality comes along and interferes with the clean motion you guessed about, the Kalman filter will often do a very good job of figuring out what actually happened. And it can take advantage of correlations between crazy phenomena that you maybe wouldn’t have thought to exploit!

Kalman filters are ideal for systems which are continuously changing. They have the advantage that they are light on memory (they don’t need to keep any history other than the previous state), and they are very fast, making them well suited for real time problems and embedded systems. (...)

... ver más


“I would rather have questions that can't be answered than answers that can't be questioned.”~Richard Feynman

#questions #answers #science #math #FreeSpeech


Accuracy, precision, and recall

I posted the definitions of accuracy, precision, and recall on
@BasicStatistics this afternoon.
Accuracy = (TP+TN)/(TP+FP+FN+TN)\
Precision = TP/(TP+FP)\
Recall = TP/(TP+FN)


T = true\
F = false\
P = positive\
N = negative

— Basic Statistics (@BasicStatistics) September 6,
There seems to be no end of related definitions, and multiple names for
the same definitions.

Precision is also known as positive predictive value (PPV)
and recall is also known as sensitivity, hit rate,
and true positive rate (TPR).

Not mentioned in the tweet above
are specificity (a.k.a. selectivity... ver más


Simplest exponential sum

Today‘s exponential
sum curve is simply a triangle.

.size-medium width="400"}

But yesterday‘s curve
was more complex

.size-medium width="400"}

and tomorrow‘s curve
will be more complex as well.

.size-medium width="400"}

Why is today’s curve... ver más


Three ways to sum a divergent series

There’s no direct way to define the sum of an infinite number of terms.
Addition takes two arguments, and you can apply the definition
repeatedly to define the sum of any finite number of terms. But an
infinite sum depends on a theory of convergence. Without a definition of
convergence, you have no way to define the value of an infinite sum. And
with different definitions of convergence, you can get different values.

In this post I’ll review two ways of assigning a meaning to divergent
series that I’ve written about before, then mention a third way.

Asymptotic series

A few months ago I wrote about an asymptotic series

to the differential equation


You end u... ver más


The right level of abstraction

Mark Dominus wrote a blog post yesterday entitled Why I never finish my
Haskell programs (part 1 of
. In a nutshell,
there’s always another layer of abstraction. “Instead of just adding
lists of numbers, I can do addition-like operations on list-like
containers of number-like things!”

Is this a waste of time? It depends entirely on context.

I can think of two reasons to pursue high levels of abstraction. One is
reuse. You have multiple instances of things that you want to handle
simultaneously. The other reason is clarity. Sometimes abstraction
makes things simpler, even if you only have one instance of your
abstraction. Dijkstra had the latter in mind when he said
The purpose of abstraction is not to be vague, but to create a new
semantic level in which one
... ver más


Pi primes

I was reading a recent blog

by Evelyn Lamb where she mentioned in passing that 314159 is a prime
number and that made me curious how many such primes there are.

Lets look at numbers formed from the digits of π to see which ones are

Obviously 3 and 31 are prime. 314 is even. 3141 is divisible by 9
because its digits sum to 9, and 31415 is clearly divisible by 5. And
now we know that 314159 is prime. What’s the next prime in the sequence?
Here’s a little Python code to find out.
from sympy import pi, isprime

M = 1000
digits = "3" + str(pi.evalf(M+1))[2:]
for i in range(1, M+1):
n = int(digits[:i])
if isprime(n):

This looks at numbers formed from the first digit up to the thousandth
digit in th... ver más


Distribution of prime powers

The prime number theorem says that π(x), the number of primes less
than or equal to x, is asymptotically x / log x. So it’s easy to
estimate the number of primes below some number N. But what if we want
to estimate the number of prime powers less than N? This is a
question that comes up in finite
, for example,
since there is a finite field with n elements if and only if n is a
prime power. It’s also important in finite simple

because these groups are often indexed by prime powers.

Riemann’s prime-power counting function Π(x) counts the number of
prime powers less than or equal to x. Clearly... ver más


Orders of finite simple groups

Simple groups are to groups as prime numbers are to numbers.A simple
group has no non-trivial normal subgroups, just as a prime number has no
non-trivial factors.



Finite simple groups have been
into five broad categories:
  • Cyclic groups of prime order
  • Alternating groups
  • Classical groups
  • Exceptional groups of Lie type
  • Sporadic groups.
Three of these categories are easy to describe.

The cyclic groups of prime order are simply the integers mod p
where p is prime. These are the only Abelian finite simple groups.

The alternating gr... ver más


How fast can you multiply matrices?

Suppose you want to multiply two 2 × 2 matrices together. How many
multiplication operations does it take? Apparently 8, and yet in 1969
Volker Strassen discovered that he could do it with 7 multiplications.

Upper and lower bounds

The obvious way to multiply two n × n matrices takes n³
operations: each entry in the product is the inner product of a row from
the first matrix and a column from the second matrix. That amounts to
n² inner products, each requiring n multiplications.

You can multiply two square matrices with O(n³) operations with the
method described above, and it must take at least O(n²) operations
because the product depends on all of the 2n² entries of the two
matrices. Strassen’s result suggests that the optimal algorithm for
multiplying matrices takes O(n^k... ver más


Drawing Spirograph curves in Python

I was looking back over an old blog
noticed some code in the comments that I had overlooked. Tom Pollard
gives the following code for drawing
Spirograph-like curves.

Bild/Foto{.aligncenter .size-medium
width="614" height="461"}
import matplotlib.pyplot as plt
from numpy import pi, exp, real, imag, linspace

def spiro(t, r1, r2, r3):
Create Spirograph curves made by one circle of radius r2 rolling
around the inside (or outside) of another of radius r1. The pen
is a distance r3 from the center of the first circle.
return r3*exp(1j*t*(r1+r2)/r2) + (r1+r2)*exp(1j*t)

def circle(t, r):
return r
... ver más


Epi and mono

My first math classes used the terms one to one and onto to
describe functions. These Germanic names have largely been replaced with
their French equivalents injective and surjective.

Monic and epic are the category theory analogs of injective and
surjective respectively. This post will define these terms and show how
they play out in several contexts. In some categories these new terms
correspond exactly to their traditional counterparts, but in others they
do not.[]{#more-34324}

Sets and functions

A function f from a set A to a set B is injective (one-to-one) if
different points on A go to different points in B. That is, f(x)
= f(y) only if x = y... ver más

The universe behaves #math so well because math was derived observing this universe. #logic #science #physics


A tale of two elliptic curves

A few days ago I blogged about the elliptic
curve secp256k1
and its use in Bitcoin. This curve has a sibling, secp256r1. Note
... ver más


A tale of two elliptic curves

A few days ago I blogged about the elliptic
curve secp256k1
and its use in Bitcoin. This curve has a sibling, secp256r1. Note
the “r” in the penultimate position rather than a “k”. Both are defined
in SEC 2: Recommended Elliptic Curve
Domain Parameters. Both are elliptic curves over a field z~p~ where
p is a 256-bit prime (though different primes for each curve).

The “k” in sepc256k1 stands for Koblitz and the “r” in sepc256r1
stands for random. A Koblitz elliptic curve has some special
properties that make it possible to implement the group operation more
efficiently. It is believed that there is a small security trade-off,
that more... ver más


Distribution of zeros of the Riemann zeta

A recent video by Quanta Magazine says that the eigenvalues of random
matrices and the zeros of the Riemann zeta function have the same

I assume by “random matrices” the video is referring specifically to
Gaussian orthogonal

By zeros of the Riemann zeta function, they mean the imaginary parts of
the zeros in the critical strip. You can download the first 100,000
zeros of the Riemann zeta function
here. So, for example,
the first zero is 14.134725142, which actually means 0.5 + 14.134725142

Here’s the histogram of random matrix eigenvalues from my previous post:

.size-medium width="401" height="293"}

And here’s a histogram of the spacing between the first two thousand
zeros of the Riemann zeta function:

.size-medium width="401" height="293"}

#johndcook #Math #Numbertheory #ProbabilityandStatistics
Distribution of zeros of the Riemann zeta

John D. Cook: Distribution of zeros of the Riemann zeta function


RSA numbers and factoring

It’s much easier to multiply numbers together than to factor them apart.
That’s the basis of RSA encryption.

In particular, the RSA encryption scheme rests on the assumption that
given to large primes p and q, one can quickly find the product pq
but it is much harder to recover the factors p and q. For the size
numbers you’ll see in math homework, say two or three digits, factoring
is a little harder than multiplication. But when you get into numbers
that are hundreds of digits long, factoring is orders of magnitude more
difficult. Or so it seems. There’s no proof that factoring has to be as
difficult as it appears to be. And sometimes products have special
structure that makes factoring much easier, hence the need for so-called
... ver más


Projecting the globe onto regular solids

I was playing around with some geographic features of Mathematica this
morning and ran across an interesting example in the documentation for
the PolyhedronProjection function
given here.
Here’s what you get when you project a map of the earth onto each of the
five regular (Platonic) solids.

.size-medium width="442" height="450"}

.size-medium width="450" height="443"}\
... ver más


From elementary addition to Markov chains

I wrote a new blog post this morning, but for some reason it posted with
an earlier date and so it doesn’t show up at the top of the blog. Here
it is: Addition carries and Markov

#johndcook #Math
From elementary addition to Markov chains

John D. Cook: From elementary addition to Markov chains


Distribution of carries

Suppose you add two long numbers together. As you work your way toward
the result, adding digits from right to left, sometimes you carry a 1
and sometimes you don’t. How often do you carry 1?

Now suppose you add three numbers at a time. Now your carry might be 0,
1, or 2. How often does each appear? How do things change if you’re not
working in base 10?

John Holte goes into this problem in detail in [1]. We’ll only look at
his first result here.

Suppose we’re adding m numbers together in base b, with each digit
being uniformly distributed. Then at each step of the addition process,
the probability distribution of the amount we carry out only depends
on the amount we carried in from the previous step. In other words,
the carries form a Markov chain!

This means that we can do more than describe the distribution of the
amounts car... ver más


Ada Lovelace and Bernoulli numbers

Many consider Ada Lovelace to be the first programmer. An article
from a couple days ago asks what did her program

In a sense, nothing. It was written for a computer that did not exist,
so it was never executed. But it was written to compute the 8th
Bernoulli number.

The article’s author created a
of Lovelace’s program into C.

More posts on Bernoulli numbers:Bild/Foto{width="1"
#johndcook #Math
Ada Lovelace and Bernoulli numbers

John D. Cook: Ada Lovelace and Bernoulli numbers


Carbon curvature

It’s been known for some time that carbon can form structures with
positive curvature (fullerenes) and structures with zero
curvature (graphene). Recently researches discovered a form of carbon
with negative curvature (schwartzites). News story

.size-medium width="400" height="300"}

More curvature posts:Image/Photo{width="1"
#johndcook #Math #Science
Carbon curvature

John D. Cook: Carbon curvature


Bitcoin signatures and elliptic curves over finite fields

Bitcoin uses the Elliptic Curve Digital Signature Algorithm (ECDSA)
based on elliptic curve cryptography. The particular elliptic curve is
known as secp256k1, which is the curve

y² = x³ + 7

over a finite field to be described shortly.

.aligncenter width="400" height="300"}

Addition on elliptic curves in the plane is defined geometrically in
terms of where lines intercept the curve. We won’t go into the geometry
here, except to say that it boils down to a set of equations involving
real numbers. But we’re not working over real numbers; we’re working
over a finite field.

Finite field modulus

The idea is to take the equations motivated by the geometry in the... ver más


Equal Earth map projection

There’s no perfectly satisfying way to map the globe on to a flat
surface. Every projection has its advantages and disadvantages. The
Mercator projection, for example, is much maligned for the way it
distorts area, but it has the property that lines of constant bearing
correspond to straight lines on the map. Obviously this is convenient if
you’re sailing without GPS. But for contemporary use, say in a
classroom, minimizing area distortion is often a higher priority than
keeping bearing lines straight.

Bojan Šavrič, Tom Patterson, and Bernhard Jenny have developed a new map
projection called Equal Earth that nicely balances several competing
criteria, including aesthetics.

.size-medium width="500" height="239"}

The Equal Earth projection sa... ver más


The other butterfly effect

.size-medium width="400" height="286"}

The original butterfly effect

The butterfly effect is the semi-serious claim that a butterfly
flapping its wings can cause a tornado half way around the world. It’s a
poetic way of saying that some systems show sensitive dependence on
initial conditions
, that the slightest change now can make an enormous
difference later. Often this comes up in the context of nonlinear,
chaotic systems but it isn’t limited to that. I give an example
of a linear differential equation whose solutions start out the
essentially the same but eventually diverge completely.

Onc... ver más


Hom functors and a glimpse of Yoneda

Given two objects A and B, Hom(A, B) is simply the set of
functions between A and B. From this humble start, things get more
interesting quickly.

Hom sets

To make the above definition precise, we need to say what kinds of
objects and what kinds of functions we’re talking about. That is, we
specify a category C that the object belong to, and the functions are
the morphisms of that category [1]. For example, in the context of
groups, Hom(A, B) would be the set of group homomorphisms
[2]between A and B, but in the context of continuous groups (Lie
groups), we would restrict Hom(A, B) to be continuous group

To emphasize that Hom refers to a set of morphisms in a particular
category, sometimes you’ll see the name of the category as a subscript,
as... ver más


Deconstructing a parametric plot

Today’s exponential
looks like three
octagons, slightly rotated with respect to each other.

.size-medium width="613" height="460"}

I thought that the graph was tracing out one octagon, then another, then
another. But that’s not what it’s doing at all. You can see for yourself
by going to the exponential sum page and clicking the animate link.

The curve is being traced out in back-and-forth strokes. It’s drawing
thin wedges, not octagons. You can get a better picture of this by
looking at the real and imaginary parts (x and y coordinates)

.size-medium width="613" height="443"}

It would be hard to look at the first plot an imagine the second, or to
look at the second plot and imagine the first.

#johndcook #Math
Deconstructing a parametric plot

John D. Cook: Deconstructing a parametric plot


Sine of five degrees

Today’s the first day of a new month, which means the exponential sum
of the day
will be simpler than
usual. The exponential sum of the day plots the partial sums of

Image/photo{.aligncenter .size-medium

where m, d, and y are the month, day, and (two-digit) year.
The n/d term is simply n, and integer, when d = 1 and so it has
no effect because exp(2πn) = 1. Here’s today’s
, the plot formed by
the partial sums above.

.size-medium width="613"... ver más


Distribution of eigenvalues for symmetric Gaussian matrix

Symmetric Gaussian matrices

looked at
the distribution of eigenvalues for very general random matrices. In
this post we will look at the eigenvalues of matrices with more
structure. Fill an n by n matrix A with values drawn from a
standard normal distribution and let M be the average of A and its
transpose, i.e. M = ½(A + A^T^). The eigenvalues will all be real
because M is symmetric.

This is called a “Gaussian Orthogonal Ensemble” or GOE. The term is
standard but a little misleading because such matrices may not be

Eigenvalue distribution

The joint probability distribution for the eigenvalues of M has three
terms: a constant term that we will ign... ver más

#newhere, sort of, may as well be

I doubt I could really list everything I like, but I like #math #maths #mathematics and #science stuff in general, #geometry, #chemistry, #physics etc.
#art is great, I remember last time I followed some french and german art-related tags, but I forgot what the tags were :p
oh, and I like #octopuses and #octopus things, and I guess #corvids #corvidae

also #d&d, but idk how to tag that, #dnd maybe

anyway, here's a pic of a #cat in some #flowers that I found somewhere on the internet


Circular law for random matrices

Suppose you create a large matrix M by filling its components with
random values. If M has size n by n, then we require the
probability distribution for each entry to have mean 0 and variance
1/n. Then the Girko-Ginibri circular law says that the eigenvalues
of M are approximately uniformly distributed in the unit disk in the
complex plane. As the size n increases, the distribution converges to
a uniform distribution on the unit disk.

The probability distribution need not be normal. It can be any
distribution, shifted to have mean 0 and scaled to have variance 1/n,
provided the tail of the distribution isn’t so thick that the variance
doesn’t exist. If you don’t scale the variance to 1/n you still get a
circle, just not a unit circle.

We’ll illustrate the circular law with a uniform distribution.... ver más