Group Abstract Group Abstract

Message Boards Message Boards

11
|
55.3K Views
|
186 Replies
|
92 Total Likes
View groups...
Share
Share this post:

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

186 Replies

After one passes the three quizzes, what does one do to receive certification?

POSTED BY: Thomas Rike

We will reach out to you with your certificate.

Thanks for the reply.

POSTED BY: Thomas Rike

Hi Conrad,

If "4" is assigned to p, and then you look at the head of p: Head[p], it will still be a string. The quotes just aren't shown but it p still acts like a string.

p = "\"4\""

This will show the quotes and p will still behave like a string.

Is that what you needed?

Lori

POSTED BY: Lori Johnson

Hi Lori, thanks for getting back to me. Anyway, I guess I was really looking for a setting within Mathematica to always show the quotes for an output string.

POSTED BY: Conrad Taylor

Conrad, I suppose you could dig into Global Preferences, but I personally wouldn't bother if your code is behaving as expected.

What exactly are you trying to do?

POSTED BY: Lori Johnson

@Lori Johnson It's just a personal preference to see strings with double quotes in the output.

POSTED BY: Conrad Taylor

Understood! :D

POSTED BY: Lori Johnson
Posted 4 years ago
POSTED BY: Rohit Namjoshi

@Rohit Namjoshi Thanks for the references and I'll definitely take a look at the links.

POSTED BY: Conrad Taylor

How does one always show the double quotes around a string? For example, I'm currently seeing this behavior:

enter image description here

POSTED BY: Conrad Taylor
Posted 4 years ago
POSTED BY: Syd Geraghty
Posted 4 years ago

Clearly Element[, Reals] and _Real treat the symbols differently.

