Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    I have recently realised how handy spreadsheets can be for working with examples in combinatorics, e.g. in constructing a family of subsets of a given set satisfying certain properties. Searching for tips and tricks on the internet didn't turn up anything useful. I want to ask the community if they know of any good references for these, or to share their own tips if they have any. Also, I use Open Office, so I'm not looking for anything specific to M$ E***l, or proprietary add-ons thereto. I would argue that this should go on MO and not SO since I want answers specific to combinatorics (of the enumerative, design theoretic variety).

    I'm thinking along the lines of asking as [soft-question], [big-list], [reference-request] and maintaining a consolidated comm.wiki answer. But I'll wiki-fy the whole thing if the folks on meta think that's better. So, is this question appropriate?
  2.  

    It seems weird to be using a spreadsheet for anything mathematical. Why not a CAS? Probably any such question should somehow explicit address this.

  3.  
    Scott,

    To answer your question, mainly drag'n'drop, colour-coding and Ctrl+Z. Since all I'm looking for is something to stare at and play around with.

    I hadn't thought of the possibility that _nobody_ uses spreadsheets for that kind of thing. Maybe I should ask people what they use.
    • CommentAuthorMariano
    • CommentTimeSep 18th 2010 edited
     

    Excel, OpenOffice Calc or any other such thing are quite not fit for enumerating anything!

    If you are into that sort of things, I assure you that the (very short) time needed to be usefully fluent in python, say, is the very best investment you can do.

  4.  
    Let me defend and Sonia and say that I can certainly see that a spreadsheet might be a good way to make a list of all the small examples of something (or all the small examples and non-examples) of something.

    For example, if you want to find a bijection between two Catalan sets, it can be helpful to look all 42 objects "of weight 5" of each set simultaneously and start matching.

    I think the current generation of grad students is the first generation that would naturally think of doing this on a spreadsheet. I handle these sorts of things with 50 or more square feet of blackboard. If I need a bit more permanence and don't have a large board on which I can leave things for long periods, I use a few sheets of paper and photocopy them (so I can scribble all over them and throw them away).
  5.  
    I'm not seeing what is particular to a spreadsheet that makes it suitable for the job, Alexander. It seems like the main thing you're interested in is the layout -- the way the data is presented. This is readily accomplished in almost any high-level language. Moreover, a spreadsheet I would think would be rather inefficient and inextensible.
    • CommentAuthorYemon Choi
    • CommentTimeSep 18th 2010
     

    Chacune à son goût? It seems that Sonia is using an easy tool at hand to aid visualization (if Alexander's comments are on the mark) and so I don't quite "get" the tone of some of the responses.

  6.  

    I'd like to second Yemon's comment. (I also use spreadsheets in this way.)

    • CommentAuthorRyan Budney
    • CommentTimeSep 18th 2010 edited
     
    @Yemon, I'm not sure I see the tone the way you do. I agree with Mariano in large part -- languages like Python are so feature-rich, portable and extensible that I expect you could do anything Sonia is looking for more quickly, and with a more pleasant output and with less effort. Moreover, the code would likely be far easier to perturb in other directions later by other people. If you use the appropriate tool for the job, it's that much easier for you and anyone who wants to build on what you've done.
  7.  
    @Ryan : That would involve learning Python, etc. I'm pretty good with C and C++, but I would have to have a VERY good reason to spend some time learning a new language. If a spreadsheet did what I wanted, then I'd definitely use it.
    • CommentAuthorRyan Budney
    • CommentTimeSep 18th 2010 edited
     
    @Andy, one of the nice things about Python is that if you've ever learned any high-level language, Python is a very quick adaptation -- I've been coding in C++ for 16 years almost exclusively, and I still feel like I don't entirely understand all the nuances of the language. Python isn't remotely like that. You write a "hello world" app, and you've pretty much got it figured out, unless you're going to start importing C++ libraries or something. I suppose this has drifted from the original question somewhat and for that I'm sorry Sonia.
    • CommentAuthorYemon Choi
    • CommentTimeSep 18th 2010
     

    Ryan, my impression is that the spreadsheet was being used like a sketchpad. Sometimes you just want to use the ingredients or implements at hand, rather than go out and buy a new skillet and Kobe beef.

    I guess, having also spent some time as a grad student with people who evangelized the right way of doing computer-based things, I am perhaps being needlessly touchy.

  8.  
    Yemon, I'm somewhat on the opposite road.

    When I was a child (like, grade 9,10, etc) I wrote software for hospitals, engineering companies and wrote video games for my own amusement. I was very much a hacker that took the shortest route to the end result with no thought towards re-use, or other people looking at the code.

    Now I'm on the other side and I'm trying to re-use other people's code. :) So I'm tightening up my standards.
  9.  
    So to sum up, my original question may not attract very many useful answers, and has a real chance of attracting some minor controversy.

    Guess I really should get around to learning python.
    • CommentAuthorMariano
    • CommentTimeSep 20th 2010
     

    There was no need to defend Sonia! :)

    Sonia, python is not the only good alternative: I usually use Mathematica or Haskell to do enumerations of combinatorial things, but I prefer the first if I am going to do pictures. Also, Mathematica can, with a bit of wrapping your head around its philosophy, be made to make quite nice pictures of anything: its graphical language is rather straightforward; but apart from simple interactive manipulations (like changing parameters in 7.0's Manipulate construct---you'll find tons of examples of this in Wolfram's Demonstration Project online) I have not managed to manipulate graphically the output in a way that is useful to me---I imagine it is possible, though.

    • CommentAuthorDougy
    • CommentTimeSep 23rd 2010
     
    My research is in design theory (in particular Latin squares) and I use Excel (or variants) quite often when I need to construct an example of Latin square "by hand". There's a high chance of making a mistake somewhere, and I don't want to get the white-out out and fix up one that's on paper. Why do I not write a program to construct the Latin square?

    - Often I do (I personally use GAP), but some of the constructions are quite intricate so I need to check each line of code with an explicit example (which I draw in Excel).
    - Sometimes the Latin square I want to construct is mentally ill-defined, but drawing it by hand will give me an idea of what conditions I need. If I later find that I actually wanted some other conditions, I might have to completely re-write the code. Moreover, Excel will point out errors along the way (whereas in GAP, I'll have to write the code, Read(...) it and test it).
    - Sometimes the Latin square I am trying to construct does not actually exist, whence the program would tell me it does not exist (but how can I know if my code is correct?). Working it out by hand gives me insight into why it doesn't exist (and typically an idea of how _not_ to prove it's non-existence, because a partial construction exists).

    There are, of course, numerous and significant advantages of writing code instead of using Excel in a range of applications (but this is the other side of the coin).
  10.  
    Dougy, one of my points was you could very easily write software that produces an environment similar to Excel for the purposes of studying Latin squares. Then you could build whatever additional functionality into it you like, rather than being stuck with the Excel environment.
    • CommentAuthorMariano
    • CommentTimeSep 24th 2010 edited
     

    What parts of Excel as useful in constructing Latin squares? I imagine the built in table is probably useful, but does any other spreadsheet facility come into play? For example, would MS Paint and a mouse comfortable enough that you can write with it also do?

    • CommentAuthorVP
    • CommentTimeSep 24th 2010
     

    In view of many interesting (and unexpected) comments on this thread, I think that it would make perfect sense if Sonia goes ahead and posts her question! It also appears to me that with increasing frequency, meta discussions become ersatzes for the proper Q & A at the main site. Surely this was never intended.

    • CommentAuthorDan Moore
    • CommentTimeOct 5th 2010
     
    I use Excel to investigate lower dimensional members of some families of polytopes I'm interested in. Starting with the vertex-facet incidence matrix of polytope P, I create a sheet that has one row per element of P (there are also columns for the vertices of P.) For each row, I put a name of the combinatorial type of the element of P in column A. The spreadsheet counts the number of vertices in the element of the dual polytope P* corresponding to each element of P. I populate columns containing the number of facets of each element of P*, and a name of its combinatorial type.

    I use Filter to select only the rows having a 1 in a selection of vertex columns (representing the face lattice of an element of P*), or starting from the bottom (where there are rows corresponding to the facets of P, and vertices of P*), to select only the rows containing a selection of all the blanks of a facet of P (representing the face lattice of a facet of P).

    Using a spreadsheet is not the fastest way to do the computations, of course. But I enjoy it, and also, I'm mainly investigating - I don't always know what I'm looking for.