Search results

  1. M

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

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

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

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

    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 ?
  6. M

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

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

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

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

    How correct are these concepts about circuits?

    first of all sorry for bad drawing, is all of the following correct : * number 1 : the current will flow normally * number 2 : the voltage source will not give current but Vb-Va = V of the voltage source (10 for example) * number 3 : no current will flow * number 4 : the voltage source will be...
  11. M

    Hyperbolic paraboloid curve ?

    then look at : the 2 curves are nearly the same while the equations are not, is there anything wrong ?
  12. M

    Skew and perpendicular lines?

    in 3D assume two skew lines L1: x=x°+at, y=y°+bt, z=z°+ct, L2: x=x°°+ds, y=y°°+es, z=z°°+fs. therefore L1, L2 parallel vectors are respectively: v1= <a, b, c>, v2= <d, e, f>. if v1.v2= ad+be+cf= 0 (vectors are perpendicular), are the line L1, L2 considered perpendicular also or beside the dot...
  13. M

    Passive and active elements?

    p here stands to power (v in power equation is magnitude), in addition to this : is it also true that in the first one : V = RI (V upper - V lower) and in the second one : V = - RI (V lower - V upper) ? (current is magnitude in all previous equations)
  14. M

    Circuits analysis question...

    i have just started taking electric and electronic circuits course and i have a question about a basic concept in KVL, regarding the loop direction that you assume in any circuit : does the loop direction that you assume is just telling that you will subtract the voltage of the near points from...
  15. M

    Short method for computing this?

    suppose a side of an equation : 26q+1 , and i want the least positive integer value for q that makes this side of equation divisible by 7, is there any short method to do this ?
  16. M

    Torque by magnetic field on a current carrying wire loop ?

    as u know torque is given by NI(A X B) where N and I are number of loop turns and current magnitude respectively, A is area in vector and B is magnetic field in vector. regarding the direction of area : what normal to take as a direction, is at that which makes acute angle with magnetic field...
  17. M

    Connection in parallel/series?

    this is maybe one basic question, i drew 2 connections of capacitors, the left : connected in series. the right : connected in parallel ??
  18. M

    Capacitors connected in series?

    suppose 2 capacitors C1, C2 connected in series with battery V, let charge in circuit be Q, since they are connected in series so each capacitor will have Q also, suppose we disconnected them from the battery and reconnected them again in series (without connecting voltage source or earth with...
  19. M

    Capacitor's dielectric and voltage?

    suppose a battery connected to a capacitor only (and no dielectric inserted), the potential difference of the capacitor will increase till it becomes equal to that of the battery, suppose we put dielectric in the capacitor, this will decrease potential difference of the capacitor, now the...
  20. M

    Friction between objects?

    if a body is static on horizontal rough ground it will not experience friction, but if it starts moving it will experience friction opposing its motion, this is between object and ground, but let's suppose 2 rough objects each has its coefficient of friction, suppose one of them is at rest and...
  21. M

    Capacitance of a spherical capacitor?

    1-capacitance of sphere with radius r : 4πεr 2-capacitance of 2 concentric spheres with inner radius a and outer radius b : 4πε(a.b/b-a) 3-when the outer the outer sphere is earthed it gives the same capacitance as in number 2 4-when the inner sphere is earthed it gives the sum of capacitances...
  22. M

    Confused about short circuit and open circuit

    i know that short circuit is when current is max while resistance is zero and open circuit is when resistance is infinite and current is zero, but in terms of voltage, if i have a part of circuit and i want to know whether it is short or open circuit and i only know : the voltage and if the...
  23. M

    Electric field on the surface of charged conducting sphere?

    just above the surface it's (kq/r^2) where r is the radius of the sphere and just below the surface it's zero, so is the electric field zero also exactly on the surface ? (as the q enclosed then will be zero since the flux is coming from the surface and not actually penetrating it) and...
  24. M

    Electric field inside charged conducting sphere?

    i know it s zero because of the electrostatic equilibrium, but in terms of point charges : from the charge distribution on the sphere surface if we consider 2 point charges opposite to each other in direction : it s logical that at the point in the mid distance between them the electric field...