text:
Publicité ▼

## définition - Dijkstra's algorithm

voir la définition de Wikipedia

Wikipedia

# Dijkstra's algorithm

Class Dijkstra's algorithm runtime Search algorithm Graph $O(|E| + |V| \log|V|)$

Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956 and published in 1959,[1][2] is a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms.

For a given source vertex (node) in the graph, the algorithm finds the path with lowest cost (i.e. the shortest path) between that vertex and every other vertex. It can also be used for finding costs of shortest paths from a single vertex to a single destination vertex by stopping the algorithm once the shortest path to the destination vertex has been determined. For example, if the vertices of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. As a result, the shortest path first is widely used in network routing protocols, most notably IS-IS and OSPF (Open Shortest Path First).

Dijkstra's original algorithm does not use a min-priority queue and runs in O(|V|2). The idea of this algorithm is also given in (Leyzorek et al. 1957). The implementation based on a min-priority queue implemented by a Fibonacci heap and running in O(|E| + |V| log |V|) is due to (Fredman & Tarjan 1984). This is asymptotically the fastest known single-source shortest-path algorithm for arbitrary directed graphs with unbounded nonnegative weights. (For an overview of earlier shortest path algorithms and later improvements and adaptations, see: Single-source shortest-paths algorithms for directed graphs with nonnegative weights.)

## Algorithm

Illustration of Dijkstra's algorithm search for finding path from a start node to a goal node in a robot motion planning problem. Open nodes represent the "tentative" set. Filled nodes are visited ones, with color representing the distance: the greener, the further. Nodes in all the different directions are explored uniformly, appearing as a more-or-less circular wavefront as Dijkstra's algorithm uses a heuristic identically equal to 0.

Let the node at which we are starting be called the initial node. Let the distance of node Y be the distance from the initial node to Y. Dijkstra's algorithm will assign some initial distance values and will try to improve them step by step.

1. Assign to every node a tentative distance value: set it to zero for our initial node and to infinity for all other nodes.
2. Mark all nodes unvisited. Set the initial node as current. Create a set of the unvisited nodes called the unvisited set consisting of all the nodes except the initial node.
3. For the current node, consider all of its unvisited neighbors and calculate their tentative distances. For example, if the current node A is marked with a tentative distance of 6, and the edge connecting it with a neighbor B has length 2, then the distance to B (through A) will be 6+2=8. If this distance is less than the previously recorded tentative distance of B, then overwrite that distance. Even though a neighbor has been examined, it is not marked as visited at this time, and it remains in the unvisited set.
4. When we are done considering all of the neighbors of the current node, mark the current node as visited and remove it from the unvisited set. A visited node will never be checked again; its distance recorded now is final and minimal.
5. If the destination node has been marked visited (when planning a route between two specific nodes) or if the smallest tentative distance among the nodes in the unvisited set is infinity (when planning a complete traversal), then stop. The algorithm has finished.
6. Set the unvisited node marked with the smallest tentative distance as the next "current node" and go back to step 3.

## Description

Note: For ease of understanding, this discussion uses the terms intersection, road and map — however, formally these terms are vertex, edge and graph, respectively.

