New answers tagged

2

Try this v={{1.25, 0},{1.3, 0.125},{1.4, 0.175},{1.5, 0.225},{1.6, 0.275}, {1.7, 0.275}, {1.8, 0.325},{1.9, 0.375}, {2., 0.375}, {2.1, 0.375},{2.2, 0.425}, {2.3, 0.425}, {2.4, 0.475}, {2.5, 0.475}, {2.6, 0.475}, {2.7, 0.475},{2.8, 0.525}, {2.9, 0.525}, {3., 0.525},{3.1, 0.575}, {3.2, 0.575}, {3.3, 0.575}, {3.4, 0.575}, {3.5, 0.575}, {3.6, 0.625}, {3....


2

As long as $n\ge b$, the number of solutions of FrobeniusSolve[Range[n], b] is PartitionsP[b], which is not all that large. For example, your command 1 FrobeniusSolve[Range[36], 8] has PartitionsP[8] == 22 solutions: {{0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...


14

Grid ClearAll[labeledGrid] labeledGrid[cs_: "GrayTones", is_: {80, 80}, sty_: Directive["TR", FontSize -> 16, Black]] := Module[{tbl = Map[Item[Pane[Style[If[NumericQ@#, NumberForm[#, 2], #], sty], Alignment -> Center, ImageSize -> is], Background -> If[NumericQ@#, ColorData[cs][(1 + #)/2], None]] &, Prepend[...


8

Readapting my answer here: DensityPlot with text dim = Dimensions@ccm; temp = Transpose[{mem}~Join~Transpose@Round[ccm, .01]]; table = Prepend[temp, Flatten@{"", mem}]; background = Join[{None, None}, {Flatten[ Table[{i, j} -> ColorData["GrayTones"][table[[i, j]]], {i, 2, 1 + dim[[1]]}, {j, 2, 1 + 3}], 1]}]; Grid[table , Frame -&...


9

How about using MatrixPlot? epilog = MapIndexed[Text[Style[Round[#, .01], 10], #2 - 1/2] &, Transpose@Reverse@ccm, {2}]; ticks = Transpose[{Range@Length@mem, mem}]; MatrixPlot[ccm, Epilog -> epilog, FrameTicks -> {ticks, ticks, ticks, ticks}, PlotRangePadding -> None, ColorFunction -> (ColorData["GrayTones"][(1 + #)/2] &), ...


4

Generate data, leaving off the header. RandomSeed[1234]; data = Table[{"item "~StringJoin~ToString[i], RandomInteger[100]}, {i, 1, 100}]; Sort it on the last column, large to small. sorted = Reverse@SortBy[data, Last]; Get an accumulation of the last column, and the total. accum = Accumulate@sorted[[All, 2]]; tot = Last@accum; Calculate a third of the ...


6

ClearAll[abcF, pw] pw = Piecewise[{{"A", # >= 2/3}, {"C", # < 1/3}}, "B"] &; abcF = pw /@ Normalize[Accumulate @ Sort @ #, Last][[Ordering @ Ordering @ #]] &; Example: SeedRandom[1] n = 30; data = Prepend[Table[{"item "~StringJoin~ToString[i], RandomInteger[100]}, {i, 1, n}], {"product name", "profit"}]; Use abcF to assign a label to ...


Top 50 recent answers are included