[WSG24] Daily Study Group: Elementary Introduction to Wolfram Language

A Wolfram U Daily Study Group on Elementary Introduction to Wolfram Language begins on Monday, September 16.

Join me and Eryn Gillam and a group of fellow learners to learn about programming in Wolfram Language. Our topics for the study group include list manipulation, using and making functions, using dynamic functionality, and working with images, sounds, shapes, and colors.

No prior Wolfram Language experience is required.

Please feel free to use this thread to collaborate and share ideas, materials and links to other resources with fellow learners.

Dates and Times:

September 16th-October 4th,
11am-12pm CT (4-5pm GMT)

Register Here

9 Likes

I love the exercise grading engine for the EIWL interactive course. Submitting code fragments is so much better than multiple-choice questions. Will we be doing the exercises from there in this course?

Hi Phil! We’re glad you like the system, and I completely agree! Big fan of code fragments rather than multiple choice.
Yes, we’ll be doing the exercises as part of the Daily Study Group this session. Looking forward to seeing you there!

One other recommendation you may want to announce to the class: if you download directly the notebooks for EIWL, you can “read along”. Those notebooks will play in the Wolfram Language App. They will also download and play them in the Wolfram Player.

The notebooks for this course are pretty big: 250MB.

2 Likes

How would you define a function for tetration (next operation after exponentiation - spell checker really wants titration)? Or something more general to continue the operations to higher values. This easily produces exceptionally large numbers which can quickly exceed a computer’s capacity.

Exercise 2.5
Use Plus and RandomInteger to generate a random integer between 10 and 20.

→
(Your solution)

RandomInteger[{1,10}] → generates a random number between 1 and 10

Then,

Plus[RandomInteger[{1,10}, RandomInteger[{1,10}] → generates a random number between 2 and 20, not between 10 and 20

(My solution)

RandomInteger[{5,10}] → generates a random number between 5 and 10

Thus,

Plus[RandomInteger[{5,10}, RandomInteger[{5,10}] → generates a random number between 10 and 20

  • What do you think?

  • I tried your solution to doublecheck my idea. Then, the output is between 2 and 20, as attached.

→

The framework also says that it is not correct.

→

Then,

what is the correct answer???

Exercise 2.4
Use RandomInteger to geneerate a random integer between 0 and 1000.

(Your solution)

RandomInteger[1000]

→ However, based on the definition of RandomInteger and Wolfram Documentation (RandomInteger—Wolfram Documentation),

There are two answers: (My Solution)

RandomInteger[1000]

RandomInteger[{0, 1000}]

  • what do you think?

I think a good answer would probably be the easiest (in class, I was aiming to show a more complex solution)

Plus[10, RandomInteger[{1,10}]

It’s a shame the framework doesn’t take your RandomInteger[{0,1000}] solution, that seems reasonable to me. But I imagine that the designers want you to use the simplest iteration of the code, which would be RandomInteger[1000], as it’s unnecessary to specify that you want between 0 and 1000, as the default minimum is 0.

Hi! It looks like there’s a resource function that does what you’re looking for here.

An easy way to use a resource function is to hover over the title of the function on the webpage so you get the click-to-copy UI, then click on the copy button and paste it into your notebook.

You can also use the scratch notebook within the framework!

1 Like

Exercise 3.6
Plot a list that counts up from 1 to 100, then down to 1.

→

(My solution)

As attached,

ListPlot[Join[Range[100],Reverse[Range[100]]]]

→

However, the framework says that it is not correct.

→

Then, what is the correct answer??? And, why???

  • Rory, it seems like that many exercise answers are not correct (lol). → Should I post each of them whenever I find them?

Heya! For this one, your answer isn’t quite correct. It’s asking for a list going up to 100 and then back down to 1, and you have 100 twice. See if you can use Range to stop the repeated number, and then it should be correct.

1 Like

Exercise 3.9

Find a simpler form for
Join[{1,2},Join[{3,4},{5}]]

→
(My solution)

Join[{1,2},{3,4},{5}]

→

My solution is correct. However, the framework says that it is not.

→

What is the answer? (not again..)

The problem with the framework is that it will only really take the answer it’s expecting to get. The simplest form of this question is Range[5], which is the correct answer. I agree that the question isn’t super clear that it’s wanting you to actually rewrite the code, rather than simplify the current code.

I believe in you! Keep on double-checking your answers and exploring new ways to get to the solution when your first thought doesn’t work.

Exercise 1.4
Compute 5 squared (i.e. 5x5 or 5 raised to the power 2)

→

(My solution)

5x5

5^2

→

the framework says only 5x5 is correct.

→

both of them are correct answers, right? (Hmm… too many wrong answers..)

I misunderstood the question? I thought that Exercise 3.6 asks me to plot a list from 1 to 100 and then from 100 to 1.
→
Based on your answer (THANK YOU!), I solved it like the below attached. However, it is not correct. I tried tot use “Plot”. However, it wouldn’t work. As I know, “ListPlot” is the only way to plot it.
→
Did i get it wrong again?

Yes. The engine tries hard, but it doesn’t always get it right. When the examples get more complex, the engine gets far more interesting. I’d love to have a peek under the hood.

You’ve gotten right answers shown as wrong by the grading-engine. The real challenge is to submit a wrong answer and have the engine judge it as right. Game on, @Soomi

THANK YOU!
I thought that we needed to find out the simplest way to make {{1,2},{3,4},{5}} into {1,2,3,4,5}.

→
I understand it now.

Thank you for the pep talk, Phil - you are the smartest and the best Wolfram learner, as I have observed. I really appreciate it.
I do hope that the answers (all correct ones) and solutions are available once we finish each exercises.

1 Like