How many boolean functions are possible for n-dimensional input with n-training examples - boolean-logic

Can someone please explain why are there 2^9 boolean functions possible for 7 examples?

Related

What is mean of × in SAM?

I would like to understand SAM, the model during YOLOv4.
However, I am confused as to the meaning of the "x" in the diagram.
Please tell me what module name this "x" represents in yolov4.cfg in darknet.
Thank you in advance.
It is element-wise multiplication, so in most of the libraries quite literally the *. Source is here:
https://arxiv.org/pdf/1807.06521.pdf

Appropriate loss function in pytorch when output is an array of float numbers

I am writing an encoder/decoder model very similar to https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
The only difference is, here, the words are represented by some indices. I want to show them based on another metric, which are represented by flaot numbers.
The loss function nn.criterion = nn.NLLLoss(), seems to be working for times we are only workin with classes.
If my output array is not an array of integers, but an array of float numbers, what kind of loss function I can use? Considering all other parts are similar to the tutorial?
Thanks in advance.

Boolean Expressions with nested NAND Gates?

I have a problem with some homework, for my Advanced Digital Design course, in which I have to create the truth table and find the Boolean expression for a provided circuit (image is linked below). I was able to create the truth table and I think find the Boolean Expression for the problem using the truth table that I created, but I don't think that this is the way that we are supposed to find the Boolean Expression. I was hoping that someone could share some insight on how to find the Boolean Expression without using the truth table.
I would normally not have such an issue with this, but since there are 5 variables, and NAND gates, I am quite confused on how to simplify once I find it.
I think that the outcome is something like:
[(a(bcd)'e)']' when you look at the circuit, and not the table, but I am not entirely sure. I am also not sure on how to simplify this into a Boolean expression if this is right.
Using the truth table to find the minterms I get y= m17+m19+m21+m22+m23+m25+m29 (which I am also not sure if it is right). And if I use a K-Chart to solve this, I end up with y = ab'e + a'ce + ab'cd, which seems like a legitimate simplified Boolean expression, but I have no clue if that is right.
Since this question is worth 20 of the total 100 points, I could really use some help understanding how this works.
Here is the image we were provided:
Circuit: only circuit (a), not (b)
Thank you!
I think that the outcome is something like: [(a(bcd)'e)']'
Your first guess is correct.
You just have to remark that whatever''=whatever
f=[(a(bcd)'e)']' = a(bcd)'e
Using de Morgan (bcd)' = b'+c'+d'
Hence f=a(bcd)'e = ae(b'+c'+d') =ab'e + ac'e + ad'e
which is minimal.

Scheme: Loop Function in Racket

Write a recursive function that, given a positive integer k, computes the product (1-1/2)(1-1/3)...(1-1/k).
I have tried to make a loop, but don't know where to start.
Any ideas?
Sure! This example fits the pattern of section 9.3 (Natural Numbers) from How To Design Programs, v2e. You should find a lot of helpful guidance there.

Finding the Maximum

How to find the following Maximum or supremum by computer software such as Mathematica and Matlab: $\sup\frac{(1+s)^{4}+(s+t)^{4}+t^{4}}{1+s^{4}+t^{4}}$?
Instead of numerical approximation, what is the accurate maximum?
Thanks.
Since the question seems a bit like homework, here's an answer that starts a bit like a lecture:
ask yourself what happens to the function as s and t go to small and to large positive and negative values; this will help you to identify the range of values you should be examining; both Mathematica and Matlab can help your figure this out;
draw the graph of your function over the range of values of interest, develop a feel for its shape and try to figure out where it has maxima; for this the Mathematic Plot3D[] function and the Matlab plot() function will both be useful;
since this is a function of 2 variables, you should think about plotting some of its sections, ie hold s (or t) constant, and make a 2D plot of the section function; again, develop some understanding of how the function behaves;
now you should be able to do some kind of search of the s,t values around the maxima of the function and get an acceptably accurate result.
If this is too difficult then you could use the Mathematica function NMaximize[]. I don't think that Matlab has the same functionality for symbolic functions built-in and you'll have to do the computations numerically but the function findmax will help.
In Matlab, one would create a vector/matrix with s and t values, and a corresponding vector with the function values. Then you can pinpoint the maximum using the function max
In Mathematica, use FindMaximum like this:
f[s_,t_]:= ((1+s)^4 + (s+t)^4 + t^4)/(1+s^4+t^4)
FindMaximum[ f[s,t],{s,0},{t,0} ]
This searches for a maximum starting from (s,t)=(0,0).
For more info, see http://reference.wolfram.com/mathematica/ref/FindMaximum.html