Suppose you want to find the shortest path between two intersections on a city map, a starting point and a destination. The order is conceptually simple: to start, mark the distance to every intersection on the map with infinity. This is done not to imply there is an infinite distance, but to note that that intersection has not yet been visited; some variants of this method simply leave the intersection unlabeled. Now, at each iteration, select a current intersection. For the first iteration the current intersection will be the starting point and the distance to it (the intersection's label) will be zero. For subsequent iterations (after the first) the current intersection will be the closest unvisited intersection to the starting point—this will be easy to find.

From the current intersection, update the distance to every unvisited intersection that is directly connected to it. This is done by determining the sum of the distance between an unvisited intersection and the value of the current intersection, and relabeling the unvisited intersection with this value if it is less than its current value. In effect, the intersection is relabeled if the path to it through the current intersection is shorter than the previously known paths. To facilitate shortest path identification, in pencil, mark the road with an arrow pointing to the relabeled intersection if you label/relabel it, and erase all others pointing to it. After you have updated the distances to each neighboring intersection, mark the current intersection as visited and select the unvisited intersection with lowest distance (from the starting point) -- or lowest label—as the current intersection. Nodes marked as visited are labeled with the shortest path from the starting point to it and will not be revisited or returned to.

Continue this process of updating the neighboring intersections with the shortest distances, then marking the current intersection as visited and moving onto the closest unvisited intersection until you have marked the destination as visited. Once you have marked the destination as visited (as is the case with any visited intersection) you have determined the shortest path to it, from the starting point, and can trace your way back, following the arrows in reverse.

Of note is the fact that this algorithm makes no attempt to direct "exploration" towards the destination as one might expect. Rather, the sole consideration in determining the next "current" intersection is its distance from the starting point. In some sense, this algorithm "expands outward" from the starting point, iteratively considering every node that is closer in terms of shortest path distance until it reaches the destination. When understood in this way, it is clear how the algorithm necessarily finds the shortest path, however it may also reveal one of the algorithm's weaknesses: its relative slowness in some topologies.

## Pseudocode

In the following algorithm, the code u := vertex in Q with smallest dist[], searches for the vertex u in the vertex set Q that has the least dist[u] value. That vertex is removed from the set Q and returned to the user. dist_between(u, v) calculates the length between the two neighbor-nodes u and v. The variable alt on lines 20 & 22 is the length of the path from the root node to the neighbor node v if it were to go through u. If this path is shorter than the current shortest path recorded for v, that current path is replaced with this alt path. The previous array is populated with a pointer to the "next-hop" node on the source graph to get the shortest route to the source.

 1  function Dijkstra(Graph, source):
2      for each vertex v in Graph:                                // Initializations
3          dist[v] := infinity ;                                  // Unknown distance function from
4                                                                 // source to v
5          previous[v] := undefined ;                             // Previous node in optimal path
6                                                                 // from source
7      end for ;
8      dist[source] := 0 ;                                        // Distance from source to source
9      Q := the set of all nodes in Graph ;                       // All nodes in the graph are
10                                                                 // unoptimized - thus are in Q
11      while Q is not empty:                                      // The main loop
12          u := vertex in Q with smallest distance in dist[] ;    // Start node in first case
13          if dist[u] = infinity:
14              break ;                                            // all remaining vertices are
15                                                                 // inaccessible from source
16          end if ;
17          remove u from Q ;
18          for each neighbor v of u:                              // where v has not yet been
19                                                                                removed from Q.
20              alt := dist[u] + dist_between(u, v) ;
21              if alt < dist[v]:                                  // Relax (u,v,a)
22                  dist[v] := alt ;
23                  previous[v] := u ;
24                  decrease-key v in Q;                           // Reorder v in the Queue
25              end if ;
26          end for ;
27      end while ;
28      return dist[] ;
29  end Dijkstra.

If we are only interested in a shortest path between vertices source and target, we can terminate the search at line 13 if u = target. Now we can read the shortest path from source to target by iteration:

1  S := empty sequence
2  u := target
3  while previous[u] is defined:
4      insert u at the beginning of S
5      u := previous[u]
6  end while ;

Now sequence S is the list of vertices constituting one of the shortest paths from source to target, or the empty sequence if no path exists.

A more general problem would be to find all the shortest paths between source and target (there might be several different ones of the same length). Then instead of storing only a single node in each entry of previous[] we would store all nodes satisfying the relaxation condition. For example, if both r and source connect to target and both of them lie on different shortest paths through target (because the edge cost is the same in both cases), then we would add both r and source to previous[target]. When the algorithm completes, previous[] data structure will actually describe a graph that is a subset of the original graph with some edges removed. Its key property will be that if the algorithm was run with some starting node, then every path from that node to any other node in the new graph will be the shortest path between those nodes in the original graph, and all paths of that length from the original graph will be present in the new graph. Then to actually find all these short paths between two given nodes we would use a path finding algorithm on the new graph, such as depth-first search.

## Running time

An upper bound of the running time of Dijkstra's algorithm on a graph with edges $E$ and vertices $V$ can be expressed as a function of $|E|$ and $|V|$ using Big-O notation.

For any implementation of vertex set $Q$ the running time is $O(|E| \cdot dk_Q + |V| \cdot em_Q)$, where $dk_Q$ and $em_Q$ are times needed to perform decrease key and extract minimum operations in set $Q$, respectively.

The simplest implementation of the Dijkstra's algorithm stores vertices of set $Q$ in an ordinary linked list or array, and extract minimum from $Q$ is simply a linear search through all vertices in $Q$. In this case, the running time is $O(|E| + |V|^2) = O(|V|^2)$.

For sparse graphs, that is, graphs with far fewer than $O(|V|^2)$ edges, Dijkstra's algorithm can be implemented more efficiently by storing the graph in the form of adjacency lists and using a binary heap, pairing heap, or Fibonacci heap as a priority queue to implement extracting minimum efficiently. With a binary heap, the algorithm requires $O((|E| + |V|) \log |V|)$ time (which is dominated by O( | E | log | V | ), assuming the graph is connected). To avoid O(|V|) look-up in decrease-key step on a vanilla binary heap, it is necessary to maintain a supplementary index mapping each vertex to the heap's index (and keep it up to date as priority queue $Q$ changes), making it take only $O(log|V|)$ time instead. The Fibonacci heap improves this to $O(|E| + |V| \log|V|)$.

Note that for Directed acyclic graphs, it is possible to find shortest paths from a given starting vertex in linear time, by processing the vertices in a topological order, and calculating the path length for each vertex to be the minimum length obtained via any of its incoming edges.[3]

## Related problems and algorithms

The functionality of Dijkstra's original algorithm can be extended with a variety of modifications. For example, sometimes it is desirable to present solutions which are less than mathematically optimal. To obtain a ranked list of less-than-optimal solutions, the optimal solution is first calculated. A single edge appearing in the optimal solution is removed from the graph, and the optimum solution to this new graph is calculated. Each edge of the original solution is suppressed in turn and a new shortest-path calculated. The secondary solutions are then ranked and presented after the first optimal solution.

Dijkstra's algorithm is usually the working principle behind link-state routing protocols, OSPF and IS-IS being the most common ones.

Unlike Dijkstra's algorithm, the Bellman-Ford algorithm can be used on graphs with negative edge weights, as long as the graph contains no negative cycle reachable from the source vertex s. (The presence of such cycles means there is no shortest path, since the total weight becomes lower each time the cycle is traversed.)

The A* algorithm is a generalization of Dijkstra's algorithm that cuts down on the size of the subgraph that must be explored, if additional information is available that provides a lower bound on the "distance" to the target. This approach can be viewed from the perspective of linear programming: there is a natural linear program for computing shortest paths, and solutions to its dual linear program are feasible if and only if they form a consistent heuristic (speaking roughly, since the sign conventions differ from place to place in the literature). This feasible dual / consistent heuristic defines a nonnegative reduced cost and A* is essentially running Dijkstra's algorithm with these reduced costs. If the dual satisfies the weaker condition of admissibility, then A* is instead more akin to the Bellman-Ford algorithm.

The process that underlies Dijkstra's algorithm is similar to the greedy process used in Prim's algorithm. Prim's purpose is to find a minimum spanning tree that connects all nodes in the graph; Dijkstra is concerned with only two nodes. Prim's does not evaluate the total weight of the path from the starting node, only the individual path.

## Dynamic programming perspective

From a dynamic programming point of view, Dijkstra's algorithm is a successive approximation scheme that solves the dynamic programming functional equation for the shortest path problem by the Reaching method.[4][5][6]

In fact, Dijkstra's explanation of the logic behind the algorithm,[7] namely

Problem 2. Find the path of minimum total length between two given nodes $P$ and $Q$.

We use the fact that, if $R$ is a node on the minimal path from $P$ to $Q$, knowledge of the latter implies the knowledge of the minimal path from $P$ to $R$.

is a paraphrasing of Bellman's famous Principle of Optimality in the context of the shortest path problem.

## Notes

1. ^ Dijkstra, Edsger; Thomas J. Misa, Editor (2010-08). "An Interview with Edsger W. Dijkstra". Communications of the ACM 53 (8): 41–47. DOI:10.1145/1787234.1787249. "What is the shortest way to travel from Rotterdam to Groningen? It is the algorithm for the shortest path which I designed in about 20 minutes. One morning I was shopping with my young fianceé, and tired, we sat down on the café terrace to drink a cup of coffee and I was just thinking about whether I could do this, and I then designed the algorithm for the shortest path."
2. ^ Dijkstra 1959
3. ^ http://www.boost.org/doc/libs/1_44_0/libs/graph/doc/dag_shortest_paths.html
4. ^ Sniedovich, M. (2006). "Dijkstra’s algorithm revisited: the dynamic programming connexion" (PDF). Journal of Control and Cybernetics 35 (3): 599–620.  Online version of the paper with interactive computational modules.
5. ^ Denardo, E.V. (2003). Dynamic Programming: Models and Applications. Mineola, NY: Dover Publications. ISBN 978-0-486-42810-9.
6. ^ Sniedovich, M. (2010). Dynamic Programming: Foundations and Principles. Francis & Taylor. ISBN 978-0-8247-4099-3.
7. ^ Dijkstra 1959, p. 270

## References

Publicité ▼

Contenu de sensagent

• définitions
• synonymes
• antonymes
• encyclopédie

• definition
• synonym

dictionnaire et traducteur pour sites web

Alexandria

Une fenêtre (pop-into) d'information (contenu principal de Sensagent) est invoquée un double-clic sur n'importe quel mot de votre page web. LA fenêtre fournit des explications et des traductions contextuelles, c'est-à-dire sans obliger votre visiteur à quitter votre page web !

Essayer ici, télécharger le code;

Solution commerce électronique

Augmenter le contenu de votre site

Ajouter de nouveaux contenus Add à votre site depuis Sensagent par XML.

Parcourir les produits et les annonces

Obtenir des informations en XML pour filtrer le meilleur contenu.

Indexer des images et définir des méta-données

Fixer la signification de chaque méta-donnée (multilingue).

Renseignements suite à un email de description de votre projet.

Jeux de lettres

Les jeux de lettre français sont :
○   Anagrammes
○   jokers, mots-croisés
○   Lettris
○   Boggle.

Lettris

Lettris est un jeu de lettres gravitationnelles proche de Tetris. Chaque lettre qui apparaît descend ; il faut placer les lettres de telle manière que des mots se forment (gauche, droit, haut et bas) et que de la place soit libérée.

boggle

Il s'agit en 3 minutes de trouver le plus grand nombre de mots possibles de trois lettres et plus dans une grille de 16 lettres. Il est aussi possible de jouer avec la grille de 25 cases. Les lettres doivent être adjacentes et les mots les plus longs sont les meilleurs. Participer au concours et enregistrer votre nom dans la liste de meilleurs joueurs ! Jouer

Dictionnaire de la langue française
Principales Références

La plupart des définitions du français sont proposées par SenseGates et comportent un approfondissement avec Littré et plusieurs auteurs techniques spécialisés.
Le dictionnaire des synonymes est surtout dérivé du dictionnaire intégral (TID).
L'encyclopédie française bénéficie de la licence Wikipedia (GNU).

Changer la langue cible pour obtenir des traductions.
Astuce: parcourir les champs sémantiques du dictionnaire analogique en plusieurs langues pour mieux apprendre avec sensagent.

5568 visiteurs en ligne

calculé en 0,093s

Je voudrais signaler :
section :
une faute d'orthographe ou de grammaire
un contenu abusif (raciste, pornographique, diffamatoire)
une violation de copyright
une erreur
un manque
autre
merci de préciser :
allemand anglais arabe bulgare chinois coréen croate danois espagnol espéranto estonien finnois français grec hébreu hindi hongrois islandais indonésien italien japonais letton lituanien malgache néerlandais norvégien persan polonais portugais roumain russe serbe slovaque slovène suédois tchèque thai turc vietnamien
allemand anglais arabe bulgare chinois coréen croate danois espagnol espéranto estonien finnois français grec hébreu hindi hongrois islandais indonésien italien japonais letton lituanien malgache néerlandais norvégien persan polonais portugais roumain russe serbe slovaque slovène suédois tchèque thai turc vietnamien


text:
# $f$ is positive continuous function on $[0,1]$.

$f$ is positive continuous function on $[0,1]$. Define $$\int_{0}^{a_n} f(x) dx = \frac{1}{n} \int_{0}^1 f(x) dx$$ where $a_n>0$. Find $\lim_{n\to \infty} n a_n$.

It is clear that $lim_{n\to \infty} a_n =0$ because $f(x)$ is positive.I tried to use Weierstrass approximation of continuous function by polynomials but could no quite get the right way.I do not see a way to bring down this equation $\int_{0}^{a_n} f(x) dx = \frac{1}{n} \int_{0}^1 f(x) dx$ to $n a_n$.

This is a qualifying problem of real analysis. Small hint works for me.

Thanks.

HINT: Call $F$ a primitive of $f$; thus your relation yelds to $$F(a_n)-F(0)=\frac1n[F(1)-F(0)]$$

• I have tried that one. But let me see one more time. – mp100 Jul 14 '15 at 23:27

HINT:

Find the limit

$$\lim_{n\to \infty}\left(\frac{1}{a_n}\int_{0}^{a_n}\,f(x)\,dx\right)$$

\begin{align}\lim_{n\to \infty}n\,a_n&=\lim_{n\to \infty}n\,a_n\frac{\int_0^{a_n}f(x)dx}{\int_0^{a_n}f(x)dx}\\\\&=\lim_{n\to \infty}\frac{n\,\int_0^{a_n}f(x)dx}{\frac{1}{a_n}\int_0^{a_n}f(x)dx}\\\\&=\lim_{n\to \infty}\frac{\int_0^{1}f(x)dx}{\frac{1}{a_n}\int_0^{a_n}f(x)dx}\\\\&=\frac{1}{f(0)}\int_0^{1}f(x)dx\end{align}

• A $n$ got lost :) – user251257 Jul 14 '15 at 23:40
• @user251257 Thanks! A pitfall of using a "smart phone" to post. – Mark Viola Jul 15 '15 at 0:29

