Simplify boolean expression example - boolean-logic

i have the following boolean to simplify
(A'C'D')+(A'B'D')+(A'BC')+(A'BD)
the furthest i got was ,
A'C'(D'+B)+A', which was from factoring out a
A' from A'B'D'+A'BD. Is there anything else that can be done? I've been trying different stuff and I cant simplify it anymore.

Actually you should be able to simplify the original expression
¬a·¬c·¬d + ¬a·¬b·¬d + ¬a·b·¬c + ¬a·b·d
to either one of these minimal forms:
¬a·(b + ¬d)·(¬b + ¬c + d)
¬a·¬b·¬d + ¬a·b·¬c + ¬a·b·d
The given expression next to it's minimal DNF and minimal CNF in Karnaugh maps (generated using latex):
You can also check it by applying the laws of Boolean algebra:
¬a·¬c·¬d + ¬a·¬b·¬d + ¬a·b·¬c + ¬a·b·d
¬a·¬b·¬d + ¬a·¬c·¬d + ¬a·b·¬c + ¬a·b·d //just permuting
¬a·¬b·¬d + ¬a·¬c·(¬d + b) + ¬a·b·d //distributivity
¬a·¬b·¬d + ¬a·¬c·(¬b·¬d + b) + ¬a·b·d //distributivity
¬a·¬b·¬d + ¬a·¬c·¬b·¬d + ¬a·¬c·b + ¬a·b·d //distributivity
¬a·¬b·¬d + ¬a·¬c·b + ¬a·b·d //absorption
¬a·¬b·¬d + ¬a·b·¬c + ¬a·b·d //minimal DNF
¬a·¬b·¬d + ¬a·b·d + ¬a·b·¬c //just permuting
¬a·(¬b·¬d + b·d + b·¬c) //distributivity
¬a·((¬b + b)·(¬b + d)·(¬d + b)·(¬d + d) + b·¬c) //distributivity
¬a·( (1)·(¬b + d)·(¬d + b)·(1) + b·¬c) //complementation
¬a·( (¬b + d)·(¬d + b) + b·¬c) //identity for ·
¬a·( (¬b + d + b·¬c)·(¬d + b + b·¬c)) //distributivity
¬a·( (¬b + d + ¬c)·(¬d + b + b·¬c)) //distributivity
¬a·( (¬b + d + ¬c)·(¬d + b)) //absorption
¬a·(¬b + ¬c + d)·(b + ¬d) //minimal CNF

Related

Can't find what causes "Error in eval(predvars, data, env)" message

I'm running the script below to determine the ten most significant variables via a step regression in my excel sheet. Yes, it is a mess.
patient_data1 = read.csv("PATHWAY_PLACEHOLDER", stringsAsFactors=FALSE, strip.white = TRUE)
nothing <- lm(Gap ~ 1, data = patient_data1)
model <- lm(Gap~HR + RAZscor + PCArati + RMS_sum + KurtSum + razA + razAP + razN + TEigenvec1 + TEigenvec2 + TEigenvec3 + TEigenvec4 + TEigenvec5 + TEigenvec6 + TEigenvec7 + TEigenvec8 + Pax + QRSax + Tax + QRSTax + HR + Pd + PQ + QRS + QT + QTc + TpTe + cTpTe + QEigenvec1 + QEigenvec2 + QEigenvec3 + QEigenvec4 + QEigenvec5 + QEigenvec6 + QEigenvec7 + QEigenvec8 + PEigenvec1 + PEigenvec2 + PEigenvec3 + PEigenvec4 + PEigenvec5 + PEigenvec6 + PEigenvec7 + PEigenvec8 + Patient + hrminsec + BeatNr + RMS40 + fQRSD + LAS + SpatialMean + MeanAngle + QTInterval + SpatialVat + QRSDuration + Vent.Gradient + MaximumAngle + X12LeadArea + X12LeadVoltage + TpTe + QRSRatio + SokolowLyon + CornellVoltage + CornellProduct + SpMeanSD + SPMeanCV + VentGradSD + VentGradCV + SpMeanT + SMTSD + SMTCV + VGFrontal + VGSagittal + VGHor + VMTotalRMS + VMMaxRMS + VMIntegral + ZTotalRMS + ZMaxRMS + ZIntegral + QRSMeanSV + QRSMaxSV + TMeanSV + TMaxSV + PDuration + PNadir + fPDuration + PQInterval + PSpatialMean + PSpMeanSD + PSpMeanCV + PRAngle + PMeanSV + PMaxSV + PFVMIntegral + PVMIntegral + RV6Rmax + RV1SV1 + RV6SV6 + RzDuration + QRSareax + QRSareay + QRSareaz + Tareax + Tareay + Tareaz + VGareax + VGareay + VGareaz + VGFrAzi + VGSagAzi + VGHorAzi + FrQRS10 + FrQRS20 + FrQRS30 + FrQRSMax + FrTMax + SagQRS10 + SagQRS20 + SagQRS30 + SagQRSMax + SagTMax + HorQRS10 + HorQRS20 + HorQRS30 + HorQRSMax + HorTMax + FrUpperR + FrUpperL + FrLowerR + FrLowerL + SagUpperR + SagUpperL + SagLowerR + SagLowerL + HorUpperR + HorUpperL + HorLowerR + HorLowerL + FrontalArea + SagittalArea + HorArea + PA + RL + PL + PALR + Qx + Rx + Sx + Qy + Ry + Sy + Qz + Rz + Sz + X3DQRSmax + FrQRSmax + SagQRSmax + HorQRSmax + X3DTmaxmag + QRSMag18 + QRSElv18 + QRSAzi18 + QRSMag28 + QRSElv28 + QRSAzi28 + QRSMag38 + QRSElv38 + QRSAzi38 + QRSMag48 + QRSElv48 + QRSAzi48 + QRSMag58 + QRSElv58 + QRSAzi58 + QRSMag68 + QRSElv68 + QRSAzi68 + QRSMag78 + QRSElv78 + QRSAzi78 + QRSMag88 + QRSElv88 + QRSAzi88 + EigenQRSa + EigenQRSb + EigenQRSc + EigenQRSarea + PolarVecMag + PolarVecEle + PolarVecAzi + X3DQRS10 + X3DQRS20 + X3DQRS30 + QRSMaxRight + FujitaR + X3DTmean + DEA + e1QRST + e3QRST + Teigenv + RMSTavplan + X3DTmaxElv + X3DTmaxAzi + Tsv1 + Tsv2 + Tsv3 + SAIQRST + Limbsum + JonasMorph + XabsParea + XnetParea + YabsParea + YnetParea + ZabsParea + ZnetParea + PMorph + XabsQRSarea + XnetQRSarea + YabsQRSarea + YnetQRSarea + ZabsQRSarea + ZnetQRSarea + QRSMorph + XabsTarea + XnetTarea + YabsTarea + YnetTarea + ZabsTarea + ZnetTarea + TMorph + STMag18 + STElv18 + STAzi18 + STMag28 + STElv28 + STAzi28 + STMag38 + STElv38 + STAzi38 + STMag48 + STElv48 + STAzi48 + STMag58 + STElv58 + STAzi58 + STMag68 + STElv68 + STAzi68 + STMag78 + STElv78 + STAzi78 + STMag88 + STElv88 + STAzi88 + PatientID + DocumentName + Date + Time + Pax + QRSax + Tax + HR + PQ + Pd + QRS + QT + QTc + pamp_1 + ppamp_1 + qdur_1 + qamp_1 + rdur_1 + ramp_1 + sdur_1 + samp_1 + rpdur_1 + rpamp_1 + spdur_1 + spamp_1 + ston_1 + stmid_1 + st80_1 + stslope_1 + tamp_1 + tpamp_1 + pamp_2 + ppamp_2 + qdur_2 + qamp_2 + rdur_2 + ramp_2 + sdur_2 + samp_2 + rpdur_2 + rpamp_2 + spdur_2 + spamp_2 + ston_2 + stmid_2 + st80_2 + stslope_2 + tamp_2 + tpamp_2 + pamp_3 + ppamp_3 + qdur_3 + qamp_3 + rdur_3 + ramp_3 + sdur_3 + samp_3 + rpdur_3 + rpamp_3 + spdur_3 + spamp_3 + ston_3 + stmid_3 + st80_3 + stslope_3 + tamp_3 + tpamp_3 + pamp_4 + ppamp_4 + qdur_4 + qamp_4 + rdur_4 + ramp_4 + sdur_4 + samp_4 + rpdur_4 + rpamp_4 + spdur_4 + spamp_4 + ston_4 + stmid_4 + st80_4 + stslope_4 + tamp_4 + tpamp_4 + pamp_5 + ppamp_5 + qdur_5 + qamp_5 + rdur_5 + ramp_5 + sdur_5 + samp_5 + rpdur_5 + rpamp_5 + spdur_5 + spamp_5 + ston_5 + stmid_5 + st80_5 + stslope_5 + tamp_5 + tpamp_5 + pamp_6 + ppamp_6 + qdur_6 + qamp_6 + rdur_6 + ramp_6 + sdur_6 + samp_6 + rpdur_6 + rpamp_6 + spdur_6 + spamp_6 + ston_6 + stmid_6 + st80_6 + stslope_6 + tamp_6 + tpamp_6 + pamp_7 + ppamp_7 + qdur_7 + qamp_7 + rdur_7 + ramp_7 + sdur_7 + samp_7 + rpdur_7 + rpamp_7 + spdur_7 + spamp_7 + ston_7 + stmid_7 + st80_7 + stslope_7 + tamp_7 + tpamp_7 + pamp_8 + ppamp_8 + qdur_8 + qamp_8 + rdur_8 + ramp_8 + sdur_8 + samp_8 + rpdur_8 + rpamp_8 + spdur_8 + spamp_8 + ston_8 + stmid_8 + st80_8 + stslope_8 + tamp_8 + tpamp_8 + pamp_9 + ppamp_9 + qdur_9 + qamp_9 + rdur_9 + ramp_9 + sdur_9 + samp_9 + rpdur_9 + rpamp_9 + spdur_9 + spamp_9 + ston_9 + stmid_9 + st80_9 + stslope_9 + tamp_9 + tpamp_9 + pamp_10 + ppamp_10 + qdur_10 + qamp_10 + rdur_10 + ramp_10 + sdur_10 + samp_10 + rpdur_10 + rpamp_10 + spdur_10 + spamp_10 + ston_10 + stmid_10 + st80_10 + stslope_10 + tamp_10 + tpamp_10 + pamp_11 + ppamp_11 + qdur_11 + qamp_11 + rdur_11 + ramp_11 + sdur_11 + samp_11 + rpdur_11 + rpamp_11 + spdur_11 + spamp_11 + ston_11 + stmid_11 + st80_11 + stslope_11 + tamp_11 + tpamp_11 + pamp_12 + ppamp_12 + qdur_12 + qamp_12 + rdur_12 + ramp_12 + sdur_12 + samp_12 + rpdur_12 + rpamp_12 + spdur_12 + spamp_12 + ston_12 + stmid_12 + st80_12 + stslope_12 + tamp_12 + tpamp_12 + DiagnosticStatements + Gender + Outcome + Age + Ln.Cornell.Product + QRSAzi.5.8.minus.QRS.Azi.4.8 + QRS.Azi.6.8.minus.QRS.Azi5.8 + QRSMinAziSineRAD + LnNEigen5
, patient_data1)
stepwiseregression <- step(object = nothing, scope = list(lower = formula(nothing), upper = formula(model), direction = "forward"))
summary(stepwiseregression)
The problem is that when I run the script, I get the error message "Error in eval(predvars, data, env) : object 'r' not found". This despite the fact that I don't think that I'm making a prediction (correct me if I'm wrong) and I can't find 'r' as an object. Can anyone see what I'm doing wrong and suggest a solution?
I've tried searching for 'r' in my code, but it doesn't come up in any other context than as a letter in a longer name of a column.

Simplify Boolean (X + Y)(X' + Z) = XZ + X'Y

I am trying to solve this equation but I get z(x + y) + yx'. I am also wondering if this counts as the communicative boolean law .
(X + Y)(X' + Z)
XX' + X'Y + XZ + YZ Distributive law (twice)
F + X'Y + XZ + YZ Complement law: AA' = F
X'Y + XZ + YZ Identity law: F + A = A
X'Y + XZ + YZT Identity law: A = AT
X'Y + XZ + YZ(X + X') Complement law: T = (A + A')
X'Y + XZ + XYZ + X'YZ Distributive law
X'Y + X'YZ + XZ + XYZ Commutative law (twice)
X'YT + X'YZ + XZT + XYZ Identity law (twice): A = AT
X'Y(T + Z) + XZ(T + Y) Distributive law (twice)
X'YT + XZT Dominant law (twice): T + A = T
X'Y + XZ Identity law (twice): AT = A
XZ + X'Y Commutative law

Boolean truth table into SOP and Karnaugh Map

Hi, I am junior in college and having trouble with my computer architecture classwork. Anyone care to help & tell me if I got them right?
Question1. Convert truth table into bool equation.
Question2. Find miminum SOP(sum of products)
Question3. Use K-map(Karnaugh map) to simplify.
You can simplify the original expression matching the given truth-table just by using Karnaugh maps:
f(x,y,z) = ∑(1,3,4,6,7) = m1 + m3 + m4 + m6 + m7
= ¬x·¬y·z + ¬x·y·z + x·y·z + x·¬y·¬z + x·y·¬z //sum of minterms
f(x,y,z) = ∏(0,2,5) = M0 · M2 · M5
= (x + y + z)·(x + ¬y + z)·(¬x + y + ¬z) //product of maxterms
f(x,y,z) = x·y + ¬x·z + x·¬z //minimal DNF
= (x + z)·(¬x + y + ¬z) //minimal CNF
You would get the same result using the laws of Boolean algebra:
¬x·¬y·z + ¬x·y·z + x·y·z + x·y·¬z + x·¬y·¬z
¬x·(¬y·z + y·z) + x·(y·z + y·¬z + ¬y·¬z) //distributivity
¬x·(z·(¬y + y)) + x·(y·(z + ¬z) + ¬y·¬z)) //distributivity
¬x·(z·( 1 )) + x·(y·( 1 ) + ¬y·¬z)) //complementation
¬x·(z ) + x·(y + ¬y·¬z)) //identity for ·
¬x·(z ) + x·(y + y·¬z + ¬y·¬z)) //absorption
¬x·(z ) + x·(y + ¬z·(y + ¬y)) //distributivity
¬x·(z ) + x·(y + ¬z·( 1 )) //complementation
¬x·(z ) + x·(y + ¬z) //identity for ·
¬x·z + x·y + x·¬z //distributivity
¬x·z + x·y + x·¬z //minimal DNF
¬x·z + x·y + x·¬z
¬x·z + x·(y + ¬z) //distributivity
(¬x + x)·(¬x + (y + ¬z))·(z + x)·(z + (y + ¬z)) //distributivity
( 1 )·(¬x + y + ¬z )·(z + x)·(z + y + ¬z) //complementation
( 1 )·(¬x + y + ¬z )·(z + x)·(y + 1) //complementation
( 1 )·(¬x + y + ¬z )·(z + x)·(1) //annihilator for +
(¬x + y + ¬z )·(z + x) //identity for ·
(¬x + y + ¬z)·(x + z) //minimal CNF

simplifying Boolean expression A'BC + AB'C + A'B'C' + AB'C + ABC

Need help here, whats the simplified form of this Boolean expression?
I'm a little confused about this, help me guys!
A'BC + AB'C + A'B'C' + AB'C + ABC
Assuming the ⋅ operator represents binary conjunction, the + binary disjunction and the ' or the ¬ unary negation, you can apply the laws of Boolean algebra:
¬a⋅b⋅c + a⋅¬b⋅c + ¬a⋅¬b⋅¬c + a⋅¬b⋅c + a⋅b⋅c
¬a⋅b⋅c + a⋅¬b⋅c + ¬a⋅¬b⋅¬c + a⋅b⋅c //idempotence of +: a⋅¬b⋅c + a⋅¬b⋅c = a⋅¬b⋅c
b⋅c⋅(¬a + a) + a⋅¬b⋅c + ¬a⋅¬b⋅¬c //distributivity:¬a⋅b⋅c + a⋅b⋅c = b⋅c⋅(¬a + a)
b⋅c⋅(1) + a⋅¬b⋅c + ¬a⋅¬b⋅¬c //complementation: ¬a + a = 1
b⋅c + a⋅¬b⋅c + ¬a⋅¬b⋅¬c //identity for ⋅: b⋅c⋅(1) = b⋅c
b⋅c + a⋅b⋅c + a⋅¬b⋅c + ¬a⋅¬b⋅¬c //absorption: b⋅c = b⋅c + a⋅b⋅c
b⋅c + a⋅c⋅(b + ¬b) + ¬a⋅¬b⋅¬c //distributivity: a⋅b⋅c + a⋅¬b⋅c = a⋅c⋅(b + ¬b)
b⋅c + a⋅c⋅(1) + ¬a⋅¬b⋅¬c //complementation: b + ¬b = 1
b⋅c + a⋅c + ¬a⋅¬b⋅¬c //identity for ⋅: a⋅c⋅(1) = a⋅c
The final line is the original expression's minimal DNF. You can also transform it to it's minimal CNF:
b⋅c + a⋅c + ¬a⋅¬b⋅¬c
(b⋅c + a⋅c) + (¬a⋅¬b⋅¬c)
((b⋅c + a⋅c) + ¬a)⋅((b⋅c + a⋅c) + ¬b)⋅((b⋅c + a⋅c) + ¬c) //distributivity
(b⋅c + a⋅c + ¬a) ⋅ (b⋅c + a⋅c + ¬b) ⋅ (b⋅c + a⋅c + ¬c)
(b⋅c + c + ¬a) ⋅ (b⋅c + a⋅c + ¬b) ⋅ (b⋅c + a⋅c + ¬c) //absorption
(b⋅c + c + ¬a) ⋅ (c + a⋅c + ¬b) ⋅ (b⋅c + a⋅c + ¬c) //absorption
(b⋅c + c + ¬a) ⋅ (c + a⋅c + ¬b) ⋅ (b + a + ¬c) //absorption
(c + ¬a) ⋅ (c + a⋅c + ¬b) ⋅ (b + a + ¬c) //absorption
(c + ¬a) ⋅ (c + ¬b) ⋅ (b + a + ¬c) //absorption
(¬a + c)⋅(¬b + c)⋅(a + b + ¬c)
For this small number of variables, you can also use Karnaugh maps. In the picture (generated using latex) you can see marked out three equivalent expressions – the original one, it's minimal DNF and it's minimal CNF:
f(a,b,c) = ¬a⋅b⋅c + a⋅¬b⋅c + ¬a⋅¬b⋅¬c + a⋅b⋅c
= b⋅c + a⋅c + ¬a⋅¬b⋅¬c
= (¬a + c)⋅(¬b + c)⋅(a + b + ¬c)

Simplify boolean expression: (a + b)(b'+ c)(a + c) = (a + b)(b'+ c)

Hello I am trying to simplify this expression (proving consensus expression):
(a + b)(b'+ c)(a + c) = (a + b)(b'+ c)
I was thinking of adding (a+b)(b'+ c)(a + c + b' + b), but I don't know what to do after.
Take a look at this:
(a + b)(b' + c)(a + c)
= (ab' + 0 + ac + bc)(a + c)
= (ab' + ab'c +ac + ac + abc + bc)
= (ab' + ab'c + ac + abc + bc)
= (ab'(1+c) + ac + bc(a + 1))
= (ab' + ac + bc)
= (ab' + c(a+b))
= (ab' + bb' + c (a+b))
= (a+b)(b' + c)
The key step is realising that bb' = 0 so you can safely add that term without affecting the result in the penultimate step.
(A+C')(B'+C')
AB'+AC'+BC'+C'
AB'+(A+B+1)C'
We Know ( 1+anything =1)
So required expression AB'+C' .