Boolean ua haujlwm, sib txuas, sib cais. Logic muaj nuj nqi

Cov txheej txheem:

Boolean ua haujlwm, sib txuas, sib cais. Logic muaj nuj nqi
Boolean ua haujlwm, sib txuas, sib cais. Logic muaj nuj nqi
Anonim

Muaj cov ntawv nthuav qhia uas yuav tsum tau siv cov haujlwm tsim nyog, cov txheej txheem kev xav ntawm ntau yam kev txiav txim. Microsoft Excel software pob los cawm. Nws tuaj yeem tsis tsuas yog xam tus nqi tsim nyog ntawm kev qhia, tab sis kuj ua cov lej lej nyuaj.

Excel yog dab tsi?

Cov khoom lag luam software tsim los ua haujlwm nrog cov ntawv nthuav qhia. Tsim los ntawm Microsoft thiab haum rau yuav luag txhua qhov kev ua haujlwm. Ntawm no koj tuaj yeem siv ob qho qauv los nrhiav cov txiaj ntsig, thiab tsim cov duab kos thiab kab kos ntawm ntau hom.

Tus neeg siv tsis yog tsuas yog muaj txiaj ntsig zoo hauv Excel, tab sis kuj yog lej, lej, nyiaj txiag, ntawv nyeem, thiab lwm yam.

Excel nta

Cov chaw thov ntawm cov khoom lag luam software muaj ntau yam:

  • Daim ntawv ua haujlwm Excel yog daim ntawv npaj ua tiav, yog li tsis tas yuav tsum muaj tus neeg siv los ua kev suav kom nqa cov ntaub ntawv mus rau daim ntawv kom raug.
  • Cov software pob muaj kev siv Boolean zog, nrog rau trigonometric, txheeb cais,text, etc.
  • Raws li kev suav, Excel tsim cov duab thiab kab kos.
  • Vim tias pob software muaj lub tsev qiv ntawv loj ntawm kev ua lej thiab lej, cov menyuam kawm ntawv thiab cov tub ntxhais kawm tuaj yeem siv nws los ua kom tiav cov chav kuaj thiab cov ntawv teev lus.
  • Nws muaj txiaj ntsig rau tus neeg siv los siv cov yam ntxwv ntawm Excel rau hauv tsev thiab kev suav tus kheej.
  • VBA programming lus yog tsim rau hauv cov khoom siv software, uas tuaj yeem ua rau lub neej yooj yim dua rau tus accountant thaum automating cov haujlwm ntawm lub tuam txhab me.
  • Daim ntawv Excel tseem ua raws li cov ntaub ntawv. Tag nrho functionality tsuas yog siv los ntawm 2007 version. Cov khoom thaum ntxov muaj kab txwv.
  • Thaum tsim cov ntawv ceeb toom ntawm ntau yam, Excel los cawm vim nws pab tsim lub rooj pivot.

Excel Logical Operators

Boolean cov lus tau nkag siab tias cov ntaub ntawv tsim nyog los sau cov ntsiab lus hauv kev sib txuas thiab kev sib cais, nrog rau lwm tus neeg ua haujlwm, tus lej sib tw, qauv, ntawv. Nrog lawv pab, cov lus tau sau ua cim, qhia txog qhov kev txiav txim.

Logical functions (lwm yam hu ua Boolean) siv cov lej, ntawv nyeem, txuas nrog cov chaw nyob ntawm tes ua cov ntsiab lus.

Muaj ntau txoj hauv kev los kawm ntxiv txog txhua tus neeg ua haujlwm thiab nws cov lus sib dhos:

  • Call Function Wizard.
  • Siv Microsoft kev pab ntawm F1.
  • Hauv xyoo 2007 ntawm Excel, tshuaj xyuas qhov muaj pes tsawg leeg ntawm txhua pawg ntawm lub toolbar.
logic muaj nuj nqihauv excel
logic muaj nuj nqihauv excel

Boolean algebra

Tus tsim ntawm cov lus qhia txog kev xav (lwm lub npe rau ntu ntawm lej) yog D. Buhl, uas thaum nws tseem hluas tau koom nrog kev txhais cov haujlwm ntawm cov kws tshawb fawb Greek thaum ub. Nws yog los ntawm qhov ntawd uas nws tau txais kev paub thiab tau thov kom qhia tshwj xeeb rau cov nqe lus: 1 - Tseeb, 0 - False.

Boolean algebra yog ib ceg ntawm kev ua lej uas kawm cov lus, kho lawv li qhov muaj txiaj ntsig, thiab ua haujlwm rau lawv. Ib nqe lus twg tuaj yeem raug encoded thiab tom qab ntawd siv, tswj xyuas kom pom tseeb lossis tsis tseeb.

A Boolean muaj nuj nqi hu ua f(x1, x2, …, x ), los ntawm n variables, yog tias muaj nuj nqi lossis ib qho ntawm nws cov neeg ua haujlwm siv qhov tseem ceeb tsuas yog los ntawm cov txheej txheem {0; 1}. Cov kev cai ntawm algebra ntawm logic yog siv rau hauv kev daws teeb meem, hauv programming, coding, thiab lwm yam.

