Message Boards Message Boards

Visualizing Euler's Number

Posted 6 years ago
POSTED BY: Jesse Dohmann
6 Replies

Cool !

It just occured to me: look at this

dm = DistanceMatrix[eList] // N;
evdm = Eigenvalues[dm];
ListLinePlot[evdm]

Whatever that means?

POSTED BY: Hans Dolhaine

The easiest way to get the digits of a real number as a list is to use RealDigits. You could also use the built in time series tools.

POSTED BY: Paul Abbott
Posted 6 years ago

That's pretty interesting! I don't know exactly how to interpret DistanceMatrix wrt eigenvalues (was reading that it can be interpreted as a connectivity measure for graphs, which gives merit to trying to approach visualization as a graph), but it looks very similar to a dampened harmonic oscillator. Unfortunately, I could not get FindFit to get me parameter values that fulfilled the model of one such oscillator a*(E^(-b*t))*Sin[c*t+d] in a way that looked similar.

POSTED BY: Jesse Dohmann
Posted 6 years ago

Hah! I always seem to forget about those unique Wolfram Language functions that would make my life easier...iterating over strings is only intuitive and easy for me because it's a pretty standard technique across languages (probably for performance purposes).

Below is a small performance comparison between methods on my machine. The one using RealDigits is slightly faster (also gave me one extra digit for a full 200 i.e. has better precision); gotta work harder at changing my perspective!

ToExpression[Drop[StringSplit[ToString[N[E, 200]], ""], 2]] // Timing
(*{0.000937, {7, 1, 8, 2, 8, 1, 8, 2, 8, 4, 5, 9, 0, 4, 5, 2, 3, 5, 3, 6, 0, 2, 8, 7, 4, 7, 1, 3, 5, 2, 6, 6, 2, 4, 9, 7, 7, 5, 7, 2, 4, 7, 0, 9, 3, 6, 9, 9, 9, 5, 9, 5, 7, 4, 9, 6, 6, 9, 6, 7, 6, 2, 7, 7, 2, 4, 0, 7, 6, 6, 3, 0, 3, 5, 3, 5, 4, 7, 5, 9, 4, 5, 7, 1, 3, 8, 2, 1, 7, 8, 5, 2, 5, 1, 6, 6, 4, 2, 7, 4, 2, 7, 4, 6, 6, 3, 9, 1, 9, 3, 2, 0, 0, 3, 0, 5, 9, 9, 2, 1, 8, 1, 7, 4, 1, 3, 5, 9, 6, 6, 2, 9, 0, 4, 3, 5, 7, 2, 9, 0, 0, 3, 3, 4, 2, 9, 5, 2, 6, 0, 5, 9, 5, 6, 3, 0, 7, 3, 8, 1, 3, 2, 3, 2, 8, 6, 2, 7, 9, 4, 3, 4, 9, 0, 7, 6, 3, 2, 3, 3, 8, 2, 9, 8, 8, 0, 7, 5, 3, 1, 9, 5, 2, 5, 1, 0, 1, 9, 0}}*)

Rest[Flatten[RealDigits[E, 10, 200]]] // Timing
(*{0.000105, {7, 1, 8, 2, 8, 1, 8, 2, 8, 4, 5, 9, 0, 4, 5, 2, 3, 5, 3, 6, 0, 2, 8, 7, 4, 7, 1, 3, 5, 2, 6, 6, 2, 4, 9, 7, 7, 5, 7, 2, 4, 7, 0, 9, 3, 6, 9, 9, 9, 5, 9, 5, 7, 4, 9, 6, 6, 9, 6, 7, 6, 2, 7, 7, 2, 4, 0, 7, 6, 6, 3, 0, 3, 5, 3, 5, 4, 7, 5, 9, 4, 5, 7, 1, 3, 8, 2, 1, 7, 8, 5, 2, 5, 1, 6, 6, 4, 2, 7, 4, 2, 7, 4, 6, 6, 3, 9, 1, 9, 3, 2, 0, 0, 3, 0, 5, 9, 9, 2, 1, 8, 1, 7, 4, 1, 3, 5, 9, 6, 6, 2, 9, 0, 4, 3, 5, 7, 2, 9, 0, 0, 3, 3, 4, 2, 9, 5, 2, 6, 0, 5, 9, 5, 6, 3, 0, 7, 3, 8, 1, 3, 2, 3, 2, 8, 6, 2, 7, 9, 4, 3, 4, 9, 0, 7, 6, 3, 2, 3, 3, 8, 2, 9, 8, 8, 0, 7, 5, 3, 1, 9, 5, 2, 5, 1, 0, 1, 9, 0, 1}}*)
POSTED BY: Jesse Dohmann
Posted 6 years ago

This is more convenient, at least for me.

Rest@Flatten@RealDigits[E, 10, 200]
POSTED BY: Okkes Dulgerci

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract