assume array of N (N<=100000) elements a1, a2, .... ,an, and you are given range in it L, R where 1<=L<=R<=N, you are required to get number of values in the given range which are divisible by at least one number from a set S which is given also, this set can be any subset of {1,2,....,10}. a...
let equation 1: x % n1 = 0, equation 2: x % n2 =1, where n1 and n2 are known positive integers, any multiple of n1 will solve eqn1 and any multiple of n2 (and adding 1 to the multiple) will solve eqn2, but is there a short way to simultaneously solve the two equations to find x instead of...
i know that a node cannot have more than one parent given that these parents have common ancestor (because this is undirected cycle and a tree must have no cycles).
but can a node have more than one parent given that these parents don't have common ancestor (which will produce an unrooted tree i...
when saying the probability distribution of X is f(x) = (3 x) this is to be like vector notation where 3 is above x but i can't write it like this here. what is meant by this notation ?
i think i've figured what what was wrong in my thinking about this.
for the colored balls example we could normally treat with their tree diagram as follows:
because red, green, yellow are the all possible outcomes of this experiment, so we can normally say: probability of both green and red...
i may have a conflict in something, regarding this :
is P(R∩G) = P(R)P(G\R) + P(G)P(R\G) as a whole, or is it = P(R)P(G\R) = P(G)P(R\G) as if we are adding P(R∩G) to P(R∩G) giving 2P(R∩G) ?
but can't we say that this = P(M∩W) / P(M) and we already have the intersection and P(M) ? by the way the second part of the question was asking about this ( P(W|M) )
Homework Statement
suppose we have 9 balls : 2 red, 3 green, 4 yellow. and we draw 2 balls without replacement, the probability that one of them is red and the other is green is : P(R)P(G\R)+P(G)P(R\G) = (2/9)(3/8)+(3/9)(2/8)
i faced a problem in the textbook which says: the probability that a...
sorry it is supposed to be i >= n not i < n, regarding the homework thing : i didn't get this topic from college but from this site https://www.cpp.edu/~ftang/courses/CS240/lectures/analysis.htm while i was reading about algorithms. i saw that somethings in it are not right so i made some...
Assume the following set of instructions:
1. i = 0
2. if i < n, goto line 6
3. if A [ i ] = = x, goto line 7
4. i++
5. goto line 2
6. return false
7. return true
Assume that line i take Ci time, where Ci is a constant. The worst case total time of running this block of code can be calculated...
regarding question number 10, we have h = f + λg where g is the constraint (the ellipsoid) and f is the function we need to maximize or minimize (the rectangular parallelpiped volume),
now my question : is it right that f is 8xyz ? i mean if we take f to be xyz not 8xyz and solved till we got...
F(r,s,t,v) = r^2 + sv + t^3, where: r = x^2 +y^2+z^2 /// s = xyz /// v = xe^y /// t = yz^2
find Fxx
i have 2 solutions for this and i am not sure what is the right one
the first solution finds Fx then uses formula : Fxx = Fxr.Rx + Fxs.Sx + Fxv.Vx+Fxt.Tx
the 2nd solution find Fx then uses the...
let me rephrase my point in a way acceptable by all, for this simplest circuit :
I = lim(R→0) V/R = infinity, meaning that as R approaches zero I approaches infinity, this is represented by this curve :
the division by zero is actually a limit, the R approaches zero but never reaches it, my...
" The behaviour seems contrary to natural expectation but many explanations have been proposed.
source: https://en.wikipedia.org/wiki/Mpemba_effect#Suggested_explanations
@phinds : firstly we are not fighting, if my posts annoy you can ignore them or block me
secondly i am not repeating anything, i am replying to his point and didn't come up with anything new
thirdly regarding erroneous equations : so why in open circuit connected to voltage source we have alike...
okay i am with you, let's write the equations before figuring out the current, the equation for source says voltage difference is V, the equation of wire says the same difference of voltage is RI = 0(I), so I is V/0, we return to the same point ?
i have just remembered something, i understand the consistency principle and i am totally convinced that number 3 is wrong because the wire must have the current 0 and I at the same time, but regarding number 4 i think the concept of infinity has a rule, now we have short circuit saying voltage...
i didn't say wire is source of voltage, what i meant from the very beginning that in numbers 3 and 4 current and volt will be 0 which means there are no voltage or current sources just wires, didn't say source = wire, and i said also the purpose of the question and the relation with norton...
we took norton equivalent in the lectures in a different way, i don't invent examples, i am telling you the style of questions they give us and the steps of solution they told us, first of all in the question it tells you what is the external load to work on (2 ohm here) then to solve these are...
i didn't say it is wrong circuit, i said how to get norton current in the a-b area (across the 2 ohm resistor) ? it will lead to short circuit on the voltage source on the right
(as in norton you replace the R(L) (the 2 ohm here) with SC)
right, about 1 and 2 : are they consistent because:
1 : the source says current is I and SC doesn't affect it (the current in the rest of wire is also I)
2 : the source says voltage rise = V and open circuit doesn't affect it (the voltage drop on the open circuit is also V)
correct ?
so why it is commonly said that in open circuit resistance is infinite (v/i if v = 10 for ex so it will be 10/0) ? aren't the cases so close ? in open circuit infinite resistance means no current is flowing and in short circuit infinite current means no resistance is present ?