Začínáme s Mathematica-ou ... díl 8.
Předchozí Obsah

Logické funkce

Logickou funkcí zde rozumějmež zobrazení z množiny výrazů typu boolean do boolean.

Funkce Not

je funkcí jedné logické proměnné a znamená negaci. M. umožňuje více syntaxí příkazu Not, přičemž:

     Math8/index_gr_1.gif
     Math8/index_gr_2.gif
     Math8/index_gr_3.gif
     Math8/index_gr_4.gif

\!výraz znamená také negaci výrazu /pokud je výraz typu boolean/:

     Math8/index_gr_5.gif
     Math8/index_gr_6.gif

případně: /připomeňme, že výrok "jedna rovná se dvěma" je zpravidla považován za nepravdivý/

     Math8/index_gr_7.gif
     Math8/index_gr_8.gif

Funkce And

je logickou funkcí jedné i více logických proměnných /Pozor, zde se M. odchyluje od obvyklé výrokové logiky, kde je and rezervováno pro 2 /nebo více/ nezávisle proměnné!/ a znamená "logické a" neboli konjunkci; nabývá hodnoty True tehdy , když všechny její argumenty jsou typu boolean a mají hodnotu True, hodnoty False nabývá tehdy, když aspoň jeden argument je typu boolean a má hodnotu False. Pokud jeden argument není typu boolean a ostatní argumenty jsou typu boolean a mají hodnotu True, je výstupem příkazu And zmíněný argument jiného typu, než boolean /ovšem může se v některých případech typem boolean stát/, v případě více takových argumentů jejich konjunkce.

     Math8/index_gr_9.gif
     Math8/index_gr_10.gif
     Math8/index_gr_11.gif
     Math8/index_gr_12.gif
     Math8/index_gr_13.gif
     Math8/index_gr_14.gif

Nebo obdobně:

     Math8/index_gr_15.gif
     Math8/index_gr_16.gif
     Math8/index_gr_17.gif
     Math8/index_gr_18.gif
     Math8/index_gr_19.gif
     Math8/index_gr_20.gif

Jiná syntaxe:

     Math8/index_gr_21.gif
     Math8/index_gr_22.gif

Funkce Or

je logickou funkcí jedné i více logických proměnných /Pozor, zde se M. opět odchyluje od obvyklé výrokové logiky, kde je and rezervováno pro 2 /nebo více/ nezávisle proměnné!/ a znamená "logické nebo" neboli alternativu; nabývá hodnoty True tehdy , když alespoň jeden argument je typu boolean a má hodnotu True, hodnoty False nabývá tehdy, když všechny argumenty jsou typu boolean a mají hodnotu False. Pokud jeden argument není typu boolean a ostatní argumenty jsou typu boolean a mají hodnotu False, je výstupem příkazu Or zmíněný argument jiného typu, než boolean /ovšem může se v některých případech typem boolean stát/, v případě více takových argumentů jejich alternativa.

     Math8/index_gr_23.gif
     Math8/index_gr_24.gif
     Math8/index_gr_25.gif
     Math8/index_gr_26.gif
     Math8/index_gr_27.gif
     Math8/index_gr_28.gif
     Math8/index_gr_29.gif
     Math8/index_gr_30.gif
     Math8/index_gr_31.gif
     Math8/index_gr_32.gif

Kde vidíme další syntaxi příkazu Or:

     Math8/index_gr_33.gif
     Math8/index_gr_34.gif

Ovšem ta svislá čára se docela špatně na klávesnici hledá.

Funkce Xor

neboli výlučné nebo je logickou funkcí jedné i více logických proměnných. Pokud lichý počet jejích argumentů má hodnotu True a ostatní mají hodnotu False /nebo se nevyskytují/, má funkce Xor hodnotu True. Pokud sudý počet jejích argumentů má hodnotu True a ostatní mají hodnotu False /nebo se nevyskytují/, funkce Xor má hodnotu False. Rozbor situací, v nichž některý/některé z argumentů funkce Xor není typu boolean ponechávám čtenáři coby cvičení.

     Math8/index_gr_35.gif
     Math8/index_gr_36.gif
     Math8/index_gr_37.gif
     Math8/index_gr_38.gif
     Math8/index_gr_39.gif
     Math8/index_gr_40.gif
     Math8/index_gr_41.gif
     Math8/index_gr_42.gif

