- 12.7
Generate a sequence of 10 notes with random pitches up to 12 and random durations equal to a random multiple of tenths of a second up to 10 tenths of a second.
->
what does "a random multiple of tenths of a second up to 10 tenths of a second" mean? I think that it is rambled. My idea is that it may mean "RandomInteger[10]/10." Thus, I tried and "Correct" Answer was marked. Then, is that the correct English expression???
|
|
|
The interesting part of this question in my mind is that:
RandomInteger[10] is picking an integer from {0,1,2,3,4,5,6,7,8,9,10} which includes 0.
So a Note with 0 time will simply disappear. I think a few run of the code you can find some evaluation only having 9 (or less) "real" Notes.
In theory, it is possible this piece of code generate nothing.
|
|
|
After coming back from my running of the day for refresh, I read your respose (THANK YOU!), Jingzhou Na. Then, I read my question. Ah-ha! Now, I understand that it was, yes, rambled, but the correct English. However, again, lol... Is there any crystal-clear expression on it?
"a random multiple of tenths of a second up to 10 tenths of a second" THANK YOU again, Jingzhou Na.
Attachments:
|
|
|
Agreed Soomi, this question seems a little tough to parse. Glad you found a solution!
|
|
|
Our discussion of GeoListPlot today reminded me about a short project I did a while back. In the fall of 2023, my good friend Gil Hedley announced his Nerve Tour, a 111-city one-day educational tour through the United States and Canada. I remember thinking, "Aha! He hasn't done a computational plot of his tour. I can do that in the Wolfram Language." Here's the code I came up with:
giltour = Import["Downloads/gil-tour.txt", "Text"];
tourdata = SemanticImportString[giltour];
datesortedtour = tourdata[SortBy["column2"]];
GeoListPlot[
Table[Interpreter["City"][datesortedtour[All, "City"][[n]]], {n, 1,
Length[datesortedtour]}], Joined -> True, GeoLabels -> True]
The results are rather spectacular: 
If anyone would like to run the code, I have attached the gil-tour.txt file to this message. Warning: it takes several minutes to run on my Apple M1 MacBook Pro. YMMV (that seems like an appropriate acronym). This is the actual route that Gil computed [manually] and is taking. It occurred to me that Gil's schedule is a variation of the "Traveling Salesman Problem". It's the Traveling Educator Problem. The Wolfram Language has support for solving that kind of problem. I may try that in the next few days. If anyone is interested in coding the shortest path for Gil's education odyssey, have at it. One note: Gil was using a camper for his housing during the tour. He toured cities up north in warm weather and southern cities in the winter months. If you wanted to best Gil's manually-constructed path, your solution would have to reflect similar seasonal constraints. Code like this is fully within the capability of anyone in this course. You just have to have the proper drive/curiosity to find a problem you'd like to solve in the language. Have at it!
Attachments:
|
|
|
Please check the attached file link. I am getting an error message.
|
|
|
No file was attached to your message.
|
|
|
Problem solved for ex16.1, correct answer is EntityValue[Entity["Country", "Switzerland"], EntityProperty["Country", "Flag"]] It seems for ex16.1, the system really want "everything". I used "Flag" for second argument and the checker marks it as "incorrect" (only for ex16.1)
EntityValue[Entity["Country", "Switzerland"], "Flag"] I believe the exercise is to recognize the first argument is an "Entity" and the second argument is an "EntityProperty". However, I want to mention that for later ex16.x, the checker does not want "everything". For example in ex16.4, the correct answer would be
BarChart[EntityValue[EntityClass["Planet", All], "Mass"]] but if you use the "everything" involved code as in ex16.1 (by changing "Mass" to EntityProperty["Planet", "Mass"])
BarChart[EntityValue[EntityClass["Planet", All], EntityProperty["Planet", "Mass"]]] the checker will mark it as "incorrect".
Something more about ex16.x involving "Species":
There is a high chance that control= will direct you to the correct animal, but "incorrect" InputForm that the checker will mark it as "incorrect". For example, in ex16.13 (the last ex16) control= "koala" gives me the koala picture as the desired output. When I copied the code here, it shows the following ImageAdd[Entity["TaxonomicSpecies", "PhascolarctosCinereus::2kft4"]["Image"], Entity["Country","Australia"]["Flag"]] In the notebook, Entity["TaxonomicSpecies", "PhascolarctosCinereus::2kft4"] will be compressed as a orange box with text "koala species specification" because I used control= to made the input. However, the system is asking for the exact input as
Entity["Species", "Species:PhascolarctosCinereus"] I believe they point to the same species datapage. The first try by control= is marked as incorrect (at least in my interface). Weird. A similar issue happened for Ex17.6
When I used control= "2500yen", the nature language process returns
Quantity[2500., "Yen"] However, the checker wants
Quantity[2500, "Yen"]
I do buy statements from Phil that redoing those exercises to explore the possibilities will enhance my memory and understanding of the Wolfram System. But at some moments, I found ex16.x is just not doable because of the nature language processing, I can do nothing about it. I solved my problem about those syntax issues using with exercise solutions for 2nd-edition of the book.
https://www.wolfram.com/language/elementary-introduction/2nd-ed/answers-to-exercises.html Ex9.7 and Ex14.7 does not work, the solutions are wrong in the sense that the output is not the same as desired output (does not satisfy the question) BTW, I encountered some errors simply due to the name of variables.
It seems the checker prefers
n in Table;
i,j in 2-dimensional Table;
x,y,z for coordinates;
r for radius;
theta for angle between (maybe) {0, 360 Degree};
x Degree for x between (maybe) {0,360}; or use the variables named by the question
For Manipulate, click the + you can see the name of variable as the name of control bar
|
|
|
Ex9.7 and Ex14.7 does not work, the solutions are wrong in the sense
that the output is not the same as desired output (does not satisfy
the question)
You are awfully fast, @Jingzhou Na. We weren't ignoring you; we're just trying to catch up. :)
I'm only up to 9.7. I can confirm that there's something broken with that question. If I put in an answer scored as correct, I get different behavior than the "expected output". With an input value of 5 to both manipulates, the "expected output" displays 6 colors. My "correct" output displays 5 colors. That ain't right. I covered over my submitted answer:

