Group Abstract Group Abstract

Message Boards Message Boards

[WSG23] Daily Study Group: Wolfram for Mathematics Research and Study

Posted 2 years ago

A Wolfram U daily study group covering the implementation of Mathematica and Wolfram Language for mathematics topics ranging from function visualization to upcoming calculus functionality begins on May 22, 2023 and runs through June 1. This study group will run on weekdays from 11:00AM–12:00PM Central US time. (We will not meet on Memorial Day, May 29, and Friday sessions will start at 10:30AM for extra review time.)

REGISTER HERE. I hope to see you there!

This study group is a fantastic way to learn about the amazing mathematical capabilities built into Wolfram Language. We will cover a very broad variety of topics, including but not limited to function visualization, linear algebra and graph theory, differential equations and even fascinating topics such as number theory and asymptotics. Several sessions will be led by the Wolfram developers who work on the mathematics functionality that we'll be covering!

While this study group is aimed at mathematics students at roughly the graduate level, no prior Wolfram Language experience is necessary—the first day will be dedicated to getting you up to speed with the language itself. As usual, we will have questions, study materials, quizzes along the way to help you master the subject matter and functionality.

enter image description here

POSTED BY: Arben Kalziqi
74 Replies

I could use some advice on recommended ways to write functions. The function I am trying to write factors numbers. I am specifically targeting large numbers that have two prime factors. I want to eliminate all of the obvious factors (e.g. 2, 3, 5 etc.) So I started to write the following function, where c is the number being factored. I imagine there are several ways to factor a number by inspection, so far my function only has two tests, but could have more. Should I use Catch[] and Throw[] or Return[] or something different?

factorByInspection[c_]:= (
Catch[
If[EvenQ[c], Throw[{2, c/2}] ]
If[divFiveQ[c],Throw[ {5, c/5}]]
])
POSTED BY: Michael O'Connor

Hi Mike—please check out my answer in the thread for the current Study Group: https://community.wolfram.com/groups/-/m/t/2972173

POSTED BY: Arben Kalziqi
Posted 2 years ago
POSTED BY: Phil Earnhardt

Hey Phil—that's a totally reasonable solution to that problem, yes. The only issue is that the autograder used there is quite a complicated object, and it doesn't always get everything right. (For quizzes and other assessments, we try to update it whenever we find one of these false negatives, but it's not always possible.)

I thought that Counts[StringContainsQ[StringTake[WordList[], 1], "q"]][True] might be taken a little bit better, but no dice :)

POSTED BY: Arben Kalziqi
Posted 2 years ago
POSTED BY: Phil Earnhardt
Posted 2 years ago

Arben, Thanks for your description of the quiz festivities. I wonder how Wolfram knows to calculate the grade on the download file if it isn't via a live wire. I used your manual copy from my downloaded quiz to the one I thought was the real thing, and neither saved my answers. Bob

POSTED BY: Robert Lyons
Posted 2 years ago

Hi, Arben! I very much appreciate the work that you and your Wolfram colleagues put into this class --and all the other classes I've taken. You make it fun to work on and learn even the most complex topics.

I have some questions about the admin of the final quiz. I downloaded my own copy of the quiz, and I left the original in my collection of web artifacts. I filled in the answers and got an automatic grade for the test. I saved the test back to the collection of web artifacts, but when I open it, it's blank. Did the quiz results make it to you, and where can I find my filled in copy of the quiz? Thanks for a great course! Bob

POSTED BY: Robert Lyons

Hi Robert—thanks for your kind words! I think that the giest of what Phil said is correct—probably you ought to submit the quiz directly online. Let me know if that doesn't work, and we'll look into it!

POSTED BY: Arben Kalziqi
POSTED BY: Carl Hahn
Posted 2 years ago
POSTED BY: Phil Earnhardt

Hi everybody—the completed Differential Geometry notebook (with my and John's parts in addition to some of the extra references John made live) is now available in the materials folder.

Good luck on the quiz!

EDIT: I should also note that the review, including the "mini-lecture" on the intersection of linear and differential operators, Hamiltonian mechanics, differential eigensystems, and so on has also been uploaded in full.

POSTED BY: Arben Kalziqi
Posted 2 years ago

Great course! Thanks, Arben & Co.
But there may still be a bug in the use of a quiz by itself without a framework showing overall progress. I took it on Saturday and got 89% correct (16 correct out of 18). It said I could take it again if I wanted but also didn't confirm I had now passed the quiz. Even without the framework, it should not leave the student in the dark in respect to passing the exam. The same issue happened a few weeks ago in another Wolfram-U course. (I am running MacOS 12.6.6 & Safari 16.5.)

POSTED BY: John Davidson

Great point, John—we'll be doing this going forward. (We have that in our MOOC quizzes but hadn't implemented it yet in our standalone ones.)