Let $u = nx \to du = ndx \to \dfrac{1}{n}\displaystyle \int_{0}^1f(x)dx= \displaystyle \int_{0}^{a_n} f(x)dx = \displaystyle \int_{0}^{na_n} f\left(\dfrac{u}{n}\right)\left(\dfrac{1}{n}du\right)=\dfrac{1}{n}\displaystyle \int_{0}^{na_n} f\left(\dfrac{u}{n}\right)du\Rightarrow \displaystyle \int_{0}^1 f(x)dx = \displaystyle \int_{0}^{na_n} f\left(\dfrac{u}{n}\right)du$. Now let $L = \displaystyle \lim_{n\to\infty} na_n$, and observe due to continuity of $f$ at $x = 0$, $\displaystyle \lim_{n\to \infty} f\left(\dfrac{u}{n}\right) = f(0)$, we have: $\displaystyle \int_{0}^1 f(x)dx = \displaystyle \int_{0}^L f(0)du = Lf(0) \to L = \dfrac{\displaystyle \int_{0}^1 f(x)dx}{f(0)}$

• For the proof to work, you need to know that $L$ exists and $L<\infty$. Little bit wonky. – user251257 Jul 14 '15 at 23:43
• Mean value theorem on primitive of f makes theorem much more easy – mp100 Jul 15 '15 at 2:28