Koj tuaj yeem tso saib Boolean muaj nuj nqi raws li hauv qab no:

  • verbal (cov nqe lus sau rau hauv daim ntawv);
  • table;
  • num;
  • nraaj;
  • analytic;
  • coordinate.

Thiab ua haujlwm

Tus neeg teb xov tooj THIAB yog kev sib txuas hauv Excel software pob. Txwv tsis pub, nws yog hu ua logical multiplication. Nws yog feem ntau denoted los ntawm ∧, &,lossis kos npe ntawm cov operands raug tshem tawm tag nrho. Kev ua haujlwm yog xav tau los txiav txim qhov tseeb ntawm cov lus nkag. Hauv Boolean algebra, ib qho kev sib txuas yuav siv qhov tseem ceeb los ntawm ib txheej, thiab cov txiaj ntsig ntawm kev suav kuj tau sau rau nws. Kev sib npaug ntawm cov logical tshwm sim:

  • binary vim nws muaj 2ua haujlwm;
  • ternary yog tias muaj 3 tus lej;
  • n-ary yog lub teeb muaj n operands.

Koj tuaj yeem daws qhov piv txwv los ntawm kev sib piv txoj cai lossis los ntawm kev tsim lub rooj tseeb. Yog tias cov lus qhia muaj ntau qhov kev ua haujlwm, nws yooj yim dua los siv Excel software pob rau kev daws thib ob, vim tias tag nrho cov txheej txheem yuav cumbersome thaum xam manually.

Qhov tshwm sim ntawm kev suav suav tuaj yeem yog:

  • True: yog txhua qhov kev sib cav muaj tseeb.
  • False: yog tias tag nrho cov qauv tsis raug lossis tsawg kawg yog ib qho ntawm lawv.

Tus "AND" thiab "OR" tus neeg ua haujlwm tuaj yeem muaj txog 30 yam.

Example.

1) Nws yog ib qho tsim nyog los txiav txim qhov tseeb ntawm cov ntaub ntawv nkag. Obviously, qhov piv txwv kawg uas nyob rau hauv kab lus tsis yog lej raug, yog li cov haujlwm yuav rov False.

2) Ob lub hlwb muaj qhov sib txawv. AND muaj nuj nqi rov False vim ib qho ntawm cov lus tsis tseeb.

3) Kev ua lej lej raug teeb tsa. Nws yog ib qho tsim nyog los xyuas lawv qhov tseeb. Tus neeg teb xov tooj no rov "Teeb" vim tias txhua yam yog qhov tseeb ntawm tus lej lej ntawm qhov pom.

conjunction thiab disjunction
conjunction thiab disjunction

Function "OR"

Tus "OR" tus neeg teb xov tooj hauv qeb "Logical functions" yog qhov kev tsis sib haum xeeb, uas yog, nws tso cai rau koj kom tau txais cov lus teb tseeb hauv daim ntawv tsis yog categorical. Lwm lub npe rau tus neeg teb xov tooj hauv Boolean algebra: cov lus sib ntxiv. Xaiv: ∨, +, "los yog". Cov kev hloov pauv coj qhov tseem ceeb ntawm cov teeb thiab cov lus teb tau sau rau ntawd.

Cov txiaj ntsig ntawm kev suav yog:

  • True: yog ib qho los sis tag nrho cov lus sib cav muaj tseeb.
  • False: yog tag nrho cov qauv tsis raug.

Example.

1) Kev tsis sib haum xeeb hauv Excel tsis tsuas yog cov lus qhia muaj tseeb, tab sis kuj suav nrog lej kom raug. Yog li, hauv qhov tshwj xeeb no, ob qho kev tshwm sim yog cuav los ntawm kev suav lej ntawm qhov pom, yog li cov lus teb yog False.

2) Tus neeg teb xov tooj rov muaj tseeb vim tias ib qho ntawm cov lus sib cav muaj tseeb thiab lwm qhov tsis tseeb. Qhov no yog ib qho qauv siv tau rau kev sib cais.

boolean muaj nuj nqi
boolean muaj nuj nqi

IF muaj nuj nqi

Nyob hauv pab pawg "Logic functions", "IF" tus neeg teb xov tooj txaus siab rau qhov chaw. Kev ua haujlwm yog xav tau kom tau txais cov txiaj ntsig yog tias cov ntaub ntawv muaj tseeb, thiab lwm qhov tshwm sim yog tias cov ntaub ntawv tsis raug.

  • Nyob rau hauv cov lus qhia, nws tuaj yeem kuaj txog 64 yam ntawm ib zaug.
  • Yog tias ib qho ntawm cov txheej txheem yog ib qho array, ces cov haujlwm kuaj xyuas txhua lub caij.
  • Yog cov lus teb tsis tseeb, tab sis tus qauv tsis qhia tias tag nrho yuav tsum yog li cas hauv qhov "False", ces tus neeg teb xov tooj muab cov txiaj ntsig sib npaug 0.

Example.

Given:

  • khoom npe;
  • nws tus nqi rau 1 units;
  • ntau ntawm cov khoom yuav;
  • price.