Element[#,Reals]&/@{3.1,Pi,\[Pi],E}
{True,True,True,True}
Developer`RealQ/@{3.1,Pi,\[Pi],E}
{True,False,False,False}

My guess is: _Real probably only mean real number. Element will check if the symbol really represent a real number. If you want the behavior of Element, you can use this:

Replace[{3.1,Pi,\[Pi],E},{p_/;Element[p,Reals]->Framed[p]},1]
POSTED BY: Jin Zhang
Posted 4 years ago
Replace[{3.1,Pi,\[Pi],E,10,21},{x_/;Element[x,Reals]->Framed[x]},{1}]

Unfortunately this also selects the Integers 10 and 21 which is the wrong requirement!

POSTED BY: Syd Geraghty
Posted 4 years ago

Reals is a domain specification. The domain of reals includes the integers. See Wikipedia.

POSTED BY: Rohit Namjoshi
Posted 4 years ago

Pi is not a Real, but a Symbol

Replace[{3.1, \[Pi], Pi, \[Pi], 10, 3.14159, E}, { 
  x_ /; (MemberQ[{Real, Symbol}, Head[x]]) -> Framed[x]}, {1}]

creates frames for all but the Integer enter image description here

POSTED BY: Peter Lippolt
Posted 4 years ago

Hi, I am a bit confused about quiz 3.4. My code gives exactly the same expected output. But 'Check my solution' gives a red cross. I am wondering if I need to take care of the case '0'->'-1' to be '0'->'9'. Even I did that, I still cannot pass the check. Any idea?

POSTED BY: Jin Zhang

I'm really not understanding what upvalues, downvalues, ownvalues, etc. are. Not how they're used, but what they are. I can find the documentation about them in the documentation center, but I never saw that it defines what they are. Can anyone help?

POSTED BY: Kari Ruggles

Yes, the documentation didn't clearly explain DownValues, UpValues, or OwnValues. However, here's a very good write up for reference:

https://mathematica.stackexchange.com/questions/96/what-is-the-distinction-between-downvalues-upvalues-subvalues-and-ownvalues

I wish that this helps you to better understand their definitions.

POSTED BY: Conrad Taylor
Posted 4 years ago

Quiz 3.3 question:

I am stuck on only one output detail with this question and it appeared as a very straightforward piece of code that just doesn't work! Where am I going wrong, what am I missing?

In[84]:= 
Element[\[Pi], #] & /@ {Complexes, Algebraics, Reals, Rationals, 
  Integers, Primes}

Out[84]= {True, False, True, False, False, False}

So Pi belongs to the domain of Reals!

However any of the input variants for Pi cannot be framed as expected with this Replace code:

Try inputting Pi in different ways ...\ [Pi], [FpormaPi], esc pi esc, ...

In[82]:= Replace[{3.1, \[Pi], Pi, \[Pi], 3.14159, E}, {x_Real -> Framed[x]}, {1}]

Out[82]= {
\!\(\*FrameBox[\!\(3.1`\),
StripOnInput->False]\), \[Pi], \[Pi], \[Pi], 
\!\(\*FrameBox[\!\(3.14159`\),
StripOnInput->False]\), E}

How do I frame the Pi symbol?

Syd

POSTED BY: Updating Name

Hi,

I was wondering if the 3rd quiz automatically is submitted after checking all the solutions. I don't see any sort of submit button so I hope I managed to make everything work. Let me know if I'm missing something.

Thanks!

Posted 4 years ago

Confirmation of quiz completion?

Hi Abrita: Many thanks to you and to the team for the presentations. I have submitted the quizzes (1,2,3(part)) and seen the confirmed "OK"s for correct answers: but no overall "congratulations, we'll get back to you" message. Is such a thing expected, to reassure me before the deadline? Thanks Peter (peter.ransome@ieee.org)

POSTED BY: Peter Ransome

@Peter Ransome Yes all your submissions have been received.

Posted 4 years ago

Hi Mitchell

I think Abrita's comment is quite clear on where ToString is not needed

Firstly {"a3bykmn","oka2bcka","bdkba1","4ckxyz"} is already a list of Strings so you do not need ToString for the input.

and where it is needed

You would need to use ToString to convert the digit back to String once you have isolated it and decremented it by 1

The code you posted earlier is close

StringReplace[{"a3bykmn","oka2bcka","bdkba1","4ckxyz"},p:DigitCharacter :>ToExpression[p-1]]

Just need to fix the ToExpression[p-1]]. p is a String, it needs to be converted to an Integer so 1 can be subtracted from it, the result needs to be converted to a String so StringReplace can do the replacement.

POSTED BY: Rohit Namjoshi

Got It. Thanks so much.

Mitch Sandlin

POSTED BY: Mitchell Sandlin

Hi;

Based on the definition and hints given by the problem, I think that everything is included in my solution, however I am not getting the desired output - see below. I am sure that it is something that I am doing incorrectly, but based on my knowledge at this point in time, I do not have a clue.

StringReplace[ToString[{"a3bykmn","oka2bcka","bdkba1","4ckxyz"}],p_DigitCharacter :>ToExpression[p-1]]
POSTED BY: Mitchell Sandlin

Firstly {"a3bykmn","oka2bcka","bdkba1","4ckxyz"} is already a list of Strings so you do not need ToString for the input. You would need to use ToString to convert the digit back to String once you have isolated it and decremented it by 1.

As the error message says, "StringExpression::invld: Element pDigitCharacter is not a valid string or pattern element in pDigitCharacter:>ToExpression[p-1]."

Remember if you are trying to restrict a pattern to match only expressions with a certain Head that is when you use the Underscore "_". So you can have "p_Integer" or "p_String" etc. When you want to use a pattern object like "DigitCharacter" or "PunctuationCharacter" we want to simply follow up the name with ":" like p:DigitCharacter or p:PunctuationCharacter

StringCases["\"a, b c.\"", p : PunctuationCharacter :> Framed[Style[p, Red]]]

Hi Abrita;

I incorporated the changes that you suggested (see below) and this time, I think the program actually blew up because I never received an answer back as to whether the program actually completed. In any event, I am not getting an option to try again.

However, the comments as to when to use an _ verses a : were very helpful.

StringReplace[{"a3bykmn","oka2bcka","bdkba1","4ckxyz"},p:DigitCharacter :>ToExpression[p-1]]
POSTED BY: Mitchell Sandlin
Posted 4 years ago

The error message is

ToExpression::notstrbox: -1+3 is not a string or a box. ToExpression can only interpret strings or boxes as Wolfram Language input.

p is a String, so ToExpression[p-1] fails. Cannot subtract 1 from a String.

Hint: ToExpression["3"] // Head

POSTED BY: Rohit Namjoshi

Hi Rohit;

The problem stated as hints that ToString[] and ToExpression[] would be needed in the solution of StringReplace[]. Abrita told me in a previous reply that I really didn't need to use ToString since the data was already in string format, so I remove it from my expression.

I need to read the digit characters from the data strings, for example pull the 3 from the first string a3bykmn, then subtract 1 from the value, write it back out as a 2, and then grab the next digit character from the next string oka2bcka which is a 2 subtract 1 giving 1 and so on.

Even after attending every lecture, I don't know how to do that.

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin

Hi Mitch, Sorry for the confusion. I meant "you do not need ToString for the input", but you will need it when your pattern has found a match. In your code:

StringReplace[{"a3bykmn","oka2bcka","bdkba1","4ckxyz"},p:DigitCharacter :>ToExpression[p-1]]

once p has matched something it is still a string, that is why you cannot subtract 1 from it. You need to convert it into an expression to subtract 1 from it. Once that is done, you want to put it back in the original string, but now again you are stuck with an integer you are trying to insert into a string. This is where ToString comes in handy.

ToExpression can convert string to number i.e. "3" to 3 ToString can convert a number to a string i.e. 3 to "3"

Hope this helps.

POSTED BY: Mitchell Sandlin

On Quiz 3 Problem 3.1, when I click Check My Solution, I getenter image description here the following error within the downloaded notebook:

POSTED BY: Conrad Taylor

@Conrad Taylor Referring to the third template for creating a SparseArray on http://reference.wolfram.com/language/ref/SparseArray.html SparseArray[data,{d1,d2, ...}], we would like you to create your own 'data' with a rule (of the form pattern -> value). The example showing the construction of a tridiagonal matrix using patterns for indices on the documentation page linked above, may be a good starting point to solve this problem.

Hi Abrita;

I followed the example in the link that you sent me for SparceArray to create the data and again it produced exactly the same correct output in the MatrixPlot that the problem indicated it should. However, I am again getting the message that my answer is incorrect and to try again.

Mitch Sandlin

POSTED BY: Mitchell Sandlin

Hi Conrad;

I followed the example that you sent me a link to for SparceArray and again produced exactly the same output as the problem displayed, but still was not accepted as the correct answer. I do not know that to do at this point. Any suggestions.

Mitch Sandlin

POSTED BY: Mitchell Sandlin
Posted 4 years ago
POSTED BY: Doug Beveridge

Hi Doug;

Following your advice, I deleted my data from my SparseArray[] and moved it into a field named dta1= {{1,5}-> 1, etc.}}. Then loaded the data into the functions:

MatrixPlot[SparseArray[dta1,{20,20}]]

The new configuration gave me the exact same data as expected, as I have gotten for the last 5 days, with no error messages. However again, the grader didn't like it, gave me an X and told me to try again.

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin
Posted 4 years ago

Mitch

As a side note , make sure there are no blank spaces in your code eg

Function[x_   ,  y_ ] 

should be

   Function[x_,y_]

This used to cause major problems with the g4rader

POSTED BY: Doug Beveridge

Hi, I was able to refactor Quiz 3 Problem 3.1 into a solution that appears to have been accepted by the backend. Also, I was definitely in the weeds for this problem. Anyway, could someone confirm that I have submitted all 3 quizzes for the study group?

POSTED BY: Conrad Taylor
POSTED BY: Mitchell Sandlin
Posted 4 years ago

ReplaceAll[x will only match a literal x e.g.

ReplaceAll[x :> y][{a, x, x^2}]
(* {a, y, y^2} *)

For this quiz question use Replace with a level specification (which is what the quiz asks for). Rather than nested If, consider using Which.

POSTED BY: Rohit Namjoshi

Hi;

Based on the definition and hints given by the problem, I think that everything is included in my solution, however I am not getting the desired output - see below. I am sure that it is something that I am doing incorrectly, but based on my knowledge at this point in time, I do not have a clue.

StringReplace[ToString[{"a3bykmn","oka2bcka","bdkba1","4ckxyz"}],p_DigitCharacter :>ToExpression[p-1]]
POSTED BY: Mitchell Sandlin
POSTED BY: Mitchell Sandlin
POSTED BY: Mitchell Sandlin
Posted 4 years ago

You are welcome, Abrita. I will post it as a separate post as well.

POSTED BY: Dave Middleton
Posted 4 years ago

POSTED BY: Dave Middleton

@Dave Middleton this is fantastic, especially in helping new users to find their way around the Entity framework. Can I request you to submit your notebook to the Notebook Archive and also create an independent post on community? You can add the groups like "Wolfram Language" or "Education" as well as "Data Science" when you post.

Hi Dave,

This is so good that I had to save a copy. Thanks for your hard work!

L

POSTED BY: Lori Johnson
Posted 4 years ago
POSTED BY: Dave Middleton

It seems absolutely necessary because of the myriad of ways to do things in WL and have files with favorite snippets based on certain functions that I use for the same purpose in clearer language! You know, like IBM mainframe manuals!

POSTED BY: Lori Johnson

I'm working on Quiz 3 Problem 3.3. I have created a function, transform, that fulfills cases 1 - 3 and returns the correct value depending on the input. Now, I'm trying to integrate the function, transform, as a rule to the Replace function. Is there something that I'm missing within the current implementation?

enter image description here

POSTED BY: Conrad Taylor
Posted 4 years ago

Hi Conrad,

/; (Condition) requires a predicate function to perform the test. From the documentation

{6, -7, 3, 2, -1, -2} /. x_ /; x < 0 -> w

Try something like

Replace[numbers, value_ :> transform[value]]

and don't forget the hint in the question.

POSTED BY: Rohit Namjoshi

@Rohit Namjoshi I was able to refactor into a better solution. Thanks for your assistance.

POSTED BY: Conrad Taylor
Posted 4 years ago
POSTED BY: Updating Name

Yes Quiz 3 has only 5 questions.

Posted 4 years ago

Is there a way to get a list of all Developer' functions ?

eg Developer`RealQ

and

Developer`MachineRealQ

POSTED BY: Doug Beveridge
Posted 4 years ago

Hi Doug,

Names ["Developer`*"] // 
  Partition[#, UpTo@3] & // 
  Grid[#, Alignment -> Left, Frame -> All] &
POSTED BY: Rohit Namjoshi
POSTED BY: Conrad Taylor
Posted 4 years ago
POSTED BY: Doug Beveridge

@Conrad Taylor received your submissions

POSTED BY: Mitchell Sandlin
Posted 4 years ago

Hi Mitchell,

DigitCharacter does not take any arguments, it matches a digit character in a StringExpression. It is not a predicate function. From the documentation

StringMatchQ[#, DigitCharacter] & /@ {"1", "a", "2", "b", ".", " "}

So the pattern given to StringReplace must contain DigitCharacter to match the digits in the input string. It can be bound to a symbol e.g. d : DigitCharacter, then d can be used in the replacement Rule.

POSTED BY: Rohit Namjoshi

Hi;

What am I doing wrong here on the 1st problem - see below? I have included everything the problem indicates, but I am getting a syntax error regarding the position of my rule.

MatrixPlot[ SparseArray[data,{n,n} /;n>0]]

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin
Posted 4 years ago

Hi Mitch,

The wording of the question is a bit odd IMO. Look at the expected output and generate data using Rule and Condition so that you can reproduce the plot

data = (* some expression using Rule and Condition *)
MatrixPlot[SparseArray[data, {n, n}] (* This reproduces the expected output *)
POSTED BY: Rohit Namjoshi

Sorry if the question is not clear. Referring to the third template for creating a SparseArray on http://reference.wolfram.com/language/ref/SparseArray.html SparseArray[data,{d1,d2, ...}], we woul dlike you to create your own 'data' with a rule (of the form pattern -> value). The example showing the construction of a tridiagonal matrix using patterns for indices on the documentation page linked above, may be a good starting point to solve this problem.

Hi Abrita;

Please ignore my previous request for assistance on 3.3, I figured it out myself and can produce exactly the same required output, however the grader still marked them incorrect. The same can be said for 3.1, producing the correct output but the grader still marked it incorrect. So these 2 quiz questions will need to be hand graded. Questions 3.2 and 3.4 did not produce any problems since the grader correctly graded them as correct. Question 3.5, I could not produce the required output, so most likely it is incorrect - wasn't sure what was being asking to solve.

Quiz 1 and 2, I submitted sometime ago with passing grades on both.

Please let me know if you need anything else from me concerning these quizzes.

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin

Thanks @Mitchell Sandlin. Please make sure you have emailed the notebook to wolfram-u@wolfram.com for manual grading.

For problem 3.5 we are asking you to explore how you can go about setting up the function definition so that answers to smaller problems (like f2], f[3], etc.) get stored for future use when the answer to a bigger problem (say f[10]) is requested. This can be done by the process of [memoization. You can incorporate memoization in this problem by getting the Wolfram Language to create downvalues automatically when it is trying to compute f[5]. In addition to the downvalues like

factorial[n_Integer/;n>=1]

and

factorial[0]

five other downvalues should be created automatically when f[5] is evaluated.

Hope this helps.

If by any chance any of your quiz notebooks on the cloud get corrupted you can follow these instructions to delete the notebooks from your cloud account and start afresh: https://www.wolframcloud.com/obj/online-courses/Published/UpdatingWolframUCourseQuizzesAndExercises.nb

POSTED BY: Joseph Sauvageau

If one downloads a copy of Quiz 3 notebook and clicks the Check My Solution, will the score get recorded in the backend? Thanks in advance for your feedback.

POSTED BY: Conrad Taylor
Posted 4 years ago
POSTED BY: Fabio Alcaro
Posted 4 years ago

I missed the Survey at the end of today's session. My request for tomorrow's Review session is to look a bit into string replacements using patterns. Do we have to use Regular Expressions at times, or can we do the same with patterns?

Cheers,

Dave

POSTED BY: Dave Middleton

You can do a lot even without Regular Expressions. You will have to use dedicated functions to work with string patterns like StringReplace, StringMatchQ, StringContainsQ etc. You will find them listed here and you can use this tutorial to get started.

Posted 4 years ago

Hi. If I define an uppervalue x by: x /: _[x] = 0, How can I clear it?

POSTED BY: Jin Zhang
Posted 4 years ago
POSTED BY: Jin Zhang
Posted 4 years ago
POSTED BY: Jin Zhang
Posted 4 years ago

In today's study group's "Exercises for Image Processing", Exercise 1. the code provided does not work on my Windows 10 21H2 machine with Mathematica version 13.0.1.0 i.e. the 2D slider t2 doesn't do anything.

img = Binarize[
   Graphics[{Disk[{0, 0}, 8], White, Disk[{0, 0}], Disk[{2, 2}]}, 
    ImageSize -> 200]];
Manipulate[
 ImageResize[ImageTrim[img, {t1, t2}], 
  400], {t1, {1, 1}, {177, 177}, {1, 1}, 
  Appearance -> "Labeled"}, {{t2, {400, 400}}, {271, 271}, {400, 
   400}, {1, 1}, Appearance -> "Labeled"}, ControlPlacement -> Left]

Is this an issue on my end or is this a bug? If the latter, is there a work-around?

Cheers,

Dave

POSTED BY: Dave Middleton
Posted 4 years ago
POSTED BY: Doug Beveridge
Posted 4 years ago

Thanks Doug. The "Dynamic Updating Enabled" is on, or else the t1 2D slider wouldn't work either. Maybe my installation is corrupted somehow.

POSTED BY: Dave Middleton

Hi Dave, Does a simple 2DSlider work for you?

Slider2D[{.7, .3}]
Posted 4 years ago
POSTED BY: Updating Name
Posted 4 years ago
POSTED BY: Updating Name

Quiz 2, Problem 4, answer option A says "Displays a dialog box with the message 'Click OK', where evaluations can still be done without dismissing the dialog box", i.e. you can continue to evaluate further code in the notebook, without dismissing the dialog box.

Posted 4 years ago

Thanks Abrita

Inner[ Times, x, y,  BitXor ]

is the solution

POSTED BY: Updating Name
Posted 4 years ago
Attachments:
POSTED BY: Doug Beveridge
Posted 4 years ago
POSTED BY: lara wag
Posted 4 years ago
POSTED BY: lara wag
POSTED BY: Zbigniew Kabala
POSTED BY: Zbigniew Kabala
Posted 4 years ago
POSTED BY: lara wag
Posted 4 years ago

Thank you Lara for cheering me up. But I'm still ready to let gravity take its course ... :)

POSTED BY: Updating Name
Posted 4 years ago
POSTED BY: Rohit Namjoshi
Posted 4 years ago

Thank you for the thourough explanation.

POSTED BY: Updating Name

The problem of squaring an interval was left kind of open. Here is an explanation.

POSTED BY: Zbigniew Kabala
Posted 4 years ago
Posted 4 years ago
Attachments:
POSTED BY: Gerald Dorfman
Posted 4 years ago

If you create DockedCells

eg enter image description here

How do you remove it ?

POSTED BY: Doug Beveridge
Posted 4 years ago

Doug,

To remove all docked cells

SetOptions[EvaluationNotebook[], DockedCells -> {}]
POSTED BY: Rohit Namjoshi

Input NRoots[x^2 == 5, x]

gives me an error: ... General: 5 is not a valid variable.

What's wrong?

Try evaluating x by itself and I think you'll see where the Irishman comes from :). Run ClearAll[x] after that and NRoots will do its job as expected.

POSTED BY: Arben Kalziqi

Thank you!

Posted 4 years ago

I was delighted to learn how fancy Mathematica is regarding integrating over regions. Yesterday's lecture (April 28, 2022) illustrated some really cool things that got me excited. I played around with some examples, for the fun of it. This is a really nice ability. I am including the notebook with 2 neat examples. Oddly there might be a bug, although the "bug" is probably mine. It is amazing that one can integrate over such exotic regions.

See the attached notebook.

Attachments:
POSTED BY: George Schils
Posted 4 years ago

I feel like I am doing something exceedingly stupid, but am having trouble getting the volume of a sphere as given below.

enter image description here

This calculation gives 7.06858347057703478654094869079, which is off by a factor of 4.

POSTED BY: George Schils

Try Ball instead of Sphere—despite colloquial usage, a sphere is a 2D object that embeds into 3D space.

POSTED BY: Arben Kalziqi
Posted 4 years ago
POSTED BY: George Schils

I'm glad to hear it! I might be biased, but I do think it's pretty cool that you're able to achieve such a result. Also—while this may be a bit trivializing in some sense, we really do have a function for everything! Try out RegionMeasure, if you'd like, e.g.: Manipulate[ RegionMeasure /@ {Disk[{0, 0}, d], Sphere[{0, 0, 0}, d], Ball[{0, 0, 0}, d], Cuboid[{0, 0, 0}, d {1, 1, 1}]}, {d, 1, 5, 1}] This can be useful to provide some insight which is relevant to the dimensionality question we're discussing (somewhat paradoxically). On a related note, you might try something like Volume[Sphere[]] and get a (previously-)surprising result.

Or, you could make the variation continuous, then Plot to see the problem another way: Plot[Evaluate[ RegionMeasure /@ {Disk[{0, 0}, d], Sphere[{0, 0, 0}, d], Ball[{0, 0, 0}, d], Cuboid[{0, 0, 0}, d {1, 1, 1}]}], {d, 1, 5}, ScalingFunctions -> {"Log", "Log"}] (adding PlotLegends->"Expressions" would make it explicit, to wit.)

EDIT: I'd be loathe to forget RegionDimension!

POSTED BY: Arben Kalziqi
Posted 4 years ago
POSTED BY: George Schils
Posted 4 years ago
POSTED BY: George Schils
Posted 4 years ago
Attachments:
POSTED BY: George Schils
Posted 4 years ago
Posted 4 years ago
POSTED BY: George Schils
Posted 4 years ago
POSTED BY: George Schils
Posted 4 years ago
POSTED BY: George Schils
Posted 4 years ago
POSTED BY: Peter Lippolt
Posted 4 years ago
Attachments:
POSTED BY: Gerald Dorfman
Posted 4 years ago
POSTED BY: Updating Name

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

Abrita,

Many thanks.

The notebook for Friday's lesson (#19) appears to be missing. When will it be made available?

Notebook 19SolvingEquations.nb has now been added.

Hi Thomas!

When pasted as text, there are no spaces. So, format the cell as text first, then past.

Have fun!

POSTED BY: Lori Johnson
Posted 4 years ago
POSTED BY: Olga Pavlova

Hi Abrita! Thank you, Abrita, and everyone working to put them together!

POSTED BY: Lori Johnson
Posted 4 years ago
POSTED BY: Gerald Dorfman
Posted 4 years ago

Something like this?

Plot[Evaluate[Abs[x /. sol]], {b, -5, 5},
 PlotRange -> All,
 PlotStyle -> ColorData[3, "ColorList"],
 PlotLegends -> "Expressions"]

enter image description here

POSTED BY: Rohit Namjoshi

Week 1 Review notebook added to download folder.

Thanks Richard. That second reason should always be kept in mind.

Thanks Richard.

It appears that f[x_] := f[x] =. .. is more efficient. Is there ever a case in which it should not be used?

Posted 4 years ago

You would probably not want to use this if the function was unlikely to be frequently called with the same argument. You would DEFINITELY NOT want to use it if you need the function to return different results when called with the same argument (e.g. if the result depended on some extermal value such as the current time or any of the Random* functions).

POSTED BY: Richard Hewens

When defining functions, when is it better to use f[x_] := f[x] =. ..instead of just f[x_] := ...? Why?

Posted 4 years ago

When using the "f[x_] := f[x]=...", this is creating a more specific function with the same name (which will be called before the original f[x_] form). This is most useful when the function will be called multiple times with the same argument, is which case the computation will only need to be done once.

POSTED BY: Richard Hewens
Posted 4 years ago

Can someone explain this curious behavior of the Defer function:

Defer[Plus[0, 1, 2, 3, 4, 0, 1, 2, 3, 4]] results in 0 + 1 + 2 + 3 + 4 + 0 + 1 + 2 + 3 + 4, but
Defer[Times[0, 1, 2, 3, 4, 0, 1, 2, 3, 4]] results in 0 x 2 x 3 x 4 x 0  x 2 x 3 x 4

It appears that Defer somehow "knows" that any 1's can be removed from a product without affecting the result (but doesn't remove the 0s from a sum) . My first thought was that Plus and Times might have different attributes, but they were identical. Any clues to what's going on here will be appreciated.

POSTED BY: Richard Hewens
POSTED BY: Arben Kalziqi

Bravo, Richard. You have a sharp eye. Not everyone would have noticed this nuance.

very nice.

POSTED BY: Sanjit Das
Posted 4 years ago

This is really helpful - thank you!

POSTED BY: D Groves

Please post more 'stackoverflow'-like post like this in the future... it benefits a LOT.. on a very LONG run..

Posted 4 years ago
POSTED BY: D Groves
Posted 4 years ago

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.

POSTED BY: Peter Lippolt

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.

I need to regroup for a trip that starts Monday. For that time I will switch to a cloud account and need to arrange file directories. (1) How to (up)load their files for the class? (2) How to order them based on the sessions' order number? . The ordering turned out to be especially ticky. Thank you

Posted 4 years ago
POSTED BY: Hasan SANSAR
Posted 4 years ago
POSTED BY: D Groves

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

Hello, Abrita, and thank you. M

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

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

Dear Arbita and Dave. Your responses are very valuable, especially by teaching how to "huck" it (look under the hood). There is a lot to digest. Thank you. M

POSTED BY: Arben Kalziqi

Thank you, Arben, At first sight, it indeed seems so .... insignificant :(. I am sure that it is а misleading impression. This happens with everything really basic.

POSTED BY: Lori Johnson

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

Posted 4 years ago
POSTED BY: Syd Geraghty

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.

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. enter image description here

Dear Abrita. Due to the trip, my deadline was shifted till today. I submitted the solutions to three quizzes. In the last quiz, four problems were accepted, and one was rejected. I sent a file describing my solution to the rejected problem and asked to check if it was really wrong. It was sent to Wolfram-U, with attention to you and Arben. I do not worry about the final score but would like to understand the reason for rejection. Could you please help me with this? Thank you. Michael.

Posted 4 years ago

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

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