Let $F(x)=\int_0^x f(y) dy$. Then $F$ is a strictly increasing function satisfying $F(a_n)=\frac{1}{n} F(1)$. This means that $\lim_{n \to \infty} a_n = 0$. Hence $F(a_n)=f(0) a_n + o(a_n)$ (which is what the FTC gives) is a useful approximation. So

$$f(0) a_n + o(a_n) = \frac{1}{n} F(1) \Rightarrow n a_n = \frac{F(1)}{f(0)} + o(n a_n).$$

Move the error term to the other side:

$$(1+o(1)) n a_n = \frac{F(1)}{f(0)}.$$

Take limits on both sides:

$$\lim_{n \to \infty} n a_n = \frac{F(1)}{f(0)}.$$

Hint: You might want to consider the limit of $$\frac{1}{a_n} \int_0^{a_n} f(x) \mathrm d x = \frac{1}{a_n n} \int_0^1 f(x) \mathrm d x$$ and use $a_n\to 0$ for $n\to\infty$.

Since $f$ is positive and continuous, we have $\frac{1}{a_n} \int_0^{a_n} f(x) \mathrm d x > 0$ and by fundamental theorem of calculus we have $$\lim_{n\to\infty} a_n n = \frac{\int_0^1 f(x) \mathrm d x}{\lim_{n\to\infty}\frac{1}{a_n} \int_0^{a_n} f(x) \mathrm d x} = \frac{\int_0^1 f(x) \mathrm d x}{f(0)}.$$

• This one works. Thanks – mp100 Jul 15 '15 at 1:01
• No wonder it got a(n) anonymous and unexplained downvote. – Gary. Jul 15 '15 at 2:21
• @Gary.: What do you mean? – user251257 Jul 15 '15 at 2:23
• @user251257: Just a sarcastic comment on anonymous downvotes/downvoters. I wish I was registered and could upvote your, nice answer. I will do so when I register. – Gary. Jul 15 '15 at 2:25
• @user251257: I have received a few anonymous downvotes myself. Instead of asking you to clarify, they automatically assume you're wrong and put you on the defensive. – Gary. Jul 15 '15 at 2:28

format: plain


text:
# Particle motion in non-uniform electric field

1. ### mitleid

56
Two adjacent parallel plate capacitors are used to deflect charged particles as shown in the figure. The relevant dimensions l and h are shown. The lower capacitor plates are grounded while the upper plates are kept at some voltages V1 and V2, which are to be found in this problem given the following.

A positively charged particle q with mass m enters horizontally at point A. After executing some trajectory, the particle exits at point B, which has the same vertical position as point A. However, the velocity at B is not horizontal, and has some component Vy. What are the potentials? Neglect the effects of gravity.

Some relevant equations :
F = qE
Acceleration (a) = F / m = qE/m

mechanics:
x = Vi*t
y = - (qE/2m)t^2
Vfx = Vi
Vfy = -(qE/m)*(1/Vi)

I think I have most of what I need here. This next figure illustrates how I think the two trajectories take place, and I wanted to check this before I went further.

Since the bottom plates are grounded, voltage across them is equal to 0. E points from higher to lower potentials, so the field would expected to be downwards.

A downward field would correspond to the first hypothetical trajectory. However, for Vy to be "positive" or upwards, an upward field would have to take place for the second trajectory. Thus V = 0 would have to be higher than V2, making it negative or also equal to 0.

Am I headed in the right direction?

2. ### learningphysics

4,124
That's what you meant right?

Looks good to me.

xf = L
yf = (-qE/2m)(L/Vi)^2
Vfx = Vi
Vfy = -(qE/m)*(L/Vi)

so that's after the first stage...

what do you get after the second stage...

the curve should be smooth... you have an abrupt change... instead the trajectory is a smooth curve that goes downwards reaches a minimum then goes back upwards.

3. ### mitleid

56

There we go.

Since it enters and exits at the same height, and the distance along each plate is the same (L), $$\Delta$$y MUST be the same for each side, but opposite polarity. It could go up and then down (and have a negative y component velocity), or down and then up, which applies here.

