[Tutor] problem solving with lists

dn PythonList at DancesWithMice.info
Sat Mar 19 23:35:44 EDT 2022



On 20/03/2022 15.07, Dennis Lee Bieber wrote:
...

>> Similarly, and further to my earlier comment about "real world",
>> @Dennis' explanation of 'golfers and schoolgirls' suddenly brought the
>> problem into focus - I remembered staff at our school (many, many, years
> 
> 	Identifying "shared pairs" is trivial, compared to the search algorithm
> needed for solving the "Social Golfers Problem" (SGP). All one needs is Set
> Intersection operations and a test for >= 2 intersecting elements.

So, first criticism is that line 1:

0 [['a', 'b', 'c', 'd'], ['b', 'c', 'd', 'e'], ['c', 'd', 'e', 'f'],
['d', 'e', 'f', 'g']]the

should be more like:

0 [['a', 'b', 'c', 'd'], ['e', 'f', 'g', 'h'], ['i', 'j', 'k', 'l'],
['m', 'n', 'o', 'p']]

but when it comes to the next list, would

['a', 'c', 'd', 'e']

be unacceptable because although the 'b' has been dropped, the first
three all served-together previously.

Thus, should the remaining lists commence:

['a', 'e', 'i', 'm']...
['a', 'f', 'j', 'n']...
['a', 'g', 'k', 'o']...
['a', 'h', 'l', 'p']...

(at which no more are possible within the limit of 16 names)

- or have I still 'missed' whatever the OP's objective might be?
(because this still seems like a relatively-trivial selection exercise)


> 	That is way much more theory than I'm willing to approach on a "tutor"

Which is why the OP would be best served by actually giving us the
result-expected, and thus something against which to measure our advice,
and success or otherwise in finding a solution...


> role. Add in that, in the late 70s, CompSci at my college WAS a Math major
> (not physics) -- reducing the number of advanced math coursed to be taken.
> Graph theory was the most complex, along with Statistics 1 (Stat-2 was a
> requirement of the Business Computing specialty -- using SPSS; I was in
> System Software specialty which meant assorted OS and language design
> courses).

Yes, I too was manufactured in the fifties (most parts still original!),
but our uni enabled the business route ("Data Processing" in the terms
of the day). Yes to the stats courses. However, this skewed into
econometrics and modelling. No to graph theory as a formal course, but
obviously I picked-up it and trees along the way, and to help cope with
knot theory. (not much to do with ropes!)

We didn't cover compilers, other than maybe a single lecture. My intro
to systems programming came when I had a team of mainframe sys-progs to
supervise - and regularly remind that they didn't actually own the
machine, it was (also) there for workloads to be run...

Referring to "waking nightmares", all I need say is "JCL"!


>> Thanks @Dennis!
> 
> 	For waking nightmares? <G>

The business of programming is a constant reminder of human frailty -
the interpreter/compiler is always merciless in pointing-out our faults!


> * obscure reference https://lyricsjonk.com/ronnie-milsap-pure-love.html AND
> the old Ivory soap advertisements

I'm glad you pointed it out. I knew I'd heard it (somewhere) before, but...

Thereafter disappeared into memories of Cap'n Krunch, "Seadog", and the
(what were they?) the milkies/soakies/sloppies. I've got to get a life -
everyone else is alive!

-- 
Regards,
=dn


More information about the Tutor mailing list