My original code was crashing when you used too many digits because apparently Mathematica can handle only so many different font sizes. To fix it, I had to borrow george2079's PDF trick to turn each ...

Here is a start. I'm sure others will come up with better solutions, but I think from here it's mostly down to finding a better algorithm to pick the random lines. First, we get ourselves a Region ...

If it is at all an option to represent the grid as a 2D list instead of a list of infected coordinates, I would model this is a cellular automaton. What you've essentially got is an outer totalistic ...

This has been discussed on comp.soft-sys.math.mathematica. The gist is that there are lots of Unicode characters you could use, e.g. \[LetterSpace] or \[UnderBracket] (you could consult https://...

Image3D isn't what you're looking for. That actually generates a "3-dimensional image" with voxels instead of pixels (by using the given images as layers in the voxel grid). That's what you're seeing ...

Here is one way to generate them directly: it is based on a way to generate all permutations but discards invalid ones early: derangements[{}, ___] = {{}}; derangements[list_List, orig_List] := ...

Simulating only a single generation is trivial. Just omit the Dynamic and the tspec. gameOfLife = {224, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}}, {1, 1}}; board = RandomInteger[1, {64, 64}]; ArrayPlot@...

Starting at 10.1, there's a fairly neat solution using SequenceCases: list = {1, 2, 4, 5, 7, 11, 8, 7, 3, 1, -3, -2, 6, 7, 80}; SequenceCases[list, x_ /; Less @@ x || Greater @@ x] (* {{1, 2, 4, 5, 7,...

Permutations where no element remains in its original place are called derangements. Counting them is easy enough: the number of derangements of a set of size $n$ is $!n$, or the subfactorial of $n$. ...

TMTOWTDI applies to both of these problems. Below I present an overview of various approaches I've come across, followed by timing data obtained in 10.4 on Windows 10 (the timing code is available as ...

I think you underestimate how many digits this number has. Even if you used scientific notation, the exponent would overflow your PC's memory, so you'd need scientific notation for the scientific ...

I think you're looking for RelationGraph. It takes a list of objects to treat as vertices and a test function which determines whether two given vertices should be connected by an edge: pts = {{0, 0},...

Permutations can do this. You just need to give it enough copies of 1 and 2 such that they can appear arbitrarily often (i.e. n times, where n is the length of your tuples), but only one 3: With[{n = ...

Here is one way to do it, although it gives you a rasterised result. graph = Table[ ParametricPlot[ RotationMatrix[m].{2 + 5 Cos[x], 3 + 6 Sin[x]}, {x, 0, 2 Pi}, PlotRange -> {{-10, ...

The problem is that RandomInteger is reevaluated each time the manipulate is rendered (i.e. when the slider is dragged). You can fix that quite easily, by generating the random numbers outside of the ...

With both StringPattern and RegularExpression the problem is greediness: wildcards will try to match as much as possible. With StringPattern this can be fixed using Shortest: StringReplace[buf, "\\...

StringRiffle can also take strings to prepend and append to the result if you supply three delimiters instead of one. It's not that much terser though: StringRiffle[list, {"*", "*", "*"}] Of course ...

There are a lot of ways to do this. Using Select: Select[list, Count[#, 1] < 2 &] Using Cases: Cases[list, l_ /; Count[l, 1] < 2] Also if the threshold is at 2, then this DeleteCases ...

Whenever you're building a list with While or For, there's a good chance Table or Array can help. In this case, the solution with Table is quite simple: just use two iterators and make the bounds of ...

I believe what you're seeing is a valid solution. Fundamental cycles are defined with respect to a spanning tree. In fact, the documentation says about FindFundamentalCycles: FindFundamentalCycles ...

If I'm understanding your question correctly, something like this would work: list = {{{357, 120}, {271, 78}}, {{239, 90}, {259, 77}}, {{259, 71}, {165, 25}}, {{271, 70}, {337, 30}}}; order = {{...

Yes, it's possible to compute these explicitly. Let's look at exactly what's happening. Only the individual number of occurrences of $0$, $1$ and $2$ matter, which we'll call $c_0$, $c_1$, $c_2$. Let'...

You can get the lists of consecutive pairs with Partition: list1 = {{x1, y1}, {x2, y2}, {x3, y3}}; pairs = Partition[list1, 2, 1] The easiest way to construct your desired output from here is to ...

You can use Map (or its shorthand /@) together with Sequence over the list: list = {a, b, c} Sequence[#, #, #] & /@ list (* {a, a, a, b, b, b, c, c, c} *) For larger amounts of repetition, that ...

What you're looking for is the outer product of all the lists returned by Permutations /@ .... You can use Outer for that. The only issue is that Outer returns the result as a nested list (basically ...

Turning my comment into an answer. If you know that this is exactly the form of the expression, you can just pick out the coefficients manually with First. It's important though that you first turn ...

As Carl Woll hinted at in the comment, for input {x, y} you're looking for the x-subsets of the list {1, 2, ..., x + y}. As you might expect, Mathematica has a built-in for that: fun[{x_, y_}] := ...

This looks like a fairly simple mistake: when correcting the angle you add Pi instead of 2Pi. However, I figured I'd make this an answer, because there's a much simpler way to handle this. You can use ...