Hence |V1| = |V2|.

Additionally, Va - Vb = E*h, where Va is the voltage on the top plate, and Vb is the bottom. Vb = 0 since it is grounded, so V1 = E * h

Solving for E from the above equation for Vfy :

E1 = - Vfy (m/q) (Vi/2L)

I multiply this by h to get V1, which is equal in magnitude to V2.

However... the direction of E is different for each plate. Do I need to solve for each field...? I would have to start making up variables for the state of the particle @ distance L, to get the initial velocity for the motion through the second plates. Maybe I should just keep my first answer...

4. ### learningphysics

4,124
I don't think |V1| equals |V2| ...

continue to solve through kinemtics as you were doing... call the field in the first stage E1... the field in the second stage E2... you can get the voltages afterwards using V = Eh...

the object enters the second field at an angle downwards... keeps going down as it enters the second field... gets to some minimum value and goes back up.

but all that doesn't matter... just let the equations take care of that...

Last edited: Nov 1, 2007
5. ### mitleid

56
So more like this...

All right. So I will separate into initial stage, stage 1 (after traveling distance L) and stage 2 (after traveling distance 2L).

I need to know$$\Delta$$y at stage 1, but to get this I also need E1.

v1y = - (qE1/2m)(L/vi)

E1 = - v1y (2m/q)(vi/L)

v1x = vi

Hmm. i guess since this is a trajectory, when vy is a minimum it will be equal to zero. not sure if that helps me at this point though...

6. ### learningphysics

4,124
xf = L
yf = (-qE1/2m)(L/Vi)^2
Vfx = Vi
Vfy = -(qE1/m)*(L/Vi)

the above is after the first stage...

so now we have E2 in the second stage acting upward...

y = y0 + vy*t + (1/2)at^2

y = (-qE1/2m)(L/Vi)^2 - (qE1/m)*(L/Vi)*t + (1/2)qE2/m*t^2

measuring t from the moment it enters the second stage...

it reaches the end of the second stage at t = L/Vi... it has to get back to y=0.

plug in t = L/Vi and y = 0, into:

y = (-qE1/2m)(L/Vi)^2 -(qE1/m)*(L/Vi)*t + (1/2)qE2/m*t^2

that gives a relationship between E1 and E2. Solve for E2 in terms of E1.

finally use

v_ver = v0y + (qE2/m)*t

when it exits the second stage it has a vertical component Vy (I think this is what the question says... it exits with some "component" Vy... does that mean vertical component?)

so:

Vy = -(qE1/m)*(L/Vi) + (qE2/m)*(L/Vi)

plug in E2 in terms of E1... then solve for E1 (which will be in terms of L, Vi, Vy, and m)

Then you can get E2...

V1 = hE1. V2 = -hE2.


text:
# A geometry problem by Deepanshu Dhruw

Geometry Level pending

$\large a \sin^2x + b\cos^2 x = c\quad b\sin^2 y + a \cos^2 y = d \quad a \tan x = b \tan y$

Which of the following is equal to $$\dfrac {a^2}{b^2}$$?

×


text:
# Math Help - countability of the reals

1. ## countability of the reals

We know that the real numbers $\bold{R}$ are uncountable. But what if we partitioned the real numbers into a infinite but countable number of closed intervals. So we would have for example: $[0,1] \cup [1,2] \cup [2,3], \dots$. Do the same thing for the negative reals. Then the number of intervals are countable right?

2. $[0,1]$ contains all the reals between $0$ and $1$ inclusive. Similarly, $[1,2]$ contains all the reals between $1$ and $2$ inclusive etc...

3. Originally Posted by particlejohn
Then the number of intervals are countable right?
Right. But each of these intervals is uncountable.

4. Hello,
Originally Posted by particlejohn
We know that the real numbers $\bold{R}$ are uncountable. But what if we partitioned the real numbers into a infinite but countable number of intervals. So we would have for example: $[0,1] \cup [1,2] \cup [2,3], \dots$. Do the same thing for the negative reals. Then the number of intervals are countable right?
Hmm I'd say yes, because there's an interval corresponding to an integer. And $\mathbb{Z}$ is equipotent to $\mathbb{N}$, infinite and countable set.

Let $S=\{\dots \cup [-2,-1) \cup [-1,0) \cup [0,1) \cup \dots \}$

$S=\{A_i ~|~ \forall x \in A_i, ~i \le x < i+1 \}$ (actually i is the least integer contained in $A_i$)

Every element of S can be associated to an integer of $\mathbb{Z}$. Thus S is countable.

5. Originally Posted by particlejohn
We know that the real numbers $\bold{R}$ are uncountable. But what if we partitioned the real numbers into a infinite but countable number of closed intervals. So we would have for example: $[0,1] \cup [1,2] \cup [2,3], \dots$. Do the same thing for the negative reals. Then the number of intervals are countable right?
You cannot find a countable partition of $\mathbb{R}$ by countable sets.
If that is what you are asking.


text:
## Calculus 10th Edition

$$L=4$$ and $$\delta=0.03$$
1) From the definition of limit, the statement $$\lim_{x\to c}f(x)=L$$ means for each $\varepsilon\gt0$ there exists a $\delta\gt0$ such that if $$0\lt|x-c|\lt\delta$$ then $$|f(x)-L|\lt\varepsilon$$ 2) $$\lim_{x\to6}\Big(6-\frac{x}{3}\Big)$$ To find $L$, we plug $x=6$ into $f(x)$ $$\lim_{x\to6}\Big(6-\frac{x}{3}\Big)=6-\frac{6}{3}=6-2=4$$ So $L=4$. Next, the question asks to find $\delta\gt0$ such that if $|f(x)-L|\lt0.01$ whenever $0\lt|x-c|\lt\delta$. Here, $c=6$, $L=4$ and $f(x)=6-\frac{x}{3}$. Therefore, $$|x-c|=|x-6|$$ and $$|f(x)-L|=\Big|6-\frac{x}{3}-4\Big|=\Big|2-\frac{x}{3}\Big|=\Big|\frac{6-x}{3}\Big|=\frac{|x-6|}{3}$$ (For absolute values, $|A|=|-A|$) Since $|f(x)-L|\lt0.01$, that means $\frac{|x-6|}{3}\lt0.01$ Therefore as we need to find $\delta$ for $0\lt|x-6|\lt\delta$, we can pick $\delta=0.01\times3=0.03$. 3) Try $\delta=0.03$ back again For $0\lt|x-6|\lt0.03$, we have $$|f(x)-L|=\frac{|x-6|}{3}\lt\frac{0.03}{3}=0.01$$ So $\delta=0.03$ is a right choice.