Nws yog qhov tsim nyog los suav cov kab "Payable". Yog tias tus nqi yuav khoom ntau dua 1000 rubles, tus neeg yuav khoom tau txais 3% luv nqi. Txwv tsis pub, cov kab "TOTAL" thiab "Them" yog tib yam.

logic functions rooj
logic functions rooj

1) Kev kuaj xyuas: tus nqi tshaj 1000 rubles.

2) Yog muaj tseebtus nqi ntsuas yog muab los ntawm 3%.

3) Yog tias nqe lus tsis raug, qhov tshwm sim "Them" tsis txawv ntawm "TOTAL".

Tshuaj xyuas ntau yam xwm txheej

Muaj ib lub rooj uas qhia cov qhab nia xeem thiab cov cim ntawm tus kws qhia.

1) Nws yog ib qho tsim nyog los xyuas seb tag nrho cov qhab nia tsawg dua 35. Yog tias cov lus teb muaj tseeb, ces cov txiaj ntsig ntawm kev ua haujlwm yog "Failed."

2) Yog tias qhov xwm txheej dhau los tsis raug, tus qhab nia yog >35, tus neeg teb xov tooj mus rau qhov kev sib cav tom ntej. Yog tias tus nqi hauv cell yog >=75, ces "Zoo heev" raug muab rau ntawm nws. Txwv tsis pub, txoj haujlwm yuav rov qab "Passed".

logic muaj nuj nqi
logic muaj nuj nqi

Txawm tias tus neeg teb xov tooj "Yog" ua haujlwm nrog cov txiaj ntsig boolean, nws ua haujlwm zoo nrog cov lej ib yam.

Example.

Data:

  • npe neeg muag khoom;
  • lawv muag.

Nws yuav tsum suav tias tus neeg muag khoom twg them nyiaj npaum li cas:

  • yog tus naj npawb ntawm kev muag khoom tsawg dua 50,000 feem pua tsis tau them;
  • yog tias qhov ntim ntawm kev hloov pauv txawv ntawm 50-100 txhiab, ces tus nqi them yog 2%;
  • yog tias tus naj npawb ntawm kev muag khoom ntau dua 100 txhiab, ces qhov nyiaj tau tshaj tawm yog 4%.

Nyob rau hauv tus lej 1 yog thawj qhov thaiv "IF", qhov twg nws raug kuaj xyuas qhov tseeb. Yog tias qhov xwm txheej tsis tseeb, ces thaiv 2 raug tua, qhov twg 2 ntxiv cov txheej txheem ntxiv.

minimization ntawm logic functions
minimization ntawm logic functions

Function "IFERROR"

Boolean cov haujlwm tau ua tiav los ntawm tus neeg teb xov tooj no, vim tias nws tuaj yeem rov qab qee qhov txiaj ntsig yog tias muaj qhov yuam kev hauv cov qauv. Yog tag nrhomuaj tseeb, "IFERROR" rov qab cov txiaj ntsig ntawm kev suav.

Function "TRUE" thiab "FALSE"

Boolean ua haujlwm hauv Excel tsis tuaj yeem ua yam tsis muaj "TRUE" tus neeg teb xov tooj. Nws xa rov qab tus nqi sib xws.

Tus inverse ntawm "TRUE" yog "FALSE". Ob txoj haujlwm tsis muaj kev sib cav thiab tsis tshua siv los ua piv txwv ib leeg.

tsis tus neeg teb xov tooj

Txhua yam kev ua haujlwm hauv Excel tuaj yeem tsis lees paub siv tus neeg teb xov tooj "NOT". Tus nqi nkag thaum siv cov txheej txheem no yuav ua rau qhov sib txawv.

Example.

Pom tseeb, tus neeg teb xov tooj muab cov lus teb rov qab rau cov ntaub ntawv qub.

logic functions logic circuits
logic functions logic circuits

Kev txo qis ntawm kev ua haujlwm zoo

qhov tshwm sim no ncaj qha ntsig txog kev tsim lub voj voog lossis lub voj voog. Qhov no yog qhia los ntawm nws cov complexity thiab tus nqi, proportionality ntawm tus naj npawb ntawm cov logic kev khiav hauj lwm thiab tus naj npawb ntawm qhov tshwm sim ntawm kev sib cav. Yog tias koj siv cov axioms thiab theorems ntawm logic, koj tuaj yeem ua kom yooj yim rau txoj haujlwm.

Muaj tshwj xeeb algorithmic minimization txoj kev. Ua tsaug rau lawv, tus neeg siv muaj peev xwm ua kom yooj yim ntawm kev ua haujlwm sai sai thiab tsis muaj qhov yuam kev. Ntawm cov txheej txheem no yog:

  • Carnot cards;
  • Quine method;
  • implicant matrix algorithm;
  • Quine-McCluskey txoj kev, thiab lwm yam.

Yog tias cov lus sib cav tsis tshaj 6, ces nws yog qhov zoo dua rau tus neeg siv siv Karnot daim ntawv qhia txoj kev kom meej. Txwv tsis pub, Quine-McCluskey algorithm raug siv.

Pom zoo: