[WSG23] Daily Study Group: Wolfram Language Basics

Hello all,
please see notebook.

514200380.nb (54.4 KB)

Of course! I’ve received confirmation that this is the right way to think of this, and suggested a way of looking at the expression that might make this clearer still: ExpressionTree[u, "Subexpressions"]

Hi Peter! It’s a fair point; I was mixing up my comparisons in a way that could well be confusing. Honestly, my intent was not to make a fair comparison between a properly-specified loop construct and mapping, but to—maybe a bit too theatrically—demonstrate that the former is messy and “redundant” compared to the latter.

(And re: list[i], I think the audio should indicate that the idea was “something like” or “some function of” or “something to do with”, trying to indicate that inside the loop, we’d be doing something that required us to index list with a dummy variable, whereas with Map we wouldn’t need to do that.)

Still, it could lead to confusion, so my apologies for that!

In data visualization, I am trying to visualize the relationship as to how the surface area of a sphere and its volume changes as the radius increases using the two formulas below:

Surface area of a Sphere - 4 [Pi] r^2
Volume of a Sphere = 4/3 [Pi] r^3

I am using Manipulate[] function to increase the radius - see attached. However, visualization of the output is difficult since the output of the surface area is in square meters and the output of the volume is in cubic meters - two different units of measure. Please give me some direction as to what visualization function to use.

Thanks,

Mitchell Sandlin

AreaVsVolume.nb (4.52 KB)

Hi Mitch—you could calculate their ratio, or perhaps use the QuantityMagnitude function?

Hi everybody—I’ve added today’s data files to the Course Materials folder, so you can now use them while trying out today’s notebook yourself.

Arben,

Don’t know whether it’s germane to the discussion today, but can you explain the difference between Animate[], and Manipulate[]? To me, they appear to do the same thing.

Thanks.

It’s a totally relevant and reasonable question to ask. They are indeed very similar, and I don’t believe Animate does anything that Manipulate can’t: it’s basically a stripped down version of the full Manipulate interface which has fewer possible options and which automatically begins animating upon evaluation, that’s all!

1 Like

Fortran and its children has been around since the late 1950s. i, j, and k – even the rarely-used k – have had a glorious 65 years in the sun. We should stop invoking their name (and their semantics) in the age of functional programming and fluid mappings. We should honor their heritage – but only in museums and history books.
[Feel free to steal this for future classes, Arben.]

1 Like

I am having troubles importing the exercises into Wolfram Cloud application. I am working on android tablet and I extracted the exercises into Download folder. There is no import option. Please help.

1 Like

Hi Alex—frustratingly, as far as I can tell, the application doesn’t have the option to import a notebook. However, if you go to https://wolframcloud.com in your web browser, you should be able to upload the notebook from there and then interact with it through the app.

2 Likes

Hello all, please see notebook.

29144207.nb (7.71 KB)

Hello,
i, j, and k are still legitimate names wherever the user of a language has a choice at all. Fortran speciality was that names starting with i,j,k and as a matter of fact l,m, and n were associated with integers if not otherwise specified. Later descendants of FORTRAN avoided giving any pre-defined semantics to names; PL/I took an extreme attitude and despite being a colossal language had no reserved words at all, cf.
https://www.ibm.com/docs/en/epfz/5.3?topic=sbcs-identifiers Therefore, in subprograms it was mandatory to supply declarations with attribute BUILTIN if desired to revert to the original definition of standard functions.

Hello, i, j, and k are still legitimate names wherever the user of a
language has a choice at all.

You completely misunderstood. I wasn’t talking about the semantics and interpretation of any programming language. I was talking about the meaning of those variables that has been burned into the brains of generations of programming students. I did think it was kinda neat that some version of [iteration variables] have been around for ~65 years – the traditional age of retirement – and perhaps it’s time to give [iteration variables] a metaphorical retirement.

Hi all;
Let’s work out the final example of the already quoted

Expressions—Wolfram Documentation)

Level[u, {-2}]
We must determine
“The parts of u at level -2 are those that have depth exactly 2:”
We refer to the drawing as in the above documentation, assuming a directed graph whose edges point “downward” in the representation.

the Depth of the root is 4, corresponding to the 4 levels, arranged horizontally in the given representation (Of course, the concept of Depth is independent of the drawing) In the f-a-h-f-line, the depths are 3-1-2-1 respectively.
In the g-a-a-line, the Depths are 2-1-1 respectively
This yields the desired result.

Why aren’t the technical writers of Wolfram able to give proper recursive definitions of this stuff?
Cheers
Peter

A few questions from a beginner:

  1. All Functions: the basic syntax of functions, how to interpret and resolve error messages, how to use help pages, how to find the best function(s) to use in a given situation
  2. Shortcuts/Cheatsheets: Keyboard, shortcut keys, and other cheatsheets pages to help navigate the syntax, system, etc.
  3. Best practices/tips and tricks: writing code, debugging, making it intelligible to others, most useful general functions, etc.
  4. Entities/Datasets: list of available items, how to best pull data, identify data elements available within in, the best way to utilize, etc.
  5. Specific functions: MAP and related functions - step x step and primary ways it’s used. How to find the longest word in WordList[]
    Thanks.
1 Like

That’s a wonderful initiative to spread Wolfram to new learners. Thanks @Arben.

2 Likes

Drawing Tools palette: where can I find it in Mathematica 13.2 on a Mac?
I do not see it in the Graphics menu or the Palettes menu.

Hi Peter, please see the documentation for Depth, noting specifically that Depth takes one argument—expression depth in this sense is not context-dependent.

It’s the same situation in the iPad/iOS flavor of the app.

I think I had to upload notebooks from the desktop version during my previous testing. :frowning:

The web interface has a button which will allow you to upload notebooks…