text:
# How to derive inverse hyperbolic trigonometric functions

$e^{i\theta}=\cos\theta + i\sin \theta$

$e^{i\sin^{-1}x}=\cos(\sin^{-1}x)+i\sin(\sin^{-1}x)$

$i\sin^{-1}x=\ln|\sqrt{1-x^2} + ix|$

$\sin^{-1}x=-i\ln|\sqrt{1-x^2} + ix|$

Now from here I’m kind of lost, since it seems like this should be the definition, but when I look it up, the definition of inverse hyperbolic sine is:

$\sinh^{-1}x=\ln(\sqrt{1+x^2} + x)$

So although they’re very similar, I guess I just don’t know how to handle the logarithm and anything to the ith power or drop off the absolute value.

#### Solutions Collecting From Web of "How to derive inverse hyperbolic trigonometric functions"

The standard way to derive the formula for $\sinh^{-1}x$ goes like this:

Put $y = \sinh^{-1}x$ so that $x = \sinh y = \frac{e^y – e^{-y}}{2}$.

Rearrange this to get $2x = e^y – e^{-y}$, and hence $e^{2y} -2xe^y-1=0$, which is a quadratic equation in $e^y$. You then solve the quadratic and take logs (and take care with the $\pm$ sign you get with the roots of the quadratic).

Let $x=\sinh t=\frac{e^t-e^{-t}}2,$ so $t=\sinh^{-1}x$
and $1+x^2=1+\left(\frac{e^t-e^{-t}}2\right)^2=\left(\frac{e^t+e^{-t}}2\right)^2$

As $e^t+e^{-t}=(e^{\frac t2}-e^{-\frac t2})^2+2\ge 2$ for real $t$ and $1+x^2\ge 1$ for real $x,$ $\sqrt{1+x^2}=\frac{e^t+e^{-t}}2$

So, $\sqrt{1+x^2}+x=\frac{e^t+e^{-t}}2+\frac{e^t-e^{-t}}2=e^t$

So, $t=\ln|\sqrt{1+x^2}+x|$

Use the identity $\sin x = -i\sinh x$. Then your formula gives $\sinh x =\ ln| \sqrt {x^2+1}+x|$ and rerestricting hyperbolic sine to the reals and thus its inverse to positive reals you lose the absolute value. Your method is very nice.

Use the rule
$$\bigl(f^{-1}\bigr)'(y)={1\over f’\bigl(f^{-1}(y)\bigr)}\ .$$
This gives
$${\rm arsinh}'(y)={1\over\cosh\bigl({\rm arsinh}(y)\bigr)}={1\over\sqrt{y^2+1}}\ \qquad(-\infty<y<\infty)$$
and
$${\rm arcosh}'(y)={1\over\sinh\bigl({\rm arcosh}(y)\bigr)}={1\over\sqrt{y^2-1}}\ \qquad(1< y<\infty)$$


text:
# Allegro Startout

This topic is 2848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello. This is my first try with allegro, im willing to make a simple 1 dimension tile map in the screen based on a .txt file. This is the code i have so far:
#include <stdio.h>
#include <stdlib.h>
#include <allegro.h>

END_OF_FUNCTION(desenhamapa);

volatile long speed_counter = 0;

void increment_speed_counter()
{
speed_counter++;
}
END_OF_FUNCTION(increment_speed_counter);

int main(int argc, char *argv[])
{

allegro_init();
install_keyboard();

install_timer();

LOCK_VARIABLE(speed_counter);
LOCK_FUNCTION(increment_speed_counter);

install_int_ex(increment_speed_counter, BPS_TO_TIMER(60));

set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT, 640,480,0,0);

BITMAP *my_pic, *tile, *tile2;

BITMAP *buffer;

buffer = create_bitmap(640,480);

char mapa[10];
int xm = 0;
FILE *arq;
arq = fopen("data.txt", "r");
char c;
int tilex, tiley;
tilex = 50; tiley = 50;

while(!feof(arq))
{
c = getc(arq);
mapa[xm] = c;
xm++;
}

while(xm >= 0)
{
if(mapa[xm] == '1')
draw_sprite(buffer, tile, tilex, tiley);
if(mapa[xm] == '2')
draw_sprite(buffer, tile2, tilex, tiley);
xm--;
tilex += 32;
}
blit(buffer, screen, 0,0,0,0,640,480);
clear_bitmap(buffer);
}

This is part of the code that shows how the simple mapping should be done. But it aint working. The tiles aint showing. The idea is to add the tile map into tha buffar to make it scrollable. This is my first tryout to make a simple map system. I know there are some already done , but i wish to make all by myself so thats how i can learn. Thanx for any help. []´s

##### Share on other sites
is this so noobish that no one doesnt even know ? i see more ppl using SDL then Allegro, wish to know why is that. Is SDÇ better then allegro ? I couldnt find any good tutorials for it that i could start out playng on it.


text:
# How do you solve and graph <mstyle displaystyle="true">

Davian Maynard 2022-05-23 Answered
How do you solve and graph $20b\ge -120$ ?
You can still ask an expert for help

