Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Logic problem: need better logic for desired thruth table. Date: Thu, 28 May 2015 22:54:23 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 56 Message-ID: References: <3794b$55678d83$5419aafe$56138@news.ziggo.nl> <67de616e-5af7-417d-88a9-db1c665df473@googlegroups.com> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1432853663 7532 67.130.15.94 (28 May 2015 22:54:23 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 28 May 2015 22:54:23 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:91404 On 2015-05-28, Michael Torrie wrote: > On 05/28/2015 03:58 PM, sohcahtoa82@gmail.com wrote: >> I think the logic you're really looking for is: >> >> return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected)) > > Yes this is the simplest form. Not really. In old school notation, that's ___ A + A+B Apply De Morgan's law to the second term _ _ A + (A * B) Invert ________ _ _ A + (A*B) Apply Demorgan's law once _____ _ _ _ A * (A * B) and again for the second term _ A * (A + B) Apply the distributive property: _ _ A*A + A*B The first term is always false, so we can drop it: _ A*B Now invert it again to cancel out the one we did back a few steps: ___ _ A*B De Morgan one last time: _ A + B -- Grant Edwards grant.b.edwards Yow! Xerox your lunch at and file it under "sex gmail.com offenders"!