Funkce Implies

je logickou funkcí dvou proměnných a znamená implikaci; tj. Implies[p,q]=p=>q, tj. nabývá hodnoty False pokud má p hodnotu True a zároveň q hodnotu False; v ostatních třech možných případech nabývá hodnoty True.

     Math8/index_gr_43.gif
     Math8/index_gr_44.gif
     Math8/index_gr_45.gif
     Math8/index_gr_46.gif
     Math8/index_gr_47.gif
     Math8/index_gr_48.gif

8.notebook(info)

Přílohy

index_gr_1.gif Info on index_gr_1.gif 218 bytes
index_gr_10.gif Info on index_gr_10.gif 158 bytes
index_gr_11.gif Info on index_gr_11.gif 227 bytes
index_gr_12.gif Info on index_gr_12.gif 172 bytes
index_gr_13.gif Info on index_gr_13.gif 375 bytes
index_gr_14.gif Info on index_gr_14.gif 171 bytes
index_gr_15.gif Info on index_gr_15.gif 430 bytes
index_gr_16.gif Info on index_gr_16.gif 171 bytes
index_gr_17.gif Info on index_gr_17.gif 405 bytes
index_gr_18.gif Info on index_gr_18.gif 172 bytes
index_gr_19.gif Info on index_gr_19.gif 265 bytes
index_gr_2.gif Info on index_gr_2.gif 169 bytes
index_gr_20.gif Info on index_gr_20.gif 167 bytes
index_gr_21.gif Info on index_gr_21.gif 421 bytes
index_gr_22.gif Info on index_gr_22.gif 178 bytes
index_gr_23.gif Info on index_gr_23.gif 214 bytes
index_gr_24.gif Info on index_gr_24.gif 165 bytes
index_gr_25.gif Info on index_gr_25.gif 274 bytes
index_gr_26.gif Info on index_gr_26.gif 165 bytes
index_gr_27.gif Info on index_gr_27.gif 390 bytes
index_gr_28.gif Info on index_gr_28.gif 170 bytes
index_gr_29.gif Info on index_gr_29.gif 401 bytes
index_gr_3.gif Info on index_gr_3.gif 231 bytes
index_gr_30.gif Info on index_gr_30.gif 291 bytes
index_gr_31.gif Info on index_gr_31.gif 505 bytes
index_gr_32.gif Info on index_gr_32.gif 420 bytes
index_gr_33.gif Info on index_gr_33.gif 327 bytes
index_gr_34.gif Info on index_gr_34.gif 168 bytes
index_gr_35.gif Info on index_gr_35.gif 222 bytes
index_gr_36.gif Info on index_gr_36.gif 166 bytes
index_gr_37.gif Info on index_gr_37.gif 288 bytes
index_gr_38.gif Info on index_gr_38.gif 167 bytes
index_gr_39.gif Info on index_gr_39.gif 237 bytes
index_gr_4.gif Info on index_gr_4.gif 162 bytes
index_gr_40.gif Info on index_gr_40.gif 181 bytes
index_gr_41.gif Info on index_gr_41.gif 324 bytes
index_gr_42.gif Info on index_gr_42.gif 166 bytes
index_gr_43.gif Info on index_gr_43.gif 328 bytes
index_gr_44.gif Info on index_gr_44.gif 181 bytes
index_gr_45.gif Info on index_gr_45.gif 313 bytes
index_gr_46.gif Info on index_gr_46.gif 170 bytes
index_gr_47.gif Info on index_gr_47.gif 337 bytes
index_gr_48.gif Info on index_gr_48.gif 170 bytes
index_gr_5.gif Info on index_gr_5.gif 181 bytes
index_gr_6.gif Info on index_gr_6.gif 161 bytes
index_gr_7.gif Info on index_gr_7.gif 225 bytes
index_gr_8.gif Info on index_gr_8.gif 172 bytes
index_gr_9.gif Info on index_gr_9.gif 218 bytes
zacmath8.nb Info on zacmath8.nb 8921 bytes