Tag Info

New answers tagged

1

You might try the following languages = DictionaryLookup[All] longest[lang_] := longest[lang] = Max[StringLength[DictionaryLookup[{lang, All}]]] SortBy[Table[{lang, longest[lang]}, {lang, languages}], Last] longestwords[lang_] := longestwords[lang] = { lang, longest[lang], Select[DictionaryLookup[{lang, All}],(StringLength[#] == ...


1

Let me answer your question by first clarifying some of the fundamentals about Mathematica: A. Mapping over list. If you have a function, you can apply it to a list of values by using Map: Range[10] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} Map[Sqrt, Range[10]] $\left\{1,\sqrt{2},\sqrt{3},2,\sqrt{5},\sqrt{6},\sqrt{7},2 \sqrt{2},3,\sqrt{10}\right\}$ You ...


1

Try this langlength = ({#, Length@DictionaryLookup[{#, All}]} & /@ DictionaryLookup[All]); lst = Sort[langlength, #1[[2]] > #2[[2]] &]; TableForm[lst, TableHeadings -> {Range[Length[lst]], None}] Edit langlength = ({#, Length@DictionaryLookup[{#, All}]} & /@ DictionaryLookup[All]); lst = Sort[langlength, #1[[2]] > #2[[2]] &]; ...


0

Another way: use an immediate or delayed rule: NIntegrate[x^2*q /. q -> x, {x, 0, 10}] or change the replacement q->x on the fly using a function ff[x_]:= 1/(1-x) Table[ NIntegrate[x^2 q /. q:> ff[n x] ,{x,0,10}],{n,3}]


0

Maybe this is what you are looking for. x = 42.; Block[{x, q}, With[{q = x}, NIntegrate[x^2*q, {x, 0, 100}]]] 2.5*10^7 q q The Block construct declares x ansd q in the local scope. Also note, there is no need to use Print much in Mathematica, as the result of evaluating an expression or last expression in a compound expression ("statement") is ...



Top 50 recent answers are included