How to solve functional equation? - equation

I have functional equation
B(2z^4 + 4z^6 + 9z^8 + 20z^{10} + 44z^{12} + 96z^{14}) = (B(z))^4
I try to solve it using Maxima CAS :
(%i2) e: B(2*z^4 + 4*z^6 + 9*z^8 + 20*z^10 + 44*z^12 + 96*z^14) = (B(z))^4;
14 12 10 8 6 4 4
(%o2) B(96 z + 44 z + 20 z + 9 z + 4 z + 2 z ) = B (z)
(%i3) funcsolve (e,B(z));
expt: undefined: 0 to a negative exponent.
#0: rform(%r=[0,0])
#1: funcsol(%a=B(96*z^14+44*z^12+20*z^10+9*z^8+4*z^6+2*z^4) = B(z)^4,%f=B(z),l%=[])
#2: funcsolve(%a=B(96*z^14+44*z^12+20*z^10+9*z^8+4*z^6+2*z^4) = B(z)^4,%f=B(z))
#3: funcsolve(_l=[B(96*z^14+44*z^12+20*z^10+9*z^8+4*z^6+2*z^4) = B(z)^4,B(z)])
-- an error. To debug this try: debugmode(true);
Here simpler example :
define(f(z),z^2-1)
(%o3) f(z):=z^2-1
(%i4) f2:factor(f(f(z)))
(%o4) z^2*(z^2-2)
(%i5) e:B(f2) = B(z)^2
(%o5) B(z^2*(z^2-2)) = B(z)^2
(%i6) s:funcsolve(e,B(z))
expt: undefined: 0 to a negative exponent.
#0: rform(%r=[0,0])
#1: funcsol(%a=B(z^2*(z^2-2)) = B(z)^2,%f=B(z),l%=[])
#2: funcsolve(%a=B(z^2*(z^2-2)) = B(z)^2,%f=B(z))
#3: funcsolve(_l=[B(z^2*(z^2-2)) = B(z)^2,B(z)])
-- an error. To debug this try: debugmode(true);
How should I do it?
Is it another software / method for it ?

Related

Translation from Binary to Decimal

How does one translate the following binary to Decimal. And yes the decimal points are with the whole binary value
1) 101.011
b) .111
Each 1 corresponds to a power of 2, the power used is based on the placement of the 1:
101.011
= 1*2^2 + 0*2^1 + 1*2^0 + 0*2^-1 + 1*2^-2 + 2*2^-3
= 1*4 + 1*1 + 1/4 + 1/8
= 5.375
.111
= 1*2^-1 + 1*2^-2 + 1*2^-3
= 1/2 + 1/4 + 1/8
= .875
If you don't like dealing with the decimal point you can always left shift by multiplying by a power of 2:
101.011 * 2^3 = 101011
Then convert that to decimal and, since you multiplied by 2^3 = 8, divide the result by 8 to get your answer. 101011 converts to 43 and 43/8 = 5.375.
1) 101.011
= 2*2^-3 + 1*2^-2 + 0*2^-1 + 1*2^0 + 0*2^1 + 1*2^2
= (1/8) + (1/4) + 0 + 1 + 0 + 4
= 5.375
2) .111
= 1*2^-3 + 1*2^-2 + 1*2^-1
= (1/8) + (1/4) + (1/2)
= .875
101.011 should be converted like below
(101) base2 = (2^0 + 2^2) = (1 + 4) = (5) base10
(.011) base2 = 0/2 + 1/4 + 1/8 = 3/8
So in total the decimal conversion would be
5 3/8 = 5.375
Decimal numbers cannot be represented in binary. It has to be whole numbers.
Here is a simple system
Let's take your binary number for example.
101011
Every position represents a power of 2. With the left-most position representing the highest power of 2s. To visualize this, we can do the following.
1 0 1 0 1 1
2 ^ 6 2 ^ 5 2 ^ 4 2 ^ 3 2 ^ 2 2 ^ 1
We go by each position and do this math
1 * (2 ^6 ) + 0 * (2 ^ 5) + 1 * (2 ^ 4) + 0 * (2 ^ 3) + 1 * (2 ^ 2) + 1 * (2 ^ 1)
Doing the math gives us
(1 * 64) + (0 * 32) + (1 * 16) + (0 * 8) + (1 * 4) + (1 * 2) =
64 + 0 + 16 + 0 + 4 + 2 = 86
We get an answer of 86 this way.

