# Recent content by mohamed el teir

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...