|
|
|
Very interesting.
The "expected output" in my interface is indeed the true solution to the question (satisfying the question): when n=5, it has 5 colors and so on. The 2nd edition solution (or the "expected output" in Phil's interface) has 6 colors when n=5, which is a false solution to the question (it does not satisfy the question). I believe Phil's solution marked as "correct" is the true solution. There is something going wrong with the "expected solution" in Phil's interface but not in mine, which is interesting. One guess: Phil is working on a previous version of exercise notebook that has not fixed this specific issue. Then the wrong "expected output" matches the wrong solution in 2nd edition of the book.
Attachments:
|
|
|
One guess: Phil is working on a previous version of exercise notebook
that has not fixed this specific issue.
I'm definitely using the current version of the framework. I have no idea how to access any previous version. I told @Soomi there were places where the wrong answer would get scored as correct. This is one.
|
|
|
I believe your answer is one correct way, but the system does not have that in the solution checker.
I tried ToUpperCase[StringJoin[Alphabet[]]] This one join everything as a single string "ab...z" and then capitalized the single string.
{"a", "b", ..., "z"} -> "ab...z" -> "AB..Z"
Your syntax gives the same result, it capitalized 26 alphabets and then join them into one single string.
{"a", "b", ..., "z"} -> {"A", "B", ..., "Z"} -> "AB..Z" For plenty of exercises, I do not think there is the best (or the simplest) answer. But seems the system does >_<.
Attachments:
|
|
|
Thank you for your response. I see the problem now. I used Capitalize and the problem states 'uppercase'.
|
|
|
What is the ideology of the following name of a WL function:
FromLetterNumber
I find this name confusing.
|
|
|
Hi Rory, I have no idea how to insert images into the code. I tried
copy and paste, and it doesn't work
Both Copy/Paste and Drag/Drop work just fine on my Mac. See attachment. You can also use Import[] to import an image to the Wolfram Language App from the file system on your local machine or from a URL. Not Rory, but HTH.
Attachments:
|
|
|
Bugs with names of variables fixed in the answers, while this should be flexible 7.4 Make a list of colors with hues varying from 0 to 1 in steps of 0.1: Table[Hue[h],{h,0,1,0.1}] - only with the variable name "h" the answer is accepted as correct Table[Hue[x],{x,0,1,0.1}] - any other variable name is incorrect 7.8 Make a list of numbers from 0 to 1 in steps of 0.1, each with a hue equal to its value: Table[Style[n,Hue[n]],{n,0,1,0.1}] - only with the variable name "n" the answer is accepted as correct Table[Style[h,Hue[h]],{h,0,1,0.1}] - variable names "h", "x" or "a" are not accepted :-(
|
|
|
What is the intended answer? The following questions score my answers as INCORRECT:
Find the last five digits in 2^1000. IntegerDigits[2^1000][[-5;;]]
Make a list of the letters at even-numbered positions in the alphabet. Alphabet[][[2;;26;;2]]
Make a line plot of the second-to-last digit in the first 100 powers of 12. ListLinePlot[IntegerDigits[12^Range[100]][[All,-2]]]
Join lists of the first 20 squares and cubes, and get the 10 smallest elements of the combined list. Take[Sort[Join[Range[20]^2,Range[20]^3]],10]
To the best of my knowledge, my answers are materially correct. Do you have better answers?
|
|
|
It would be helpful if the Quiz titles were labeled with section coverages (e.g., Quiz 1- EWL1 thru EWL8). I have no idea what sections any of the quizzes cover..
|
|
|
I agree. It seems like they're split into roughly 10 chapters each, so you should be able to do quiz 1 by the end of today's class.
|
|
|
If you look at the Track My Progress page at the very bottom of the left-hand navigator for the course, you will see a Certification Progress section. If you hover your mouse over each of the white or orange blocks for the videos and exercises , you can see the Chapter number that is supposedly relevant to that quiz#. So, you can see that the quizzes don't necessarily correspond to groups of successive chapters. But you can still pass Quiz 1 without having completed all the chapters and exercises relevant to Quiz 1. That might not work with the rest of the quizzes, however. Maybe it's best to complete all the chapters, then do the quizzes.
|
|
|
@Rory/@Eryn , there's a problem displaying plots when running Wolfram Cloud on an iMac (24-inch M1 2021, macOS 14.6.1, Safari 17.6): tic marks are not scaled correctly. This shows up in the EIWL course framework. For example, Exercise 3.6 looks like this on that hardware/software: 
I reported this bug to Wolfram Technical Support (CASE:5170014) back at the end of August. I think I went through all the steps, but I have no sense how long it takes to fix a bug in the cloud environment. They asked me for the $CloudVersion which has the bug; it's now 1.69.0.1 (September 4, 2024). The problem doesn't happen in the Google Chrome browser on the iMac. I will switch to Chrome. This is a FYI if other students encounter this on an iMac. If you have access to look up the bug report internally, I'd be grateful if you'd see if they're waiting for me to do something.
|
|
|
Where do I find the course framework and exercises? Link(s)? Never mind... got it!
|
|
|
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..)
Attachments:
|
|
|
It's asking you specifically to use power, so multiplication will be incorrect, as you haven't answered the question, even though the output is the same :)
|
|
|
thank you for answering. However, I think that there was a misunderstanding because I did not write down.Too many wrong answers have taken too much of my time to post here (lol). I may be better not to in order to save my time. Let me clarify my question.
As the attached clearly shows, the question asks to compute 5 "squared" specifically. Thus, I thought that the answer should be 5^2 as you, Rory, mentioned. However, the problem is that the framework says that it is "IN-correct." Rather, the framework says that "5 x 5" is correct. Yes, outputs of both are the same. Thus, we can use any of them. However, for this particular question, the correct answer should be "5^2," right? Hmm... too many errors.. BTW:
THANK YOU for answering, not ignoring. It means a lot! Arben, Luke, Eun Hyun, and Mike never ignore my question, no matter what it is: I sometimes ask the answer to a poll question. Instructors except Luke mention the answers verbally only. Sometimes it happens so fast. Or, I was following something that the instructor mentioned before. I remember that the director at Machine Learning department during Arben's ChatGPT daily study group messaged me back with the correct answer and the reason why it was the correct answer (this was exactly what i was looking for) - I always am interested in the rationale (why???!!!). THANK YOU, Rory! Hopefully, this post can clear my question.I don't understand why the errors occur: again, too many errors.
|
|
|
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..)
Attachments:
|
|
|
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.
|
|
|
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.
Attachments:
|
|
|
Rory, Your solution to this question was also the same as mine, as attached. -> Then, you solved it wrong? -> Which one is correct?
Attachments:
|
|
|
Dear Soomi, You should use your own intelligence and predict the intended answer. Then, code the answer using WL. Do not expect too much from algorithms. Your answers were not real simplifications. Only if we have one list in one piece, then we can be happy with the simplification. I see that some versions of codes giving {1,2,3,4,5} are possible.
|
|
|
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 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.
|
|
|
Thanks, Soomi. There are plenty of superior Wolframers (is that a word?); they're just not around this course. Our course instructors are far more qualified. Cassidy is pretty darn qualified too, but she rarely shows her technical chops in courses.
I do hope that the answers (all correct ones) and solutions are
available once we finish each exercises.
I understand the sentiment, but I strongly disagree. The goal is to learn, which may not mean getting the right answer. Be tenacious in seeking the expected result, but don't drown in frustration if you can't find it. Sometimes, there's some point to the exercise that may not be obvious on the first (or fifth) try. In those cases, seek to outflank the problem. Look up the official documentation describing the function. You may find the solution there. You may learn something that helps your overall Wolfram knowledge but has nothing to do with the exercise. That's all part of the game. I remember being extremely frustrated when I ran through [most of] the interactive course; I actually abandoned getting the cert. When you have some time, I recommend checking out Conrad Wolfram's 2010 TED Talk. He's commenting on the fallacious way we teach math in school. It's not about getting the right answer; it's about knowing how to think and learn in a particular system. This course is a bit different: we're learning the [arbitrary] framework of the Wolfram Language; all of its idiosyncrasies. The goal of the exercises is to learn the language: listening/reading and then speaking/writing. Try like heck to get the exercises right, but realize that that's never the goal. And -- please -- have fun in the process. Respect the exercise framework, but have a healthy lack of respect for it, too.
|
|
|
THANK YOU, Phil.I will keep in mind your thoughtful advice. See you around, Phil.
|
|
|
I do hope that the answers (all correct ones) and solutions are
available once we finish each exercises.
In the past. exercise answers were available on the online book-editions of the course, and the book exercises are the same as the framework-exercises. I looked for them today; they appear to be gone. If you open up the exercise questions in the book-editions, you get kicked into a Wolfram Cloud place with the same grading engine. I'm pretty good at searching and poking around in archives; I couldn't find them anywhere. More to the point: I can't think of a single thing I ever learned about the Wolfram Language by looking at those answers. Maybe there was an "Aha!", but I can't remember it. Getting the right answer is missing the point. I'm not saying to not strive to answer the questions, just don't be obsessed with it. The EIWL framework is a dense course; you can wind up in the weeds if you obsess over getting every #!$$ answer right. If you look at the Track My Progress link, you'll see a check-box for exercises. What percentage of exercises correct are required to get checked off on that section? I don't know, but I'm pretty sure it's not 100%. "Badges indicate graded exercises for certification." That's not enough information. @Rory: can you tell us what a passing grade is for the graded exercises in a section of the EIWL framework? Thanks. Exercise 4.6 today is a good example where you should fight to figure it out. If you try PieChart[{1,1,1,1,1,1,1,1,1,1}] you'll get a NO PASS. That's correct, but a bad use of the tool. The designers wanted you to do something a bit more clever. Aha! Of course! I'm likely to remember that lesson now. :)
|
|
|
Attachments:
|
|
|
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.
|
|
|
Attachments:
|
|
|
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}]
|
|
|
Rather this: 10+RandomInteger[10] The solution in the video recording is wrong. You have got 4. But 4<10.
|
|
|
Agreed - that solution would be marked as incorrect. I was demonstrating other skills :)
|
|
|
I will try to give a correct reference: In the BigMarker video (I do not know any other videos) of Tuesday's second lecture in the course @15:00 Eryn was discussing the exercise with a list of fractions. She did not erase the initial 1, while the question asked to start the list with 1/2.
|
|
|
In the BigMarker video (I do not know any other videos) of Tuesday's
second lecture in the course
The other videos are the ones in the EIWL framework itself -- 48 chapters of the book. You're right. Eryn made a mistake working the exercise. Her answer was only fractionally correct.
|
|
|
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.
|
|
|
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.
|
|
|
Thanks! It is only recently that I learned about such things.
|
|
|
You can also use the scratch notebook within the framework!
|
|
|
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!
|
|
|
Reply to this discussion
in reply to
| |