Tag Info

New answers tagged

1

My solution: expr = (a*x^2 + b*x*Sin[y] + c*Sin[y])^2 + (a*Sin[y]^2 + b*x)^3; (Cases[Collect[Expand@expr, x], x^2*__]/x^2) // First 2 a c Sin[y] + (1 + 3 a) b^2 Sin[y]^2


1

Mathematica has a built-in called Coefficient which solves the problem: Coefficient[(a*x^2 + b*x*Sin[y] + c*Sin[y])^2 + (a*Sin[y]^2 + b*x)^3, x, 2]


1

This is one of those problems that has many solutions: cb[n_] := MatrixPlot[ Range@ConstantArray[n, n] + Range[n], ColorFunction -> (GrayLevel@Mod[1 + #, 2] &), ColorFunctionScaling -> False, PlotRangePadding -> None, FrameTicks -> { {#, #} &@ Table[{i, n - i + 1, 0}, {i, n}], {#, #} &@ Table[{i, ...


3

For even n: MatrixPlot[ ArrayPad[DiagonalMatrix[{1, 1}], 3, "Reflected"], PlotTheme -> "Monochrome"]


1

Yet another solution, inclusive labeling. Manipulate[ MatrixPlot[Table[If[EvenQ[i + j], 1, 0], {i, 1, n}, {j, 1, n}], FrameTicks -> Transpose[{#, {#, CharacterRange["A", "Z"][[#]]}} & /@ Range[n]], PlotTheme -> "Monochrome"], {{n, 8}, 1, 26}]


4

My answer: cb[n_Integer /; n > 0] := MatrixPlot@SparseArray[{i_, j_} :> Mod[i + j, 2], {n, n}] cb[8] For those who desire a more traditional board: Block[{n = 8}, MatrixPlot[ SparseArray[{i_, j_} :> Mod[1 + i + j, 2], {n, n}], ColorFunction -> GrayLevel, FrameTicks -> { {#, #} &@ Table[{i, n - i + 1}, {i, n}], {#, ...


2

My solution ChessBoard[n_?IntegerQ] := MatrixPlot[ Flatten[ Table[ {Flatten@Table[{1, 0}, {n}], RotateLeft[Flatten@Table[{1, 0}, {n}], 1]}, {n}], 1], ColorFunction -> "Monochrome"] Manipulate[ChessBoard[n], {n, 2, 5, 1}]



Top 50 recent answers are included