• Live experts 24/7
• Questions are typically answered in as fast as 30 minutes
• Personalized clear answers

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Briana Grimes
Step 1
Divide each side of the inequality by $20$ to solve for b while keeping the inequality balanced:
$\frac{20b}{20}\ge -\frac{120}{20}$
$\frac{\overline{)20}b}{\overline{)20}}\ge -6$
$b\ge -6$
To graph this we will draw a vertical line at -6 on the horizontal axis.
The line will be a solid line because the inequality operator contains an "or equal to" clause.
###### Not exactly what you’re looking for?

• Live experts 24/7
• Questions are typically answered in as fast as 30 minutes
• Personalized clear answers

Solve your problem for the price of one coffee


text:
# sklearn.multioutput.MultiOutputClassifier¶

class sklearn.multioutput.MultiOutputClassifier(estimator, n_jobs=None)[source]

Multi target classification

This strategy consists of fitting one classifier per target. This is a simple strategy for extending classifiers that do not natively support multi-target classification

Parameters
estimatorestimator object

An estimator object implementing fit, score and predict_proba.

n_jobsint or None, optional (default=None)

The number of jobs to use for the computation. It does each target variable in y in parallel. None means 1 unless in a joblib.parallel_backend context. -1 means using all processors. See Glossary for more details.

Attributes
estimators_list of n_output estimators

Estimators used for predictions.

Examples

>>> import numpy as np
>>> from sklearn.datasets import make_multilabel_classification
>>> from sklearn.multioutput import MultiOutputClassifier
>>> from sklearn.neighbors import KNeighborsClassifier

>>> X, y = make_multilabel_classification(n_classes=3, random_state=0)
>>> clf = MultiOutputClassifier(KNeighborsClassifier()).fit(X, y)
>>> clf.predict(X[-2:])
array([[1, 1, 0], [1, 1, 1]])

Methods

 fit(self, X, Y[, sample_weight]) Fit the model to data matrix X and targets Y. get_params(self[, deep]) Get parameters for this estimator. partial_fit(self, X, y[, classes, sample_weight]) Incrementally fit the model to data. predict(self, X) Predict multi-output variable using a model score(self, X, y) Returns the mean accuracy on the given test data and labels. set_params(self, \*\*params) Set the parameters of this estimator.
__init__(self, estimator, n_jobs=None)[source]

Initialize self. See help(type(self)) for accurate signature.

fit(self, X, Y, sample_weight=None)[source]

Fit the model to data matrix X and targets Y.

Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)

The input data.

Yarray-like of shape (n_samples, n_classes)

The target values.

sample_weightarray-like of shape (n_samples,) or None

Sample weights. If None, then samples are equally weighted. Only supported if the underlying classifier supports sample weights.

Returns
selfobject
get_params(self, deep=True)[source]

Get parameters for this estimator.

Parameters
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns
paramsmapping of string to any

Parameter names mapped to their values.

partial_fit(self, X, y, classes=None, sample_weight=None)[source]

Incrementally fit the model to data. Fit a separate model for each output variable.

Parameters
X(sparse) array-like, shape (n_samples, n_features)

Data.

y(sparse) array-like, shape (n_samples, n_outputs)

Multi-output targets.

classeslist of numpy arrays, shape (n_outputs)

Each array is unique classes for one output in str/int Can be obtained by via [np.unique(y[:, i]) for i in range(y.shape[1])], where y is the target matrix of the entire dataset. This argument is required for the first call to partial_fit and can be omitted in the subsequent calls. Note that y doesn’t need to contain all labels in classes.

sample_weightarray-like of shape (n_samples,), default=None

Sample weights. If None, then samples are equally weighted. Only supported if the underlying regressor supports sample weights.

Returns
selfobject
predict(self, X)[source]
Predict multi-output variable using a model

trained for each target variable.

Parameters
X(sparse) array-like, shape (n_samples, n_features)

Data.

Returns
y(sparse) array-like, shape (n_samples, n_outputs)

Multi-output targets predicted across multiple predictors. Note: Separate models are generated for each predictor.

property predict_proba

Probability estimates. Returns prediction probabilities for each class of each output.

This method will raise a ValueError if any of the estimators do not have predict_proba.

Parameters
Xarray-like, shape (n_samples, n_features)

Data

Returns
parray of shape (n_samples, n_classes), or a list of n_outputs such arrays if n_outputs > 1.

The class probabilities of the input samples. The order of the classes corresponds to that in the attribute classes_.

score(self, X, y)[source]

Returns the mean accuracy on the given test data and labels.

Parameters
Xarray-like, shape [n_samples, n_features]

Test samples

yarray-like, shape [n_samples, n_outputs]

True values for X

Returns
scoresfloat

accuracy_score of self.predict(X) versus y

set_params(self, **params)[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters
**paramsdict

Estimator parameters.

Returns
selfobject

Estimator instance.


text:
### Home > PC3 > Chapter 6 > Lesson 6.1.2 > Problem6-34

6-34.

Solve for $c{:} \ c^4−11c^2−80=0$

$5 · 16 = 80$

Factor and use the Zero Product Property.


text:
# What does $\int_f f(z, \bar{z}) \sqrt{dz d\bar{z}}$ mean?

Just a quick question, I am going through some books on complex analysis and I'm wondering what an integral like $\int_f f(z,\bar{z}) \sqrt{dz d\bar{z}}$ means. How is one supposed to take that notation to mean something?? I have not come across things that have roots over the $dz's$ and $d\bar{z}'s$. Besides, the integral here is a single integral, but there are two variables involved?

I am assuming I can do that as perhaps I can parametrise $f$ in terms of some parameter $t$.

Thanks

-
"going through some books on complex analysis" - which books? They ought to have explained their notation somewhere... –  Guess who it is. May 7 '11 at 8:38
It looks like a plain-old contour integral to me, in awkward terminology. Could you supply a concrete example of a computation? –  Ryan Budney May 10 '11 at 22:28
@Hi just some corrections to the comment above. The first error should read $d_\mathbb{H} (z_1,z_2) = \int_\gamma \frac{2i}{z - \bar{z}} \sqrt{dz d\bar{z}}$ –  user38268 May 13 '11 at 23:42
What I meant to say was, "It is not that I do not know how to evaluate integrals, but the notation seems confusing and I don't get how one can evaluate some integral like this directly. Also, $\gamma$ is the semi circle passing through $z_1$ and $z_2$ whose center lies on the real - axis. –  user38268 May 13 '11 at 23:43

This is somewhat of a guess... hopefully you can find the definition somewhere in the text. But I think that this notation means you are integrating with respect to path length. Write out the differentials in terms of real and imaginary parts, and $\sqrt{dz ~ d\bar{z}}$ becomes $\sqrt{dx^2 + dy^2}$. So if you plug $f(z,\bar{z}) = 1$ into your expression, this integral will give you the length of that path.
To make it totally concrete, if you parametrize your path with respect to some parameter $t$, then the differential becomes $\sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2}~dt$


