Tag Info

New answers tagged

1

found something that works: Sum[Boole[! (IntegerPart[x] == x)], {x, 1, Infinity}] 0 This other thing I suggested does not work: intq[x_?NumericQ] := IntegerQ[x]; Sum[Boole[! intq[x]], {x, 1, Infinity}] (* remains unevaluated *) It could be Sum is smart enough to first simplify assuming integers: Simplify[ Boole[(! IntegerPart[x] == x)] , ...


6

Before x is a assigned a value its Head is Symbol. Thus IntegerQ[x] yields False. That means Boole[!IntegerQ[x]] will be simplified to 1 and the sum will not converge. This can be seen with Trace. Any integer value as upper bound of the sum will however yield 0 as expected. Sum[Boole[! IntegerQ[x]], {x, 1, 100}] Out: 0 As far as I understand the ...


1

In addition to what Leonid wrote, here is the orthogonality relation that you may be looking for: Off[ClebschGordan::phy]; With[ {l = 4, s = 3}, U = Flatten[Table[ Flatten[Table[ ClebschGordan[{l, ml}, {s, ms}, {j, m}], {ml, l, -l, -1}, {ms, s, -s, -1}]], {j, l + s, l - s, -1}, {m, j, -j, -1}], 1]; Transpose[U].U == U.Transpose[U] ...


1

You are not using the right formula, Mathematica has nothing to do with this. When you do the summation, you have to keep the z-projection of the angular momentum fixed for the total momenta (of both initial and final state). The meaning of getting one is that you have both the angular momentum conserved, and the decomposition of unity, when you sum over all ...


2

Quite obviously the frog will reach the top while on a 5-meter-up move. It is the easier to assume that it first goes down 3 meters and then up 5 meters, for a total of 2 meters up. Now, starting from -30, go up 5 to -25 (day 1) and then repeat the above (-3+5=2) steps. The number of days is thus $1+\lceil 25/2 \rceil = 14$ (sorry, no Mathematica!)


1

Just in the spirit of fun I post this as another: just a variant. res=NestWhileList[Function[{x,j},{1+4 Cos[Pi j]+ x,j+1}]@@#&,{-30,0},First@#<0&] As before the number of steps is Length@res-1 and number of days Ceiling[Length@res/2-1/2].


5

Using a recurrence equation :- height = -30; slip = 3; climb = 5; sol = RSolve[{a[n + 1] == a[n] - slip + climb, a[0] == height + slip}, a, n] {{a -> Function[{n}, -27 + 2 n]}} f = First[a /. sol]; n = 0; While[f[n] < 0, ++n] Print["Frog reaches the top on day ", n] Frog reaches the top on day 14


6

Just for fun and a little ugly: f[x_, c_] := {x + (3 + 2 Mod[c, 2]) (-1)^(Mod[c, 2] + 1), c + 1} ans = NestWhileList[f @@ # &, {-30, 1}, First@# < 0 &]; The number of steps is Length@ans-1. Visualizing: This was animated gif made from: {pos, steps} = Transpose[ans]; anim = MapThread[ ListPlot[pos[[1 ;; #1]], Epilog -> ...


4

froggy[wellHeight_Integer] := Switch[EvenQ[wellHeight], True, wellHeight - 3, False, wellHeight - 4]; (* 30 Meter well *) froggy[30] (* 27 *) I will wager this is the highest performing solution ;-} An actual tailorable method: up = 5; down = 3; height = 30; moves = 0; While[Sum[Boole[OddQ[x]] up - Boole[EvenQ[x]] down, {x, 1, moves}] <height, ...


5

Not sure whether this is simpler, but it more directly follows the problem, and you don't have to compute the number of iterations in advance: Rest[ NestWhileList[{First@# + If[EvenQ[Last@#], 5, -3], Last@# + 1} &, {0, 0}, First@# < 30 &] ][[All, 1]] (* {5, 2, 7, 4, 9, 6, 11, 8, 13, 10, 15, 12, 17, 14, 19, 16, 21, 18, 23, 20, 25, ...



Top 50 recent answers are included