12 questions linked to/from Lazy lists of Tuples and Subsets
130k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
5k views

### Functional style using lazy lists?

Let's say I want to answer the question "what are the first 400 palindromic prime numbers?" The first approach that comes to my mind from the set of languages that I know is to use some sort of lazy ...
986 views

### Getting number of binary digits combinations without “forbidden” patterns

I need to get the number of all combinations of binary digits in an 8-digit binary number, but not including those that follow some "forbidden" patterns like these: ...
445 views

### Lazy form of Tuples/Outer to loop over list of lists

This is less a question and more asking if someone has implemented this already, with more skill. I need to perform the Outer-like generalized outer product of a ...
830 views

### Alternative to Subsets to generate k-combinations

I need to generare a huge number of k-combinations for a quite big set of numbers (more than 100), so I would avoid Subsets because it requires too much memory (it generates all subsets at once). I ...
498 views

### Problem with creating a large list of tuples

This is a follow-up question from Sum of Multinomial Coefficients I have thought about the meaning of the formula I mentioned and, with help, I implemented the following code: ...
162 views

### How to generate a limited number of tuples of a list and not all?

I have a question for which I couldn't find an answer: how can we generate only a given number of tuples of a list and not all of them? For instance, I want to have only the first two 3-tuples of <...
133 views

### Consecutive generation of subsets [duplicate]

It is well known that the array of subsets of even small set is very big. This leads to problems with machine memory. Is there an effective way to generate subsets sequentially?
59 views

### Lazy tuples made from arbitrary lists [duplicate]

I am dealing with Tuples of n lists each having potentially different length: longList = Tuples[list1, list2, ..., listn]: Since I have to iterate over the ...
50 views

### Mathematica breaks [closed]

I write the following command. After running for seconds (less than a minute), Mathematica breaks and nothing is displayed. Why? a = Tuples[{1, I, -I}, {1, 20}] ...