New answers tagged

1

Clear["Global`*"] $Version (* "12.3.1 for Mac OS X x86 (64-bit) (June 19, 2021)" *) You cannot use E as a variable name since it is used for the exponential constant. Use [DoubleStruckCapitalE] instead. $Assumptions = Element[i | λ | n, Integers] && i > 0 && λ > 0 && n > 0 && Element[\[...


24

Go to the menu Edit > Preferences > Appearance > Formatting > Multiplication. Uncheck Functions.


2

Try this: P = {};(*empty list*) a = -Pi/2; b = 3 Pi/4; tolorance = 0.0000; f[x_] := Sin[x] && a <= x <= b; For[i = 1, i <= 11, i++, {c = (a + b)/2, If[f[a]*f[c] < tolorance, b = c, a = c], AppendTo[P, {i, N[a, 4], N[b, 4], N[c, 4], N[f[c], 4]}]}] P and use Syed's code to improve the presentation: PrependTo[P, #] &@{"#",...


6

Table is the preferred form of usage in Mma and you can assign this table a name for later use. With the function as defined above, (a = -Pi/2; b = 3 Pi/4; tolerance = 0.0000; t = Table[c = (a + b)/2; If[f[a]*f[c] < tolerance, b = c, a = c]; {i, N[a, 4], N[b, 4], N[c, 4], N[f[c], 4]}, {i, 1, 11}]); t // Grid[#, Alignment -> "."] &...


5

Clear["Global`*"] a = -Pi/2; b = 3 Pi/4; tolorance = 0.0000; f[x_] := Sin[x] && a <= x <= b; EDIT: Added headings Table[c = (a + b)/2; If[f[a]*f[c] < tolorance, b = c, a = c]; {N[a, 4], N[b, 4], N[c, 4], N[f[c], 4]}, {i, 11}] // TableForm[#, TableHeadings -> {Range[11], {"a", "b", "c", "...


Top 50 recent answers are included