[WSG22] Daily Study Group: A Guide to Programming and Mathematics with WL

A new study group on the topic “A Guide to Programming and Mathematics with the Wolfram Language” will begin soon.

Join a cohort of fellow learners and expand your understanding of core programming topics as well as symbolic and applied mathematics functionality in the Wolfram Language with lessons by veteran instructor and developer David Withoff. A basic working knowledge of the Wolfram Language or introductory-level skill in any programming language is recommended.

April 18–May 6

11am–12pm US CT (4–5pm GMT)

REGISTER HERE

11 Likes

Do we have to post a reply to join the group?

Hi Joel,
You can join the Wolfram Community and participate in any discussion thread. This particular thread is dedicated to the Daily Study Group: A Guide to Programming and Mathematics with the Wolfram Language. You can click on “Follow this Post” to receive notifications of any activity on this thread.

Caesar Cipher example and Day 1 exercises have been added to the download folder.

2 Likes

Please help me to fix this attempt to modify the p in addition to q and r:

Range[10]/.{p___,q_,r_} ->  { #^2&/@p, q r } 

(motivated by the 1st example from the ‘Rule-Based Programming’ section of the first class NB).

Also, transformation p-> 2*p leads to a strange result:

In[37]:= Range[10] /. {p___, q_, r_} -> {2 p, q r}      Out[37]= {**80640**, 90}

Thanks.
M

PS What is wrong with using #^2&/@p where p corresponds to 8 initial elements of the list, given that
“#^2&/@Range[8]” works as expected.

Is it possible to access the NB files and quizzes for this class in the cloud?

Hello Michael,

While the notebooks are only available in the downloadable form right now, they will soon be available as part of the new interactive course on the Wolfram U site (as cloud notebooks). We just do not have a confirmed release date for that course yet.

The quizzes (with multiple choice questions) to be completed for Certificate of Program Completion will definitely be available on the cloud - same a other Daily Study Groups so far.

If you are referring to the programming exercises we added to the download folder, I think we can try to share cloud published versions of the exercises by the end of the week.

1 Like

Hello, Abrita, and thank you.
M

Are we able to get copies of the exercises so we can work them offline to ensure we understand?
Thank you!

1 Like

Where is the link to the download folder?

Hi, I can watch the lectures as a recorded video. Is there an another way to get certificate of progtam completion rather than solving multiple choices problems on live sessions?

Responding to multiple-choice Qs does not contribute to certification. It’s for self-testing. Watching the lectures and passing the quizzes do.

That is correct. Thanks Michael.

The requirement for certificate of Program Completion for the study group is attending the live sessions and passing the online quizzes with a score of at least 60%. We will release 3 quizzes over the entire duration of this 3-week study group and you will have time till may 13th to complete all the quizzes.

Posted exercises for days 1, 2 and 3 in the series download folder.

1 Like

Hi Syd, The link is included in the reminder emails you have been receiving from the Wolfram U Team. It is also shared during the session.

The following code should explain what parts of the expression Range[10] are matching p, q and r:

Range[10] /. {p___, q_, 
r_} -> {{"This is p: ", p}, {"This is q: ", q}, {"This is r: ", r}}

This is the output you get:

 {{"This is p: ", 1, 2, 3, 4, 5, 6, 7, 8}, {"This is q: ", 9}, {"This is r: ", 10}}

So what is essentially happening with the {#^2 & /@ p, q r} part of the expression is {#^2 & /@ 1, 2, 3, 4, 5, 6, 7, 8, q r} i.e. #^2 is mapped over the single element 1 and therefore gives the result {1, 2, 3, 4, 5, 6, 7, 8, 90}

This would give the expected result:

Range[10] /. {p___, q_, r_} :> Join[#^2 & /@ {p}, {q r}]
1 Like

Awesome! Thank you very much, Abrita.
Best.
M

Range[10] /. {p___, q_, r_} :> {Hold[ 2 p], q r}

shows what’s happening with 2 p. It is computing 2X2X3X4X5X6X7X8

p (from the RHS of the rule) is really a fragment of an expression. It needs to be explicitly turned into a list to get the output you are looking for.
Maybe something like:

Range[10] /. {p___, q_, r_} :> Append[2 {p}, q r]
1 Like

Abrita: “So what is essentially happening with the {#^2 & /@ p, q r} part of the expression is {#^2 & /@ 1, 2, 3, 4, 5, 6, 7, 8, q r} i.e. #^2 is mapped over the single element 1 and therefore gives the result {1, 2, 3, 4, 5, 6, 7, 8, 90}
This would give the expected result:
Range[10] /. {p___, q_, r_} :> Join[#^2 & /@ {p}, {q r}]”


Thanks!
This opens a window to many opportunities such as this one:
Range[10] /. {p___, q_, r_} :> Flatten[{2 {p}, {q r}}]. Yet, I still have a question: what kind of object is p without {}? In other words, what is the sequence of “bare” comma-separated numbers from the WL perspective? I understand that in our case it is a “list” of arguments. But this is not a List. What is it?

Maybe you have already responded by saying that this is a fragment of an expression.. But there should be also some rules (default) telling M how to treat those…
Could you please clarify?

For example, what is the rule leading to 2 p = 2X2X3X4X5X6X7X8? It even seems to contradict the treatment of p in the previous example where p was reduced to its first element (as you said, the “single element 1”).

Thank you.
M

With more than 24 new functions per second, one probably has to assume a movie. Nevertheless, the study group is absolutely fascinating, and offers many new insights.

2 Likes