POSTED BY: Arben Kalziqi
Posted 2 years ago
POSTED BY: Phil Earnhardt
Posted 2 years ago
POSTED BY: Phil Earnhardt

Yep, I get you! How about this? (It's been a long time since I've heard or thought about Larmour frequencies, so let me know if this is not right.)

POSTED BY: Arben Kalziqi

Thank you Arben. Great study of simple physics. I could not do it, but know I know how.

Really enjoyed the study group. Re-learned a lot I had forgotten and many new capabilities I never knew before. The quiz is fun too. Looking forward to a next time.

Larry

POSTED BY: Laurence Bloxham

Thanks Larry; I'm glad it was helpful! hopefully it paves a path forward for you to analyze and visualize other systems. I'm happy that we were able to to introduce and re-introduce you to various functionality, too!

POSTED BY: Arben Kalziqi
Posted 2 years ago

FWIW, I have gone through several study groups with Version 12.2 (on MacOS). It's not optimal to do this, but I've had no major problems. For many reasons, I plan to upgrade soon. I'm certain that Wolfram U staff posts with the most recent version (which can always be found here). Current version is 13.2.1.

There's always a cost to not being current. There was a question on this quiz that I wanted to make sure my answer was correct against the current version. To do this, I opened a notebook on cloud.wolfram.com and evaluated the expressions there. In any case, it's worth being familiar with accessing WL Notebooks through the cloud.

POSTED BY: Phil Earnhardt
Posted 2 years ago

I figured out my problem. Sorry for the last msg.

POSTED BY: Peter Fedkiw
Posted 2 years ago

I downloaded the notebooks for the study group today, and I found that I receive an error message on opening some of the lesson books. So, for example, I can open and read the notebook file "Linear Algebra and Graphs" but the file "WGS40-Asymptotics" does not open. I receive a Mathematica-generated error dialog box "Why the Beep" that tells me "This notebook was created in a more recent version of the Wolfram System ..." I am running version 13.2.1.0. I hope that you can help me fix the issue.

POSTED BY: Peter Fedkiw

Hi Peter—there's no issue, it's just a warning that the notebooks were made in a newer version so there might be some functionality that doesn't work because it doesn't exist in your installation.

POSTED BY: Arben Kalziqi
Posted 2 years ago

When I open the "Linear Algebra ..." notebook (and others that generate the same error message), the only page that appears in the notebook is the title page. There is no other content in the notebook (well, at least that I can see). BTW .... What version was used to create the "Linear Algebra ..." notebook?

POSTED BY: Peter Fedkiw

That would have been created on 13.3, probably. We should have set this in the notebooks we uploaded, but looks like we missed this—that notebook is in slideshow view. Just go to Format -> Screen Environment and change that to Working, and it'll become a scrollable notebook rather than a presentation notebook.

POSTED BY: Arben Kalziqi

I have a (mathematically) simple homework question today, but one that I think is a good exercise for people to try out—especially if they're newer to Wolfram Language.

  1. The function tanViz from today's lecture currently only accepts a function and has predefined ranges for its two parameters. Modify tanViz so that it accepts ranges (as lists) for the two parameters u and v as inputs. That is, an input should look like: tanViz[surface,{ui,uf},{vi,vf}]. The resultant Manipulate object will then have sliders that range over the values that you specify.

  2. Modify the Manipulate object such that it has a Slider2D input for the two parameters, as you saw in the Hamiltonian example from Tuesday. This will let you change u and v simultaneously.

POSTED BY: Arben Kalziqi

Tuesday's example of the Hamitonian classical mechanics was in 1 dimensional phase space. How should the code be modified to model n-dimensions?

POSTED BY: Laurence Bloxham

It was in two-dimensional phase space, right? Or perhaps you mean that the phase space path was a plane curve with only one parameter? You can use ParametricPlot3D to plot space curves (for, say, a one-parameter three-dimensional phase space, like observing how position, momentum, and energy change as a function of time) or surfaces (for a two-parameter three-dimensional space).

If you mean the equation-solving itself, then you simply add more equations and variables to the (N)DSolve, though that can quickly increase the solution difficulty of course.

POSTED BY: Arben Kalziqi

Help me with the 2d Hamiltonian: H[q1,q1,p1,p1,t]. q1'=dH/dp1, q2'=dH/dp2, p1'=-dH/dq1, p2'=-dH/dq2 all partial derivatives. Hspace i R^2d+1.

POSTED BY: Laurence Bloxham

Thank you for your help. A Hamiltonian for a particle moving in a plane experiencing a magnetic field orthogonal to the planes is: H[q1,q2,p1,p2]= 1/2m (p1-Bq2)^2 +p2^2.

Seek solution to Hamilton's equations and the general solutions for the trajectory of the particle.

