怎樣才算精通 Mathematica?


In my opinion, there are several skill levels in using Mathematica (MMA).

Level 1: Use MMA as a graphical calculator.

i.e., use MMA to calculate an integral, plot a graph, or solve an ODE.

(Interestingly, there are some answers on http://zhihu.com which claim that "MMA is JUST A CALCULATOR compared with Matlab, the latter being a true programming language". Claims like these from level-one users are so ignorant and arrogant as to be downright hilarious.)

Level 2: Use MMA language as a script language, just like any other script languages.

Level 3: Use MMA as a UNIQUE language. Know some simple but unique features of MMA language and use them. Write MMA codes that look like MMA codes. This includes (but is not confined to) the following things:

Use the functional programming features of MMA language.

Use Map[], Array[], Table[], Nest[] etc. instead of loops.

Use Rules[] and Replace[].

Know the difference between = and :=.

Know how to utilize the unique evaluation mechanisms of MMA. Here is a very trivial example:

Fib[1] = Fib[2] = 1;
Fib[x_Integer /; x &> 0] := Fib[x] = Fib[x-1] + Fib[x-2]

This calculates the n-th term in the Fibonacci sequence in O(n) time.

And most importantly, make use of the countless built-in functions of MMA for your purposes instead of implementing your own. There are so many built-in functions that you rarely fail to find a suitable one.

Level 4: Know more about HOW MMA WORKS and use these features. This includes (but is not confined to) the following things:

a. Know that MMA has a Math Kernel and a Front End. Knows that when you are using a MMA notebook, the front end is behaving like a "web browser" that "renders" an ".nb" file (which is a pure text file in MMA language, you can open an ".nb" file with a text editors to see that, and you can compare an ".nb" file to a ".html" file) into the notebook as you see it. When you make an input interactively, the front end "transforms" your input into raw MMA expression(s). For example, when you input

{42, "Hello"}

and hit "Shift + Enter", the front end will transform that into

List[{42, String["Hello"]}]

and feeds it to the kernel. The kernel will evaluate the expression(s) and return an expression to the front end, which will render the returned expression into the output in the notebook as you see it. Even when you are trying to plot a graph, the kernel will only returns an expression about how the graph should look like, and it is the front end that renders the graph for you. You can check this by using

FullForm[Plot[Sin[x], {x, 0, Pi}]]

b. Know that everything is an expression in MMA. Know that every expression is tree, and the root of the tree is the Head[] of the expression, and that every "node" of an expression tree can be accessed using the indexing identical to that of a nested list in MMA.

c. Know that the math kernel does nothing more than transforming expressions by certain rules, and that MMA evaluates an expression by applying all the possible transformation rules to that expression until it no longer changes.

d. Know how pattern matching and replacing by rules play a central role in MMA. Transformation rules (Rule[]), are expressed in patterns. When applied to an expression, the kernel tries to match the pattern of the rule to the expression and once succeeds, will replace the matched part of the expression by the rule. Know that defining a function in MMA is just defining a transformation rule in MMA. Know the meaning of DownValues[], UpValues[], OwnValues[] and SubValues[].

e. Know how to properly control expression evaluation. Know how to use Hold[] and ReleaseHold[]. Know the HoldAll and HoldFirst attributes. Here is a very simple example of "passing arguments "by reference"" when defining a function:

SetAttributes[MySet, HoldAll];
MySet[x_Symbol, y_] := x = y;

Calling MySet[a, b] will set the value of symbol a to the expression b. Know why and how this works, and how this is different from the actual "passing arguments by reference" in, for example, C++.

Level 5: Know how to change the way MMA would behave. Know how to extend the ability of MMA. Or even how to "hack" MMA.

I"m not really in the place to describe this level here, because I"m below it. But I think there is a fantastic example of what people at this level could do:

Symbolic Matrices in Mathematica with unknown dimensions

Note how the first answer successfully enables MMA to compute symbolic matrices with unknown dimensions (and also enables MMA to display the results of symbolic matrices calculation elegantly in the notebook, by manipulating the front end).

You may find more examples on Mathematica Stack Exchange.

Level 6: Design, implement and improve MMA.

It takes a Wolfram Research employee, or even Wolfram himself, to be a level-six. I surely cannot comment on this level. I just want to thank these people for creating MMA and making it better and better.

Having finished this list, let me answer the original question. I believe only a level-four or above can be described as "proficient in MMA".

While there are some answers under this question which claim that a person who "can solve the problems in his/her field with MMA" can be described as "proficient in MMA", I respectfully disagree. In my opinion, these people can only be described as "proficient in their own fields and able to use MMA".

But that does not matter at all. People don"t have to be a proficient MMA user to make use of it. And it is not how well one can use MMA, but what problems one can solve with MMA, that matters. A level-one user that publishes on top journals is much more successful than a level-four who indulges himself/herself in playing with MMA without solving any actual problems. So in my opinion, the best practice of using MMA is, like other answers have suggested, using MMA to solve problems in your field or profession. Enhance your MMA skill level when you need it, not when you find it fancy or cool (unless, of course, your field is closely related to MMA itself or you want to work in Wolfram Research).


反正我不敢說自己「精通」……

題主有興趣的話試試正確解答http://mathematica.stackexchange.com的所有問題吧~我們現在的問題回答率太低了……


蟹妖 @楊文

『所謂教育, 就是要將學校學到的知識忘掉後剩下的本領』, 所以掌握畫圖, 會解方程, 這些具體的語法都是會忘記的, 扔掉半年之後估計就忘得差不多了。

私以為, 精通MMA在於精通其語法核心, 就是「模式匹配」和「替換」, 這些概念是從1.0開始就延續下來, 同時改動極少的部分。 其他的ODE,PDE求解, 畫圖等等都是在這個基礎上展開的, 會隨著版本發生巨大的變化。

所以精通的意思, 我猜大概是不清楚畫圖如何去精調坐標軸, 但是可以清楚的說明比如模式匹配裡面「upvalue」和「downvalue」的區別, 能知道Hold和HoldFirst的區別。之所以能說出這些, 還得要感謝 @浩浩 同學的指點。(說實話我到現在對於Hold, HoldAll, HoldForm, HoldFist的區別還是暈暈的)


當一個語言的類型約束只能用模式匹配一種方式實現的時候,許多平時覺得稀鬆平常的事情,都會變得酸爽無比……

我曾經使用過mathematica實現面向對象的基本功能,其具體細節我一想起來頭部就隱隱作痛。所以只貼兩個最常用的定義對象及成員使用的函數:

Object[proto___][ext___]:=Object[DeleteDuplicates[Join[ext___,proto___],(#[[1]])]];
Dot[obj_Object[___],met_]:=Block[List @ obj,met];

大概就這麼個意思……


不要為了精通而精通,解決問題多了,自然就精通了


比較直接的標準就是,你可以愉快的在Mathematica Stack Exchange 上幫助別人。


能用它解決自己想解決的問題


大概就是

遇到自己領域裡的問題,能夠很快地想出解決方法(演算法),能夠大致在腦海中構思出來MMA的程序實現,並且在實際寫代碼過程中不會遇到可以導致程序崩潰的bug

=========以下是瞎扯=========

軟體之類都是用得到的才是好的,不必要為了用一個功能而去精通這個功能,而是為了解決實際的問題而去學習一個功能,在遇到問題之前甚至不一定知道有這個功能

比如MMA可以導入地圖數據,股市數據等等大量的實時數據,然而一個物理專業的人一般需要這些數據嗎?私以為用不到。於是只要學好如何畫出簡單漂亮明白易懂的圖,如何求解方程,劃分網格等等經常用的功能,也就夠了

回頭看了一下題目,發現瞎扯的內容比回答多,題主勿怪

MMA小白

半夜睡不著,閑來無事答一下


推薦閱讀:

除了專業領域外,Mathematica 在日常生活有什麼有趣用處?
Mathematica 有什麼奇技淫巧?
Wolfram Language 對於一個普通程序員有什麼意義?
如何系統的學習Mathematica?
mathematica軟體是如何盈利的?

TAG:WolframMathematica |