Timeline for Memory efficient generation and selection of tuples
Current License: CC BY-SA 3.0
21 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 14, 2015 at 23:18 | history | edited | J. M.'s missing motivation | edited tags | |
| Jul 9, 2013 at 6:49 | vote | accept | Zibadawa | ||
| Jul 8, 2013 at 7:49 | answer | added | Zibadawa | timeline score: 2 | |
| Jul 8, 2013 at 2:20 | answer | added | halirutan | timeline score: 14 | |
| Jul 7, 2013 at 21:13 | comment | added | Zibadawa | @Michael Ah, I see. I've edited the question to use bracket notation, instead. Hopefully that is more readable. I'm not familiar with using that notation in notebooks, or currently understand what the upshot of easier downvalue assignments are. Would I be correct in assuming that notation change is nothing more than replacing all instances of $d_i$ with d[i] in my notebook? | |
| Jul 7, 2013 at 21:08 | history | edited | Zibadawa | CC BY-SA 3.0 | give better mathematica notation for my variables |
| Jul 7, 2013 at 20:48 | comment | added | Michael E2 | @Zibadawa Preferably, one should be able to copy and paste code blocks into Mathematica and test out the code. TeX code is not functional when pasted into Mma. For big or long problems, a simplified example that illustrates the problem is acceptable (and preferred). You can also use d[i] as your variable and have it formatted as a subscript. See this and perhaps point 4 in this. | |
| Jul 7, 2013 at 20:34 | history | edited | Zibadawa | CC BY-SA 3.0 | formatting explanation on the d_i |
| Jul 7, 2013 at 20:32 | comment | added | Sjoerd C. de Vries | @halirutan That loop isn't that big. It takes only 22 s on my laptop. | |
| Jul 7, 2013 at 20:29 | comment | added | Zibadawa | @Michael The underscore stuff was not part of the original Mathematica code. They should be properly typeset subscripts; so type them in as d ctrl+_ i, so it will look like $d_i$ (similary, $d_i^2$). Sorry about that, I couldn't find an easy way to transfer that into the original post at the time. Is mixing latex into the code block acceptable and functional? | |
| Jul 7, 2013 at 19:58 | comment | added | Michael E2 | The real problem aside, I don't think code you posted can be right. I get syntax errors (missing brackets and so forth). And d_i is short for Pattern[d, Blank[i]], which probably ought not to be used as a variable. (For instance Solve[(d_i)^2 == d_i, d_i] returns no solutions.) | |
| Jul 7, 2013 at 18:08 | comment | added | Pankaj Sejwal | Sjoerd's suggestion will work good in case your tuples are less but the increment in tuples is 2^n and algorithms become tortoise. In case of using lattice you will always work closely with relevant information.I would suggest you to find info on "lattice of subsets" and first page of google will take you places. No matter how much you break your tuples, you will not get desired results unless you have few days to spare for one run. | |
| Jul 7, 2013 at 16:57 | comment | added | Zibadawa | @Blackbird I'm not sure what you mean. It sounds in the spirit of Sjoerd's suggestion of breaking the problem up into pieces. Do you have any further details or links for what you are suggesting? | |
| Jul 7, 2013 at 16:48 | comment | added | Zibadawa | @SjoerdC.deVries That idea would seem to be a limited fix. It might work for some examples, but would not scale particularly well to larger ones. I'm not sure right now how to generate a code block that would split the tuples up into a dynamically determined number of manageable subsets. At least not in Mathematica. | |
| Jul 7, 2013 at 16:41 | comment | added | Zibadawa | @halirutan n=30 is fairly easily achieved in 'small' examples. A particular example I've tried to compute that ran into a memory error had about n=24 to n=28 on each of 5 sets of equations. | |
| Jul 7, 2013 at 13:01 | comment | added | halirutan | How large is n typically in your cases? I mean with n=30 you have 2^30 tuples which is a number too large to do even the simplest loop Do[Null, {i, 2^30}];. | |
| Jul 7, 2013 at 11:10 | history | tweeted | twitter.com/#!/StackMma/status/353833407727411200 | ||
| Jul 7, 2013 at 9:11 | comment | added | Pankaj Sejwal | Refer the algorithm to find subsets using "lattice of subsets" which actually starts for small number of promising subsets and than using them together to generate bigger subsets automatically ignoring irrelevant subsets. | |
| Jul 7, 2013 at 8:26 | comment | added | Sjoerd C. de Vries | Would it help if you split your Tuples[{1,0},n] into two Tuples[{1,0},n/2] lists and work through each combination of the two lists, joining elements as you go? | |
| Jul 7, 2013 at 5:26 | review | First posts | |||
| Jul 7, 2013 at 8:21 | |||||
| Jul 7, 2013 at 5:09 | history | asked | Zibadawa | CC BY-SA 3.0 |