POSTED BY: Laurence Bloxham

Does H not depend on q1, or is that dependence encoded into the magnetic field?

POSTED BY: Arben Kalziqi

I am trying to describe the dynamics of a particle confined to the plane. There is no q1 dependence. The trajectories should be circles in the plane with the Larmour frequency. Hope I am making sense. Thanks again.

POSTED BY: Laurence Bloxham

enter image description here

Hi, I am trying to work with the notebook from the "Differential Equations" lecture yesterday. For some reason, when I run the DSolve code, it's giving me this error message: I'm not sure if it's because I ran the code out of order but I tried deleting the notebook and redownloading it and it's still showing this. Any idea of how I can fix this? I'm new to mathematica so I'm sure I'm missing something basic.

I also don't understand why the numbering on the In[#] and Out[#] is continuous throughout all the different notebooks I have. Is there a way to make them separate? Thanks so much!

POSTED BY: Allison Byars
Posted 2 years ago
POSTED BY: José Dordá
POSTED BY: Arben Kalziqi
Posted 2 years ago
POSTED BY: Phil Earnhardt
Posted 2 years ago

Hi Phil, thanks for the suggestion; I will Reload a Community page before I post next time. It's a good practice in general as I also missed the latest post by Arben Kalziqi.

POSTED BY: Dave Middleton

Hi Phil,

Thank you for your feedback. We have sent you a message on your email address.

POSTED BY: Ahmed Elbanna

There were two questions for previous presenters to which I've just received answers:

A question for Lusine, who gave the talk on number theory:

I would be interested in what is the title of the book about number theory and when the new online course is expected to be launched on number theory mentioned during this session.

Lusine notes that the book is not yet complete and the title has not been finalized, but it will probably have a rather traditional name like Introduction to Number Theory.

A question for Jaebum, who gave the talk on linear algebra and graphs:

I would appreciate if you could mention some references (e.g. books, articles, web pages) that contain already accomplished research topics in Wolfram language related to graphs.

Jaebum has provided three examples:

  1. Analyzing Narratives in Social Networks
  2. Operator Calculus on Graphs, Theory and Applications in Computer Science
  3. Functional Networks with Applications
POSTED BY: Arben Kalziqi
POSTED BY: Claude Pelletier
Posted 2 years ago

Send an e-mail to wolfram-u@wolfram.com with any administrative questions.

[Not an admin, but I know the answer to this one!]

POSTED BY: Phil Earnhardt

Phil is right! We did have an issue with another user's email address on BigMarker's end for some reason, so maybe the same thing is happening to you. We're looking into it!

EDIT: Actually, this was fxed during the minute I typed this post. You should be good to go now.

POSTED BY: Arben Kalziqi

Thanks!

POSTED BY: Claude Pelletier

Hi Claude, I have reached out to our event platform and you should now receive the notification emails. It seems you had unsubscribed from the BigMarker emails at some point.

Please let me know if you have further issues or questions.

Best Wishes, Cassidy Hinkle

POSTED BY: Cassidy Hinkle

Great thanks!

POSTED BY: Claude Pelletier

I'm glad you think so! I agree that it's nice to reduce ambiguity in this way; it's been helpful to my students in the past as well (who would often get confused by notation when learning about vectors, for example).

POSTED BY: Arben Kalziqi
Posted 2 years ago

My brain gets lost in bracket hell with deeply nested [[],[[],[[]]],[[]]] even when they are nicely indented. I find that using postfix operations makes these expressions much easier to understand. E.g.

Of the first 1000 primes which ones have a digit sum that is also prime?

Select[Map[Total, AssociationMap[IntegerDigits, Prime[Range[1000]]]], PrimeQ]

Range[1000] // Prime // AssociationMap[IntegerDigits/*Total] // Select[PrimeQ]

To understand the first one you have to work from inside to out. The second one maps naturally to the question in left-to-right, easy to read, and understand order.

POSTED BY: Rohit Namjoshi

It is interesting to note that learning to work "inside out" with functions is a struggle many learners of traditional math notation have as well. The prefix (@), postfix (//), and functional ([]) styles of notation can be mixed and matched however makes the most sense for you in a given problem.

POSTED BY: John McNally
Posted 2 years ago

Reverse Polish notation :) Reminds me of old HP calculators [...]

If you still have a longing for those fabulous HP calculators of lore, you can now scratch that itch. There's a Swiss startup that is making modern implementations of RPN calculators inspired by the old 16C, 42S, and 41CX machines. I'm grateful that somebody had the capability and the nerve to resurrect these machines. I'm also grateful that the US printer toner company that created those calculators doesn't sue that startup into oblivion.

POSTED BY: Phil Earnhardt
POSTED BY: Carl Hahn

