Search NKS | Online

11 - 20 of 25 for ReplacePart
But what if one replaces some of these hexagons by pentagons? … But if pentagons are introduced, as in the cases on the left, the network will increasingly behave as if it has positive curvature—like part of a sphere.
During the evolution the rule can apply only to the inner part FixedPoint[Replace[#, ℯ [x_]  x] &, expr] of an expression. The depth of this inner part for initial condition ℯ [ ℯ ][ ℯ ][ ℯ ][ ℯ ][ ℯ ] is shown below.
And for this to happen s or t must match some part w of u or v . The simplest way this can be achieved is for s or t to reproduce w when its variables are replaced by appropriate expressions.
With a grid of cells set up in advance, each step in this type of Eden model can be achieved with AStep[a_] := ReplacePart[a, 1, (# 〚 Random[ Integer, {1, Length[#]}] 〛 &)[Position[(1 - a)Sign[ ListConvolve[{{0, 1, 0}, {1, 0, 1}, {0, 1, 0}}, a, {2, 2}]], 1]]] This implementation can readily be extended to generalized aggregation models (see below ).
A single step in evolution of a general cellular automaton with state a and rule number num is then given by Map[IntegerDigits[num, k, k^Length[os]] 〚 -1 - # 〛 &, Apply[Plus, MapIndexed[k^(Length[os] - First[#2]) RotateLeft[a, #1] &, os]], {-1}] or equivalently by Map[IntegerDigits[num, k, k^Length[os]] 〚 -# - 1 〛 &, ListCorrelate[Fold[ReplacePart[k #1, 1, #2 + r + 1] &, Array[0 &, Table[2r + 1, {d}]], os], a, r + 1], {d}]
The transitions between these states have probabilities given by m[Map[Length, list]] where m[s_] := With[{q = FoldList[Plus, 0, s]}, ReplacePart[ RotateRight[IdentityMatrix[Last[q]], {0, 1}], 1/Length[s], Flatten[Outer[List, Rest[q], Drop[q, -1] + 1], 1]]] The average spectrum of sequences generated according to these probabilities can be obtained by computing the correlation function for elements a distance r apart ξ [list_, r_] := With[{w = (# - Apply[Plus, #]/Length[#] &)[ Flatten[list]]}, w .
When predicate logic is used as part of other axiom systems, there are typically axioms which define properties of the predicates. … But for the most part it has turned out to be too rigid to capture directly typical everyday reasoning processes.) … A typical issue is that in, say, ∀ x ( ∃ y ( ¬ x  y)) , x and y are dummy variables whose specific names are not supposed to be significant; yet the names become significant if, say, x is replaced by y .
In the special case a = 4 , it turns out that replacing x by Sin[ π u] 2 makes the mapping become just u  FractionalPart[2 u] , revealing simple shift map dependence on the initial digit sequence.
The following will update triples of cells in the specified order by using the function f : OrderedUpdate[f_, a_, order_]:= Fold[ReplacePart[ #1, f[Take[#1, {#2 - 1, #2 + 1}]], #2] &, a, order] A random ordering of n cells corresponds to a random permutation of the form Fold[Insert[#1, #2, Random[Integer, Length[#1]] + 1] &, {}, Range[n]]
Given an original DNF list s , this can be done using PI[s, n] : PI[s_, n_] := Union[Flatten[ FixedPointList[f[Last[#], n] &, {{}, s}] 〚 All, 1 〛 , 1]] g[a_, b_] := With[{i = Position[Transpose[{a, b}], {0,1}]}, If[Length[i]  1 && Delete[a, i] === Delete[b, i], {ReplacePart[a, _, i]}, {}]] f[s_, n_] := With[ {w = Flatten[Apply[Outer[g, #1, #2, 1] &, Partition[Table[ Select[s, Count[#, 1]  i &], {i, 0, n}], 2, 1], {1}], 3]}, {Complement[s, w, SameTest  MatchQ], w}] The minimal DNF then consists of a collection of these prime implicants.
12