Tsim, Science
Ib tug algorithm rau constructing tseeb ntxhuav ntawm cov zajlus kom kab zauv
Niaj hnub no, nyob rau hauv daim ntawv no yuav tsum tau tham nyob rau hauv kom meej qhov teeb meem ntawm constructing ib qhov tseeb rooj ntawm cov zajlus kom kab zauv. Nrog rau qhov teeb meem feem ntau ces yuav tsum menyuam kawm ntawv uas muab lub unified lub xeev ntsuam xyuas nyob rau hauv computer science. Nyob rau hauv qhov tseeb, qhov thiaj li hu ua Boolean algebra yog tsis complex yog tias koj paub qhov tsim nyog cov cai, ua hauj lwm thiab cov kev cai rau constructing tseeb ntxhuav. Cov no yog cov lus nug peb yuav ua li cas niaj hnub no.
Boolean algebra
logic algebra raws li tej yam yooj yim cov zajlus kom kab zauv, uas yog interconnected ua hauj lwm, tsim ib txoj kev qhia. Nco ntsoov tias Boolean algebra muaj ob binary haujlwm: ntxiv thiab npaug (thiab disjunction ntawm tau, ntsig txog); ib tug unary - inversion. Tag nrho tej yam yooj yim qhia (ntsiab ntawm ib complex zajlus kom qhia) muab ib tug ntawm ob qhov tseem ceeb: "1" los yog "0", "muaj tseeb" los yog "cuav", "+" los yog "-" feem.
algebra ntawm logic yog raws li nyob rau hauv ib tug ob peb kuj yooj yim axioms:
- associativity;
- yog commutative;
- haum;
- distributivity;
- additionality.
Yog hais tias koj paub cov cai thiab cov kev theem ntawm cov kev khiav dej num, tsim tau ib tug tseeb rooj ntawm cov zajlus kom kab zauv yuav tsis ua kom muaj teeb meem. Nco qab tias lub lag luam yuav tsum tau ua nyob rau hauv nruj ib theem zuj zus: negation, lej khu, tsis tas li ntawd, qhov yuav tau txais, equivalence, xwb ces hais kom txwv tsis pub Schiffer los yog cov zajlus kom tsis ua hauj lwm. Los ntawm txoj kev, rau hauv ob lub zog tsis muaj kev cai ua ntej, los mus siv lawv nyob rau hauv qhov kev txiav txim nyob rau hauv uas lawv muaj nyob rau.
Cov kev cai ntawm nqus tau lub rooj
Constructing ib qhov tseeb rooj ntawm cov zajlus kom kab zauv pab daws tau ntau zajlus kom muaj teeb meem thiab nrhiav kev daws rau txoj loj piv txwv. Nws yog ib nqi sau cia hais tias muaj ib co kev cai ntawm lawv muab tso ua ke.
Nyob rau hauv thiaj li yuav kom ua ib zajlus kom rooj, nws yog tsim nyog los pib los mus txiav txim tus naj npawb ntawm kab. Yuav ua li cas yuav ua rau nws? Suav cov xov tooj ntawm cov tsiaj ntawv hais tias ua li ib tug complex qhia, thiab siv tej yam yooj yim mis: A = 2 mus rau lub hwj chim n. Thiab - qhov no yog lub xov tooj ntawm kab nyob rau hauv lub rooj muab tso ua ke los ntawm qhov tseeb, n - yog tus naj npawb ntawm ntau yam uas yog ib feem ntawm ib tug complex zajlus kom qhia.
Piv txwv li: complex qhia muaj peb cov tsiaj ntawv (A, B thiab C), ces ib tug phem cim yuav tsum tau ua nyob rau hauv lub thib peb degree. B yog qhov tseeb rooj peb yuav muaj yim kab. Ntxiv ib kab rau lub npe ntawm cov kem.
Tom ntej no, peb tig mus rau peb qhia thiab txiav txim seb qhov kev txiav txim ntawm kev ua tau. Zoo kev txiav txim rau lawv tus kheej ib tug cwj mem kos (ib, ob, thiab thiaj li nyob).
Cov kauj ruam tom ntej peb xam tus naj npawb ntawm kev ua hauj lwm. Cov uas ua muaj pes tsawg tus - cov kab nyob rau hauv peb lub rooj. Nco ntsoov mus ntxiv txawm ib tug xov tooj ntawm txhua raws li cov tsiaj ntawv uas muaj nyob hauv koj cov ntsiab lus, sau tau ob peb ua ke ntawm cov tsiaj ntawv.
Tom ntej no, koj yuav tau ua lub hau ntawm peb lub rooj. Hauv qab no koj pom ib qho piv txwv ntawm no.
A | Cov | C | lag luam 1 | lag luam 2 | lag luam 3 |
Tam sim no npaj mus rau lub filling tau ob peb ua ke. Rau ob qhob, lawv yog raws li nram no: 00, 01, 10, 11. Yog peb ntau yam: 000, 001, 010, 011, 100, 101, 110, 111.
Tom qab tag nrho cov saum toj no-hais tej yam yuav npaj mus rau lub xam ntawm qhov seem hlwb thiab sau lub resulting rooj.
Piv txwv li
Peb tam sim no xav txog cov piv txwv ntawm constructing ib lub rooj ntawm cov zajlus kom qhia yog muaj tseeb: lub inversion of A + B * A.
- Suav ntau yam: 2. Number ntawm cov kab: 4 + 1 = 5.
- Tus tua kev txiav txim ntawm kev nqis tes ua: thawj inversion, ob tau, disjunction peb.
- Number of Txhua: 3 + 2 = 5.
- Mus cuag ib tug tracing thiab sau lub rooj.
A | Cov | 1 | 2 | 3 |
- | - | + | - | + |
- | + | + | - | + |
+ | - | - | - | - |
+ | + | - | + | + |
Raws li ib tug txoj cai, txoj hauj lwm suab zoo li no: "Yuav ua li cas muaj ntau yam ob peb ua ke satisfies F = 0" los yog "nyob rau hauv dab tsi peb ua ke F = 1". Nyob rau hauv thawj lo lus nug cov lus teb - 1, tus thib ob - 00, 01, 11.
Ua tib zoo nyeem cov hauj lwm uas koj yuav muab. Koj muaj peev xwm yuav los daws tau qhov teeb meem, tab sis mus ua ib tug yuam kev nyob rau hauv sau ntawv cov lus teb. Ib zaug dua kuv kos koj mloog mus rau cov kev txiav txim ntawm cov kev ua:
- tsis kam muab;
- npaug;
- Tsis tas li ntawd.
ua hauj lwm
Constructing ib qhov tseeb rooj yuav pab tau nrhiav tau cov lus teb rau ib tug yooj yim cov zajlus kom teeb meem. Ua raws li cov txheej txheem ntawm kev npaj kev qhia thiab qhov tseeb lub rooj rau lub zwj ceeb ntawm cov zajlus kom paub tab uas koj tau nyob rau hauv qhov seem ntawm qhov tsab xov xwm.
Muab plaub qhov tseem ceeb ntawm A: 1), 7 2) 6, 3), 5, 4) 4. Rau ib txhia ntawm lawv cov ntaub ntawv "inversion (me me 6) + (tsawg tshaj li 5 A)" yog tsis muaj tseeb?
Peb cov thawj kem uas yuav muaj cov qhov tseem ceeb 7, 6, 5, 4 yuav tsum tau nyob rau hauv no ib theem zuj zus. Nyob rau hauv lub tom ntej no kem, peb yuav tsum teb lo lus nug: "Thiab tsawg tshaj li 6?" Qhov thib peb kem sau nyob rau hauv tib yam, tsuas tam sim no cov lus teb rau cov nqe lus nug: "Thiab tsawg tshaj li 5?"
Peb txiav txim rau lawv liag ua hauj lwm. Nco ntsoov hais tias tsis kam muab yuav siv sij hawm nqis tshaj disjunction. Yog li ntawd, tom ntej no kem peb sau nyob rau hauv lub qhov tseem ceeb uas sib haum mus rau tus mob yog tsis (A tsawg tshaj li 6). Qhov thib plaub yuav teb tau cov ntsiab lus nug ntawm peb cov teeb meem. Hauv qab no koj pom ib qho piv txwv ntawm sau lub rooj.
A | 1. Ib tug qis 6 | 2. Ib tug tsawg tshaj li 5 | 3. inversion 1 | 4. 3 + 2 |
7 | - | - | + | + |
6 | - | - | + | + |
5 | + | - | - | - |
4 | + | + | - | + |
Thov nco ntsoov tias peb muaj tus xov tooj ntawm cov lus teb, ib tug cuav qhia yog ib tug nqi ntawm A = 5, qhov no yog tus thib peb version ntawm cov lus teb.
Similar articles
Trending Now