Indeed, I wind up doing that myself pretty frequently. The only thing to keep in mind is that f[{x,y,z}]!=f[x,y,z], of course, but if you're defining your own functions it isn't a big problem.

However! If you take advantage of Apply (@@) and MapApply(@@@) and understand how slots work, you can mix and match and get the best of both worlds.

POSTED BY: Arben Kalziqi
Posted 2 years ago
POSTED BY: Peter Fedkiw
POSTED BY: Devendra Kapadia
POSTED BY: Arben Kalziqi
Posted 2 years ago
Attachments:
POSTED BY: José Dordá

Thanks Jose, this looks great! (and of course, I appreciate the Manipulate.)

There's a more compact way to write the pattern-matching for the initial SparseArray, if you're interested—recall that the Conditional statement can be any computation at all, not limited to checking equality, for example. I'm not sure if that's enough of a hint, but I'll post my version as a reply to this if you like, as I wouldn't want to spoil it before you've had a chance to think of it.

POSTED BY: Arben Kalziqi
Posted 2 years ago
POSTED BY: Phil Earnhardt
POSTED BY: Arben Kalziqi
Posted 2 years ago

I think it's OK to use Abs to see the "distance" from the diagonal. OTOH, your code ends of applying that test to every cell (or, at least, the calculated value of the coordinates of every cell) in the matrix. You're doing a bunch of superfluous computation; it should be slower:

I'm gonna give that a No Pass.

POSTED BY: Phil Earnhardt
POSTED BY: Arben Kalziqi
Posted 2 years ago

Dear Arben,

Just missed your reply with the solution of Part 1 (no browser refresh).

I joined the Study Group in the second week. Apparently, I posted my solution as someone else (Vitaliy Kaurov, WOLFRAM Research) which is very weird (I used a VPN). The impersonated post is below. I reported the issue to Wolfram Support.
[Update] WR has restored my post attribution.

POSTED BY: Dave Middleton

Thanks for letting us know, Dave—there's a strange issue with Community which sometimes occurs where the original username gets removed, and our "default" username in cases like those is Vitaliy's (ostensibly because he's the Director of Community Engagement).

POSTED BY: Arben Kalziqi

Arben, what did you mean by " I agree about local documentation; I really prefer it even though we don't bundle it by default anymore since it's gotten so large (though it's easy to download and install anyway)." I am running 13.0.0. and it seems to me my documentation is local, but I don't remember doing anything special to download it. I am going to upgrade one of these days and that gave me pause. I wouldn't dream of not having the full documentation local and be subject to Internet access. What has changed?

POSTED BY: Carl Hahn
POSTED BY: Arben Kalziqi
Posted 2 years ago

Is it this Arben for the Part 1 code?

Normal@SparseArray[{{i_, j_} /; (Abs[i - j] <= 1) -> 
     PrimePi[i + j]}, {10, 10}] // MatrixForm
POSTED BY: Dave Middleton
Posted 2 years ago
Attachments:
POSTED BY: José Dordá

Yes José, that's basically the idea—the only difference is that I used Abs instead of checking whether it was between ±1. I'll check out your notebook when I have the chance, hopefully today.

POSTED BY: Arben Kalziqi

Hi Alexander, in the details section of the documentation of FindEquationalProof, it clarifies this somewhat. In cases where the function is able determine it is not possible to prove the given theorem from the axioms, it will return a Failure object. However, as you mention, in full generality it is not possible to decide this and the only option is to let the program run to see if it terminates. For this reason there is also a TimeConstraint option to impose an artificial limit on how long the function will keep running. You can also manually stop any ongoing evaluation by clicking Abort Evaluation under the Evaluation menu in the user interface.

POSTED BY: John McNally
Posted 2 years ago
POSTED BY: Phil Earnhardt

Hi Phil—hopefully John and Charles were able to answer your question in the webinar chat today. To wit, they mentioned that certain trigonometric simplifications were available via FullSimplify which wouldn't be tried with Simplify, and that this could result in simpler results at the cost of slower speeds. John also mentioned that there are trig-specific simplification functions like TrigExpand which can work several orders of magnitude faster than either of the more general simplification functions.

POSTED BY: Arben Kalziqi
Posted 2 years ago

The study group schedule notes that the Thursday June 1 session is about probability and differential geometry. I have a question about torsional forces. As noted in the wikipedia:

In the differential geometry of curves in three dimensions, the torsion of a curve measures how sharply it is twisting out of the osculating plane. Taken together, the curvature and the torsion of a space curve are analogous to the curvature of a plane curve.

I'd love to see a computation and visualization of the torsion of a 3D curve in the Wolfram Language. If this doesn't fit into the scheduled presentation, could you show an example (with WL Notebook) in the community discussion here? Thank you.

POSTED BY: Phil Earnhardt

Hi Phil! That's a lovely suggestion; I'll see if I can work it in.

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