Explain why x == ~(~x + 1) + 1 (two's complement and back!)

As we all know usually negative numbers in memory represents as two's complement numbers like that
from x to ~x + 1
and to get back we don't do the obvious thing like
~([~x + 1] - 1)
but instead we do
~[~x + 1] + 1
can someone explain why does it always work? I think I can proof it with 1-bit, 2-bit, 3-bit numbers and then use Mathematical induction but it doesn't help me understand how exactly that works.
Thanks!
That's the same thing anyway. That is, ~x + 1 == ~(x - 1). But let's put that aside for now.
f(x) = ~x + 1 is its own inverse. Proof:
~(~x + 1) + 1 =
(definition of subtraction: a - b = ~(~a + b))
x - 1 + 1 =
(you know this step)
x
Also, ~x + 1 == ~(x - 1). Why? Well,
~(x - 1) =
(definition of subtraction: a - b = ~(~a + b))
~(~(~x + 1)) =
(remove double negation)
~x + 1
And that (slightly unusual) definition of subtraction, a - b = ~(~a + b)?
~(~a + b) =
(use definition of two's complement, ~x = -x - 1)
-(~a + b) - 1 =
(move the 1)
-(~a + b + 1) =
(use definition of two's complement, ~x = -x - 1)
-(-a + b) =
(you know this step)
a - b
This is because if you increment ~x (assuming no overflow). Then converting it to back to x, you've incremented relative to ~x, but decremented relative to x. Same thing applies vice versa. Assuming your variable x has a specific value, every time you increment it, relative to ~x you'll notice it decrements.
From a programmer's point of view, this is what you'd essentially witness.
Let short int x = 1 (0x0001)
then ~x = 65534 (0xFFFE)
~x + 1 = 65534 + 1 (0xFFFF)
~(~x+1) = 0 (0x0000)
~(~x+1) + 1 = 0 + 1 (0x0001)

Maxima - Substitutions in Equations - let() and letsimp() without effect

My own equation is a bit longer, but the following example shows perfectly where I struggle at the moment.
So far I have been using the let() and letsimp() function
to substitute longer terms in an equation,
but in this example they have no effect:
(%i1) eq: ((2*u+a^2+d) * y+x)/2*a = x;
2
a ((2 u + d + a ) y + x)
(%o1) ------------------------ = x
2
(%i2) let(2*u+a^2+d, %beta);
2
(%o2) 2 u + d + a --> %beta
(%i3) letsimp(eq);
2
a ((2 u + d + a ) y + x)
(%o3) ------------------------ = x
2
What is the preferred way to replace 2*u+a^2+d with %beta in this sample equation?
And why has letsimp() no effect?
Thank you very much!
letsimp applies only to "*" expressions. You could try subst.

Simplifying a logic function using boolean algebra

I'm taking a class on digital logic and I am having a hard time with boolean algebra and simplifying logic functions with it. I have tried answering this problem several times and I keep coming to the answer "1", which I feel is absolutely wrong.
The question is
Consider the logic function f(a,b,c) = abc + ab'c + a'bc + a'b'c + ab'c'. Simplify f using Boolean algebra as much as possible.
I have tried solving it several ways using the boolean identities given in my textbook and from lecture, but I keep coming to something like c + 1 which is equivalent to 1, which I don't feel is the correct answer considering the next question in the problem.
Here is my last attempt:
f(a,b,c) = abc + ab'c + a'bc + a'b'c + ab'c'
= a(bc + b'c + b'c') + a'(bc + b'c) # Distributive, took out the a and the a' separately.
= (a + a')((bc + b'c + b'c') + (bc + b'c)) # Distributive(?), took out the a and a' together (This is probably where I screwed up).
= (1)((c + b'c') + c) # a + a' = 1; bc + b'c = c (Combining).
= c + b'c' + c # cleaned up a little.
= c + b'c' # c + c = c.
= c + (b' + c') # b'c' = b' + c' (DeMorgan's Theorem).
= 1 + b' # c + c' = 1.
= 1 # 1 + b' = 1
This feels absolutely wrong to me, and the next question asks me to make the logic circuit for it, which I don't think is possible.
Can anyone help/walk me through what I am doing wrong? I would really appreciate it. :(
(P.S. I used code formatting, I apologize if this is annoying to some.)
By this table:
A 1 1 1 1 0 0 0 0
B 1 1 0 0 1 1 0 0
C 1 0 1 0 1 0 1 0
Y 1 0 1 1 1 0 1 0
Y=ab'+c
I've got it :D
f(a,b,c) = abc + ab'c + a'bc + a'b'c + ab'c'
= a(bc + b'c + b'c') + a'(bc + b'c)
= a(c(b + b') + b'c') + a'(c(b + b'))
= a(c * 1 + b'c') + a'(c * 1)
= a(c + b'c') + a'c
= a(c'(b'c')')' + a'c
= a(c'(b + c))' + a'c
= a(c'b +cc')' + a'c
= a(c'b)' + a'c
= a(c+b') + a'c
= ac + ab' + a'c
= c(a + a') + ab'
= ab' + c

Mathcad 14: "pattern match exception" when solving equation with more unknowns

I'm trying to solve an equation with 5 unknowns in Mathcad 14. My equations look like this:
Given
0 = e
1 = d
0 = c
-1 = 81a + 27b + 9c + 3d + e
0 = 108a + 27b + 6c + d
Find(a,b,c,d,e)
Find(a,b,c,d,e) is marked as red and says "pattern match exception". What is the problem?
In mathcad you need to do something similar to:
c:=0
d:=1
e:=0
a:=1
b:=1
Given
81*a + 27*b + 9*c + 3*d + e = -1
108*a + 27*b + 6*c + d = 0
Find(a,b,c,d,e) = (0,0,0,0,-1)
Now, what I have done here is to define the variables BEFORE the Solve Block (Given...Find), you have to give initial values which you think are close to the solution you require in order for the iteration to succeed.
Tips: To get the equals sign in the Solve Block, use ctrl and '='. If your looking to solve for 5 unknowns then you need 5 equations, the original post looked like you knew 3 of the variables and were looking for a and b, in this case you would do the following:
c:=0
d:=1
e:=0
a:=1
b:=1
Given
81*a + 27*b + 9*c + 3*d + e = -1
108*a + 27*b + 6*c + d = 0
Find(a,b) = (0.111,-0.481)
This has held c, d and e to their original values and iterated to solve for a and b only.
Hope this helps.