# Search results

1. ### C/++/# Finding intersections in a given range ?

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...
2. ### I Modulus of two numbers ?

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...
3. ### I How to do division in modulus mode ?

for example 100,539/2 in mod 1,000,007. is there a systematic procedure to calculate this ??
4. ### Data structures (trees)

so what does an unrooted tree exactly mean ?
5. ### Data structures (trees)

i am not planning now to use this but as a concept i want to know is this right or wrong
6. ### Data structures (trees)

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...
7. ### I What is meant by this notation?

that's right thank you ! i don't know why do they represent probability distributions by this notation
8. ### I What is meant by this notation?

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 ?
9. ### Conditional probability?

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...
10. ### Conditional probability?

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) ?
11. ### Conditional probability?

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) )
12. ### Conditional probability?

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...
13. ### Data structure and algorithms time computation?

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...
14. ### Data structure and algorithms time computation?

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...
15. ### Lagrange multipliers method?

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...
16. ### Partial derivatives and chain rule?

it was giving me a third answer at first but i discovered a mistake which i made in the calculations, i know the correct one now
17. ### Partial derivatives and chain rule?

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...
18. ### How correct are these concepts about circuits?

this is ambiguous, there were lots of messages posted here,so i don't know exactly where your problem is
19. ### How correct are these concepts about circuits?

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...
20. ### B How can boiling water freeze faster than water at room temp?

" The behaviour seems contrary to natural expectation but many explanations have been proposed. source: https://en.wikipedia.org/wiki/Mpemba_effect#Suggested_explanations
21. ### How correct are these concepts about circuits?

@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...
22. ### How correct are these concepts about circuits?

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 ?
23. ### How correct are these concepts about circuits?

"we have short circuit saying....." "like in open circuit......"
24. ### How correct are these concepts about circuits?

do you mean : If resistance is zero then "current" is not infinite. ??
25. ### How correct are these concepts about circuits?

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...
26. ### How correct are these concepts about circuits?

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...
27. ### How correct are these concepts about circuits?

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...
28. ### How correct are these concepts about circuits?

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)
29. ### How correct are these concepts about circuits?

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 ?
30. ### How correct are these concepts about circuits?

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 ?