# Tag Info

24

The symbols that are market [[EXPERIMENTAL]] in the documentation are in their own entity class of the "WolframLanguageSymbol" entity type named "UnderDevelopment". EntityClass["WolframLanguageSymbol", "UnderDevelopment"] Here is a list of all the 25 symbols currently (version 10.3) in EntityList[EntityClass["WolframLanguageSymbol", "UnderDevelopment"]] ...

13

Suggested solution If I understood the question right, then the simplest solution here would probably be to define a helper function like the following: vv[n_] := InternalInheritedBlock[{v}, v /@ Range[n]]; Then, you get vel = vv[m] and every run of vv would result in different set of values, while the values in the set will all come from the same ...

8

IntervalMemberQ[Interval[{-2, 6}], 3] (* => True *)

8

Mathematica 10.3 In Mathematica 10.3 there is a new function Between: Between[3, {2, 5}] True Previous versions of Mathematica You can define your own function with the same behavior: My take mybetween[a_, {b_, c_}] := TrueQ[b <= a <= c] or as suggested by @mmal mybetween[a_, {b_, c_}] := IntervalMemberQ[Interval[{b, c}], a] We can ...

8

Use the PermutationOrder function: In[1]:= elt = Cycles[{{1, 2}, {3, 4, 5}}]; In[2]:= PermutationOrder[elt] Out[2]= 6 This is indeed the answer you expect, and the smallest power you can raise elt to and get the identity permutation. In[3]:= PermutationPower[elt, #] & /@ Range[6] Out[3]= {Cycles[{{1, 2}, {3, 4, 5}}], Cycles[{{3, 5, 4}}], Cycles[{{1, ...

7

The type of a permutation of length $n$ is $\{\lambda_1, \lambda_2, \ldots, \lambda_n\}$ where $\lambda_i$ is the number of cycles of length $i$. Therefore, the number of permutations of $\{1, 2, 3, 4, 5, 6\}$ that have two 1-cycles and two 2-cycles is NumberOfPermutationsByType[{2, 2, 0, 0, 0, 0}] (* 45 *) The best reference for Combinatorica is Steven ...

6

Note the following a=3; g[a]=2; g//Definition g[3]=2 We see that the definition g[3]=2 was stored, rather than g[a]=2. The argument of g, which is a, is evaluated before the definition is made. The same happens in your code. f[a__] evaluates to a__ before the definition is made. f//Definition f[a_]:=a f[a__]:=f[a] I like the following ...

6

With Version 10.x there is FunctionDomain: fun = (Exp[2*x] - Log[E + x])/(x^3 + Sin[x]*Cos[x]) FunctionDomain[fun, x, Reals] -E < x < 0 || x > 0 fun /. x :> 0 Indeterminate Table[{x, fun}, {x, -1, 1, 0.1}] // ListPlot produces error messages and "skips" the point at x = 0 Plot[fun, {x, -1, 1}] doesn't produce error messages ...

6

This is a limitation in TemporalData that MovingMap was designed to work with. Note that TimeSeries and EventSeries are really just special cases. I don't know if it is a necessary limitation but a decision was made at the time they were created that the dimensionality of the data values need to be consistent. Now whether this restriction should be relaxed ...

5

The Mathematica way is to write Total[#2 Exp[# x] & @@@ list] The same with the part of the list: Total[#2 Exp[# x] & @@@ list[[2 ;; 4]]] Also you can write an explicit sum with EscsumtEsc:

5

This is another problem that used to be kind of a pain back before Mathematica 10, but is now dramatically simplified by Associations and the related functions: CompareRows[tables:{___List}] := MapThread[SortBy, {(Apply[Join]) @* Values /@ KeyIntersection[GroupBy[First] /@ tables], PositionIndex /@ tables}]; The SortBy/PositionIndex ...

5

Just going on the figures I see in the linked page, it seems if you are dealing with two continuous distribution functions, defined for all real numbers, then the overlap is just the minimum of the two at all points. If they are allowed to go negative, then a different definition is needed I think. We'll look at the overlap between two Gaussians ...

4

I thought perhaps the limit of a Riemann Sum: Needs["NumericalCalculus`"] riemann[f_, {a_?NumericQ, b_?NumericQ}, n0_?NumericQ] := With[{n = Ceiling[n0]}, With[{partition = Union[{a, b}, RandomReal[{a, b}, n - 1]]}, With[{values = RandomReal /@ Partition[partition, 2, 1]}, Differences[partition].f[values] (* assumes f is Listable -- f /@ ...

4

Using DialogInput instead of CreateDialog DialogInput[ Grid[{{"Year:", InputField[Dynamic[yyyy], Number]}, {"Month:", InputField[Dynamic[mm], Number]}, {"Day:", InputField[Dynamic[dd], Number]}, {CancelButton[], DefaultButton[ DialogReturn[{Year = yyyy, Month = mm, day = dd}]]}}, Spacings -> {1, Automatic}, Alignment -> Left]] ...

4

Yes, the crash is a bug and has been fixed as of version 10.2. But I would recommend upgrading to 10.3 to avoid running into this Nearest problem. Possible workarounds for 10.0.2 or 10.1 include applying N as shown in the question, or specifying DistanceFunction -> (Norm[#1 - #2] &).

4

You can get the expected output by defining the functions in reverse order. f[f[a__]] := f[a] f[a_] := a f[x, y] f[x, y]

4

I think you are confusing the behaviour of With and Block t = x; Block[{x = 1}, t] (* 1 *)

4

t = x; With[{x = 1}, Evaluate[t]]

4

OK, let me extend the comment into an answer. If ft still contains InverseFunction, your goal can be achieved by (* Solution 1 *) tf = First@Head@ft (* Solution 2 *) tf = ft[[0, 1]] (* Solution 3 *) tf = InverseFunction@Head@ft (* Solution 4 *) tf = InverseFunction@ft[[0]] (* Solution 5 *) tf = InverseFunction@Function[t, #] &@ft Solution 5 should ...

4

As far is I can tell, there is no built-in command to do so. However, typing ?*MatrixQ Into the front end and evaluating will give a list of the matrix properties you can test for in Mathematica. Based on the resulting list, I came up with the following simple function that you might find useful. This is just a helper function to make the output look ...

4

Since you are discarding all circles strictly in the interior, substantial time is spent generating them so that they do not intersect other circles and later determining that they are strictly interior to the boundary. Better is to only generate circles that intersect the boundary. This can be done by generating an x value between low and high, a y value ...

4

To answer the second part of your question, use the efficient code from @DanielLichtblau, findPoints2, to generate some disks. SeedRandom[111]; pts = findPoints2[50, 0, 1, 0.03, 2.2*0.03] Intersections of the square and disks are given by RegionIntersection with two different heads: DiskSegment for disks along an edge of the square, and RegionIntersection ...

3

Have a look Range and MemberQ. As well Testing Expressions. myList = Range[-2, 6, 1] {-2, -1, 0, 1, 2, 3, 4, 5, 6} myVal = 3 3 MemberQ[myList, myVal] True

3

Animate[ Graphics[{Red, GeometricTransformation[Rectangle[{-2.5, -0.5}, {2.5, 0.5}], RotationMatrix[\[Theta]]]}, Axes -> True, PlotRange -> {{-10, 10}, {-10, 10}}], {\[Theta], 0, 2 Pi}] As per your comment, if you do not want to use the built in RotationMatrix then please see this: ...and this:

3

Jacob gives a good exposition on different methods that work. But, to avoid any possibility of ambiguity, I would go with something very different f[a_] := a f[q_f] := q which is correctly ordered DownValues@f (* {HoldPattern[f[q_f]] :> q, HoldPattern[f[a_]] :> a} *)

3

Assuming the lists in omega do not contain duplicate numbers, you can use something like this: f[i_][j_] := Flatten@ IdentityMatrix[ Length@ omega[j] ][[#]]&@ Flatten@ Position[omega[j], i] PS: You should clarify your actual intention in your question, I'm going on information from your comment to Sjoerd C. de ...

3

For the second part: {#, Mean@Thread[f[a, #]]} & /@ b (* {{10, 5605/2}, {11, 8107/2}, {12, 5685}} *) For the first part: Outer[f, a, b]

3

There does not appear to be a solution. FindRoot gets as close as it can. Plot[{q1[t], -q2[t]} /. lagrangesolveg2 // Evaluate, {t, 0, 1}] Plot[{q1[t], -q2[t]} /. lagrangesolveg2 // Evaluate, {t, 0.05, 0.2}]

3

The following shows a way to emulate the summary boxes using only documented constructs: grid[g_] := Column[Row /@ MapAt[Style[#, Gray] &, g, Table[{i, 1}, {i, Length[g]}]]] MakeBoxes[c : foo[___], form : (StandardForm | TraditionalForm)] := With[{boxes = RowBox[{"foo", "[", ToBoxes[Panel[ OpenerView[ ...

3

Limit can actually approach a value from any direction in the complex plane. For instance Limit[__, Direction -> I] is valid. To have a bidirectional limit along the real line, you'll have to implement it yourself. Something like this should work pretty well I think. Basically just take limits in both directions and make sure they equal. ...

Only top voted, non community-wiki answers of a minimum length are eligible