How to simplify this expression? - expression

F(A,B,C)=ABC+A'BC+A'BC'+AB'C+AC'
how to simplify this expression?
Need help...
Thanks.
How would you simplify this boolean expression? I don't know how to apply the boolean laws

ABC+A'B(C+C')+AB'C+AC' ==
ABC+A'B+ABC+AC'==
AC(B+B')+A'B+AC'==
AC+A'B+AC'==
A+A'B==
A+B

I haven't don't this in a long time. :(
F(A,B,C)=ABC+A'BC+A'BC'+AB'C+AC'
(A + A')BC+A'BC'+AB'C+AC'
BC+A'BC'+AB'C+AC'
B(C+A'C')+A(B'C+C')

Related

Array behaviours in Ruby

Am a little confused about array behaviors in Ruby
Given this;
string = "abcac"
remainder = 1
What will the following function do?
string[0, remainder]
let's try to check documentation for class String. Just google rubydoc string
and https://ruby-doc.org/core-2.4.0/String.html
then look for square brackets:
str[start, length] → new_str or nil
have a nice day and good luck with coding.
Max
Thank you.
I kept researching and found that
The first operand specifies an index(which may be negative), and the second specifies the length(which must be non negative)
[index, length]

How can this integral be solved?

In the maple:
In the WolframAlpha:
What it is wrong? Could you explain me?
In WolframAlpha testing the two results to see if they are the same or not
Simplify[-1/2 x(cos(log(34 x))-sin(log(34 x)))==
(x tan(log(34 x)/2)-x/2+x tan(log(34 x)/2)^2/2)/(1+tan(log(34 x)/2)^2)]
(all done on a single line) returns
True
Link to WolframAlpha result
so the result from WolframAlpha and from Maple are equivalent, they are just expressed in different forms.
Ah, a simpler way to get the same result, doesn't even need the Simplify
-1/2 x(cos(log(34 x))-sin(log(34 x)))==
(x tan(log(34 x)/2)-x/2+x tan(log(34 x)/2)^2/2)/(1+tan(log(34 x)/2)^2)
returns
True
Another link to WolframAlpha
They are different representations of the same thing.
It is quite straightforward to demonstrate this in Maple itself.
restart;
A1 := int(sin(ln(34*x)),x):
lprint(A1);
(x*tan(1/2*ln(34*x))-1/2*x+1/2*x*tan(1/2*ln(34*x))^2)
/(1+tan(1/2*ln(34*x))^2)
A2 := combine(combine(simplify(A1))):
lprint(A2);
1/2*x*sin(ln(34*x))-1/2*x*cos(ln(34*x))
simplify(A1 - A2);
0

Is log(n^c) equal O(log(n))

Does log(n^c)=O(log(n)) such that c is a constant?
I think this is true as log(n^c)/log(n)<=C2
so c<=C2. Is this true? If not what is true?
Yes, because you can convert it to
log(n^c)=clog(n)
log(n^c)/log(n)=c(log(n)/log(n))=c

How to evaluate two function in one statement?

How to declare two object in one statement for vb.net?
example
If IsNumeric(TextBox1.Text),(TextBox2.Text) Then
lbl_answer.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
Else
MsgBox("Error only number can be calculate")
End If
I can do
if isnumeric(textbox1.text) then
but I can't say
if isnumeric(textbox1.text), (textbox2.text)
How can I do so?
As nobody did so far let me express your options (straight from the comments - sorry but why those are not answers I don't know):
And
If IsNumeric(TextBox1.Text) And IsNumeric(TextBox2.Text) Then ...
AndAlso (subtle difference: AndAlso don't evaluate the second expression if the first evaluates to false)
If IsNumeric(TextBox1.Text) AndAlso IsNumeric(TextBox2.Text) Then ...
I don't think the LINQ one is really a option.

Is it better to use NOT or <> when comparing values?

Is it better to use NOT or to use <> when comparing values in VBScript?
is this:
If NOT value1 = value2 Then
or this:
If value1 <> value2 Then
better?
EDIT:
Here is my counterargument.
When looking to logically negate a Boolean value you would use the NOT operator, so this is correct:
If NOT boolValue1 Then
and when a comparison is made in the case of the first example a Boolean value is returned. either the values are equal True, or they are not False. So using the NOT operator would be appropriate, because you are logically negating a Boolean value.
For readability placing the comparison in parenthesis would probably help.
The latter (<>), because the meaning of the former isn't clear unless you have a perfect understanding of the order of operations as it applies to the Not and = operators: a subtlety which is easy to miss.
Because "not ... =" is two operations and "<>" is only one, it is faster to use "<>".Here is a quick experiment to prove it:
StartTime = Timer
For x = 1 to 100000000
If 4 <> 3 Then
End if
Next
WScript.echo Timer-StartTime
StartTime = Timer
For x = 1 to 100000000
If Not (4 = 3) Then
End if
Next
WScript.echo Timer-StartTime
The results I get on my machine:
4.783203
5.552734
Agreed, code readability is very important for others, but more importantly yourself. Imagine how difficult it would be to understand the first example in comparison to the second.
If code takes more than a few seconds to read (understand), perhaps there is a better way to write it. In this case, the second way.
The second example would be the one to go with, not just for readability, but because of the fact that in the first example, If NOT value1 would return a boolean value to be compared against value2. IOW, you need to rewrite that example as
If NOT (value1 = value2)
which just makes the use of the NOT keyword pointless.

Resources