text:
# How to hide an element of an iframe that is loaded on some page (parent page) (CSS, JQuery)

Sometimes you want to load the Iframe on the page but don’t want to display all items.

## Hiding elements with CSS

In order to avoid pronlems with hiding that item. It would be great of you can assign it and id for example: #po-navbar.

#po-navbar { display: none; }

in WordPress you can do that just for some page
.page-template-lostpassword #po-navbar { display: none; }

In order to find that class you can just check the body tag of that page:

## Hiding elements with JQuery

$('#po-navbar').hide(); here is another option $('iframe').contents().find("#your_div_id").hide();

NOTE: this one didn’t work in my case (for some reason) although I was loading the Iframe from the same domain.


text:
Journal article Embargoed Access

# A Deep Generic to Specific Recognition Model for Group Membership Analysis using Non-verbal Cues

Mou, Wenxuan; Tzelepis, Christos; Mezaris, Vasileios; Gunes, Hatice; Patras, Ioannis

### DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<identifier identifierType="URL">https://zenodo.org/record/1464113</identifier>
<creators>
<creator>
<creatorName>Mou, Wenxuan</creatorName>
<givenName>Wenxuan</givenName>
<familyName>Mou</familyName>
<affiliation>Queen Mary University of London, UK</affiliation>
</creator>
<creator>
<creatorName>Tzelepis, Christos</creatorName>
<givenName>Christos</givenName>
<familyName>Tzelepis</familyName>
<affiliation>Information Technologies Institute/Centre for Research and Technology Hellas (CERTH), Greece</affiliation>
</creator>
<creator>
<creatorName>Mezaris, Vasileios</creatorName>
<givenName>Vasileios</givenName>
<familyName>Mezaris</familyName>
<affiliation>Information Technologies Institute/Centre for Research and Technology Hellas (CERTH), Greece</affiliation>
</creator>
<creator>
<creatorName>Gunes, Hatice</creatorName>
<givenName>Hatice</givenName>
<familyName>Gunes</familyName>
<affiliation>University of Cambridge, UK</affiliation>
</creator>
<creator>
<creatorName>Patras, Ioannis</creatorName>
<givenName>Ioannis</givenName>
<familyName>Patras</familyName>
<affiliation>Queen Mary University of London, UK</affiliation>
</creator>
</creators>
<titles>
<title>A Deep Generic to Specific Recognition Model for Group Membership Analysis using Non-verbal Cues</title>
</titles>
<publisher>Zenodo</publisher>
<publicationYear>2018</publicationYear>
<subjects>
<subject>Non-verbal behavior analysis, Group membership, Automatic group analysis, Deep learning</subject>
</subjects>
<dates>
<date dateType="Available">2019-10-03</date>
<date dateType="Accepted">2018-10-03</date>
</dates>
<resourceType resourceTypeGeneral="Text">Journal article</resourceType>
<alternateIdentifiers>
<alternateIdentifier alternateIdentifierType="url">https://zenodo.org/record/1464113</alternateIdentifier>
</alternateIdentifiers>
<relatedIdentifiers>
<relatedIdentifier relatedIdentifierType="DOI" relationType="IsIdenticalTo">10.1016/j.imavis.2018.09.005</relatedIdentifier>
<relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf">https://zenodo.org/communities/moving-h2020</relatedIdentifier>
</relatedIdentifiers>
<rightsList>
<rights rightsURI="info:eu-repo/semantics/embargoedAccess">Embargoed Access</rights>
</rightsList>
<descriptions>
<description descriptionType="Abstract">
Automatic understanding and analysis of groups has attracted increasing attention in the vision and multimedia communities in recent years. However, little attention has been paid to the automatic analysis of the non-verbal behaviors and how this can be utilized for analysis of group membership, i.e., recognizing which group each individual is part of. This paper presents a novel Support Vector Machine (SVM) based Deep Specific Recognition Model (DeepSRM) that is learned based on a generic recognition model. The generic recognition model refers to the model trained with data across different conditions, i.e., when people are watching movies of different types. Although the generic recognition model can provide a baseline for the recognition model trained for each specific condition, the different behaviors people exhibit in different conditions limit the recognition performance of the generic model. Therefore, the specific recognition model is proposed for each condition separately and built on top of the generic recognition model. A number of experiments are conducted using a database aiming to study group analysis while each group (i.e., four participants together) were watching a number of long movie segments. Our experimental results show that the proposed deep specific recognition model (44%) outperforms the generic recognition model (26%). The recognition of group membership also indicates that the non-verbal behaviors of individuals within a group share commonalities.
</description>
</descriptions>
<fundingReferences>
<fundingReference>
<funderName>European Commission</funderName>
<funderIdentifier funderIdentifierType="Crossref Funder ID">10.13039/501100000780</funderIdentifier>
<awardNumber awardURI="info:eu-repo/grantAgreement/EC/H2020/693092/">693092</awardNumber>
<awardTitle>Training towards a society of data-savvy information professionals to enable open leadership innovation</awardTitle>
</fundingReference>
</fundingReferences>
</resource>

33
3
views