text:
Vannaka

34,802pages on
this wiki
 Release date (Update) 146 (formerly) Human No Beneath Cursed Tides Edgeville Dungeon, Tutorial Island (formerly) Slayer Equipment Male • He looks dangerous! • An expert on all forms of combat. • He doesn't look so dangerous any more.

Vannaka (formerly called the combat instructor on Tutorial Island) is a medium-level Slayer master in RuneScape. Vannaka is also one of the NPCs associated with the Varrock Tasks. According to Duradel, another Slayer Master, Vannaka was once a student of his, and does not wish to challenge him due to his master's great skill.

He instructed new players in fighting with a shortsword/wooden shield and a bow back when Tutorial Island was not sunken yet.

Vannaka can be found in Edgeville Dungeon southeast of the wilderness entrance at the slayer master icon . He gives Slayer assignments to members with a combat level of 40 or higher. He is now one of the few Slayer Masters with no Quest requirements, along with Turael and Mazchna.

After completion of the Varrock Tasks, he can change players' Varrock Teleport location between Varrock Square, the south entrance to the Grand Exchange, or to the north Varrock Altar. However, he can only do this in person and not via the NPC Contact spell. To change locations, "Talk to" Vannaka, select "About the Task System", then select "I'd like to change my teleport point."

HistoryEdit

Early lifeEdit

Vannaka excelled in combat and Slayer. He is a devout Saradominist, highly regarded by Saradomin himself, and previously served in Saradomin's army of warriors. He trained under Duradel, a powerful Slayer Master, who was once the best among them all, before being surpassed by his daughter, Kuradal, and later, also by her daughter's elven student, Morvran. Vannaka once challenged his former mentor to a duel to determine the best Slayer Master, and fought bravely but was eventually defeated at his hands; following the shame from this incident, he engaged in self-imposed exile. He became a Combat Instructor on Tutorial Island, a former school for adventurers, until year 169 of the Fifth Age. Since then, he has served as a mid-level Slayer Master, based in Edgeville Dungeon.

Rescuing the cursed on Tutorial IslandEdit

Main article: Beneath Cursed Tides

The player asks him to join them on their mission to find out what happened to Tutorial Island. When the player returns to Wizard Myrtle, they see that Vannaka and Myrtle are flirting. Myrtle instructs the player to go to Mudskipper Point. After arriving there the player again sees them flirting. The player and Vannaka both go down to the sunken island. Vannaka returns to the cave he used to tutor in to search for his friend Dezzick and the player goes off to search for the other instructors. Later on the player also goes to Vannaka's cave and he teaches them how to wield a two-handed sword underwater. The player then continues to search for the other tutors. Vannaka returns during the final fight when it appears that he was captured by the evil wizard, Hector Vivian. The player aids Myrtle in freeing Vannaka and beating the Vivian. The tutors, Myrtle and the player then reunite at Mudskipper Point and everyone goes their own way after rewarding the player.

Slayer pointsEdit

After the Smoking Kills quest, players can receive Slayer reward points for completing slayer tasks, based on how many tasks players have accomplished in a row. Completion of a task assigned by Vannaka will grant you:

• 4 slayer points per normal task
• 20 for every 10th
• 60 for every 50th

This means that if using Vannaka over the long term, an average of 6.4 points will be granted per task.

AssignmentsEdit

Monster

Number Combat Level Slayer Experience Slayer Level Required Weakness Weighting
Aberrant spectre 60 - 120 72, 78 (Pollnivneach Slayer Dungeon) 109, 123 60 Thrown (Slayer tower)
Arrows (Pollnivneach Slayer Dungeon)
25
Ankou 60 - 120 60, 61, 63 68,70,72 1 Earth spells 10
Banshee 60 - 120 37, 91 (Mighty) 22, 85 15 Arrows 15
Basilisk 60 - 120 70, 77 75 40 Air spells 10
Bloodveld 60 - 120 61, 68, 92 (Godwars dungeon), 91 & 95 (mutated) 38.6, 88.4, 197, 216, 239.6 50 Thrown
Water spells
Fire spells
20
Brine rat 60 - 120 49 50 47 Fire spells 20
Cockatrice 60 - 120 44 37 25 Crush 10
Crocodile 30 - 60 40 34.6 1 Air spells 10
Cyclops 60 - 120 57, 63, 68, 91 75, 100 1 Melee 10
Dust devil 60 - 120 85 105 65 Crush 25
Earth warrior 30 - 60 78 54 1 Water spells 15
Ghoul 60 - 120 64 50 1 Fire spells 10
Green dragon 30 - 60 63, 105 (Brutal) 175, 440 1 Arrows 10
Grotworm 60 - 120 28 (young), 63 (regular), 98 (mature) 12, 107.8, 343.5 1 Bolts 15
Harpie bug swarm 60 - 120 63 25 33 Crush 20
Hill giant 60 - 120 44 39 1 Air spells 10
Ice giant 60 - 120 51 70 1 Fire spells 10
Ice warrior 60 - 120 54 59 1 Fire spells 10
Infernal mage 60 - 120 72 60 45 Arrows 10
Jelly 60 - 120 63, 68 75 52 Crush 20
Jungle horror 60 - 120 67 50 1 Water spells 10
Killerwatt 60 - 120 61 51 37 Crush 20
Lesser demon 60 - 120 70, 84 (Revenant) 90.5, 80 1 Bolts 10
Mogre 60 - 120 54 48 32 Air spells 10
Molanisk 60 - 120 53 52 39 Crush 10
Moss giant 60 - 120 28, 51, 61 60,85,120 1 Slash 10
Ogre 60 - 120 56, 67, 86 60 1 Air spells 10
Otherworldly being 60 - 120 63 66 1 Thrown 10
Pyrefiend 60 - 120 61, 67, 92 45 30 Bolts 10
Sea snake 30 - 60 90 50 1 Slash 10
Shade 60 - 120 58, 60, 60, 90, 61, 65, 70, 98, 120 38, 56, 74, 32.5, 90, 110 1 Arrows
Fire spells
10
Shadow warrior 60 - 120 65 67 1 Air spells 10
Troll 60-120 1 Melee
Turoth 60 - 120 64, 66, 68, 69, 71, 138 (Mighty) 76, 77, 79, 80, 81, ? 55 Stab 20
Vampyre (monster) 60 - 120 61, 89 (God Wars Dungeon) 40,50,60 1 Fire spells 15
Werewolf 60 - 120 63, 89 (God Wars Dungeon) 90,100 1 Water spells 10

Slayer challenge Edit

Vannaka will occasionally (or randomly) offer a special task in place of a regular slayer task. The player can decline to take the special task without penalty. If the player accepts the special task, completing the task:

• Earns 4000 extra slayer experience.
• Earns 14 Slayer reward points, if the player has completed the Smoking Kills quest.
• Counts as a task for the player's consecutive task count, which is used for slayer reward points.

Vannaka's special task is for the player to bring him one scale from each of the four types of chromatic dragons:

Both adult and baby chromatic dragons can drop perfect scales, which are only found while on this special task. It seems that you now always get the scale on the first kill of each type of dragon, and no further will drop when you already have one. Previously, multiple scales of the same type of dragon could be obtained, but extras were destroyed when the task was complete. It may still be possible to obtain multiple scales by killing several dragons before picking up the drops. Note that the challenge is only complete when the scales are given to Vannaka; simply collecting all four scales does not finish the task.

The percentage chance of getting assigned a given slayer task can be calculated using the formula

$\frac{w}{S} \times 100%$

where $w$ is the task's weight and $S$ is the sum of all weights for the particular slayer master. Note that the weights of all blocked tasks, as well as tasks toggled off have to be subtracted from the sum $S$. Preferring a task doubles its chance of being assigned.

TriviaEdit

• His Strength level (112) was revealed in Postbag from the Hedge 14. The Evolution of Combat's combat level system would make him at least level 174.
• Postbag from the Hedge 20 revealed that Vannaka was Duradel's student and had lost while attempting to challenge his master.
• In issue 27 of the God Letters, it is revealed that at one point, before he went into exile on tutorial island, Vannaka was a follower of Saradomin. Saradomin states:
It is somewhat of a pity that his glory days are behind him, and his self-imposed exile to tutorial island is in place, for I would deeply desire to see him overcome his shame for his past actions, and take up his place at the vanguard of my holy warriors once again.
It could be that the 'shame' Saradomin speaks of was Vannaka's defeat at the hands of Duradel. Vannaka appears to have been in the army of Saradomin at one point, since Saradomin states he wishes Vannaka to take up his place with Saradomin's holy warriors once more. What made him leave that service, if anything, is as of yet unknown.
• Vannaka is most well known because of his ability to wield a steel 2h sword, and a dragon sq shield at the same time. This issue was addressed by a player to Saradomin, who replied:
The fearsome Vannaka is one of the strongest warriors to ever grace this world, and as such he has the power to wield what would normally be considered to be a two handed sword single-handedly. This is a strength that most mortals do not possess, and it adds to his fearsome reputation as a great swordsman. It is somewhat of a pity that his glory days are behind him, and his self-imposed exile to tutorial island is in place, for I would deeply desire to see him overcome his shame for his past actions, and take up his place at the vanguard of my holy warriors once again. Perhaps the best we may see of him is his current role as Slayer Master and Combat Instructor, although I suspect his thirst for adventure may bring him back for one last battle, so that he may end his days in glory..." This indicates that Vannaka is a follower of the God of Order. Saradomin also responds, to the player's query of the kind of shield Vannaka wields, "The shield Vannaka wields is the mighty Square Shield of the Dragon, an ancient and powerful artefact possessed only by a few members of this world lucky enough to have found one. He has earnt the right to wield it many times over, and it is something of a trophy for him of past glories.
Vannaka offers a cosmetic override which gives the appearance of wielding his 2h sword as a 1h weapon as a quest reward for completing Beneath Cursed Tides.
• It is assumed that Vannaka is a member of Legends' Guild, because he can wield the dragon square shield.
• Vannaka has not received a graphical update for his dragon square shield.
• He has a gravestone in the New Varrock graveyard which reads "Vannaka. Valiantly killed a thousand zombies. Died while checking his enchanted gem to see if his assignment was complete."


text: Soc. Numer. graph learning tasks with limited number of labeled nodes. Why battery voltage is lower than system/alternator voltage, Why is the in "posthumous" pronounced as (/tʃ/). nodes using line graphs at each level in the vine. License Agreements, Terms of Use, Privacy Policy. Combinatorics, Graph Theory, Computing, Congr. R. W. Robinson, Enumeration of non-separable graphs, J. Combin. Addison-Wesley, Reading, MA, 1969, p. 214. Steven R. Finch, Mathematical Constants II, Encyclopedia of Mathematics and Its Applications, Cambridge University Press, Cambridge, 2018. Suppose the graphs Gn and Hn have the same number of nodes. [Annotated scanned copy]. Stack Overflow for Teams is a private, secure spot for you and You should decide first if you want to count labelled or unlabelled objects. (Formerly M1253 N0479) 206 1, 1, 2, 4, 11, 34, 156, 1044, 12346, 274668, 12005168, ... where a(n, t) is the number of t-uniform hypergraphs on n unlabeled nodes (cf. => 3. How can I pair socks from a pile efficiently? The reason for this is simple, in BST also we can make any key as root, If root is i’th key in sorted order, then i-1 keys can go on one side and (n-i) keys can go on other side. Can a law enforcement officer temporarily 'grant' his authority to another? R. C. Read and R. J. Wilson, An Atlas of Graphs, Oxford, 1998. Let G(N,p) be an Erdos-Renyi graph, where N is the number of vertices, and p is the probability that two distinct vertices form an edge. Since we make a choice for each edge whether to include it or not, the maximum number of graphs is given by 2 ^ (n ^ 2). A. Itzhakov, M. Codish, Breaking Symmetries in Graph Search with Canonizing Sets, arXiv preprint arXiv:1511.08205 [cs.AI], 2015-2016. 7 (2004), Article 04.3.2. Following Steven Schmatz’s example, I looked at the OEIS entry. Richard Hua, Michael J. Dinneen, Improved QUBO Formulation of the Graph Isomorphism Problem, SN Computer Science (2020) Vol. b[n_, i_, l_] := If[n==0 || i==1, 1/n! / (n+1)!n! Introducing Graph Cumulants: What is the Variance of Your Social Network? The number of unlabeled n-vertex caterpillars is − + ⌊ (−) / ⌋. How many undirected graphs are there on 3 vertices? hench total number of graphs are 2 raised to power 6 so total 64 graphs. We will illustrate two different algorithms for computing the occurrence probability of induced motifs. P. J. Cameron, Some sequences of integers, Discrete Math., 75 (1989), 89-102. Why did Michael wait 21 days to come to help the angel that was sent to Daniel? The reason for this is simple, in BST also we can make any key as root, If root is i’th key in sorted order, then i-1 keys can go on one side and (n-i) keys can go on other side. You count 3, but you're accidentally counting nodes rather than graphs. Sequence in context: A178944 A076320 A076321 * A071794 A234006 A285002, Adjacent sequences:  A000085 A000086 A000087 * A000089 A000090 A000091, Harary gives an incorrect value for a(8); compare A007149, The On-Line Encyclopedia of Integer Sequences, Digenes: genetic algorithms to discover conjectures about directed and undirected graphs, A new formula for the generating function of the numbers of simple graphs, Single-qubit unitary gates by graph scattering, House of Graphs: a database of interesting graphs, On the computer calculation of the number of nonseparable graphs, Sequences realized by oligomorphic permutation groups, The number of equivalence patterns of symmetric sign patterns, The number of structures of finite relations, Notes for Math 422: Enumeration and Ramsey Theory, Characterizations of quadratic, cubic, and quartic residue matrices, Non-binary treebased unrooted phylogenetic networks and their relations to binary and rooted ones. Newcastle, Australia, 1976. How do I check if an array includes a value in JavaScript? (No. Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 430. The GCN was then able to learn representations for the unlabeled nodes from these initial seed nodes. Data structures that represent static unlabeled trees and planar graphs are developed. Math. Eric Weisstein's World of Mathematics, Simple Graph, Eric Weisstein's World of Mathematics, Connected Graph, Eric Weisstein's World of Mathematics, Degree Sequence, E. M. Wright, The number of graphs on many unlabelled nodes, Mathematische Annalen, December 1969, Volume 183, Issue 4, 250-253. R. W. Robinson, Numerical implementation of graph counting algorithms, AGRC Grant, Math. For example The House of Graphs; Small Graph Database; References of a small number of nodes in a single class. There's 3 edges, and each edge can be there or not. In this paper we present an analytical model to compute the expected number of occurrences of induced motifs in unlabeled graphs. Gi-Sang Cheon, Jinha Kim, Minki Kim, Sergey Kitaev, On k-11-representable graphs, arXiv:1803.01055 [math.CO], 2018. … - Vladeta Jovovic and Benoit Cloitre, Feb 01 2003, a(n) = 2^binomial(n, 2)/n! Proof. By unbiased, we mean that for a fixed value of z , any two graphs of the same size (size = number of leaves in the split tree = number of vertices in the graph… Join Stack Overflow to learn, share knowledge, and build your career. +add(igcd(p[k], p[j]), k=1..j-1), j=1..nops(p)))([l[], 1$n])), add(b(n-i*j, i-1, [l[], i$j])/j!/i^j, j=0..n/i)), seq(a(n), n=0..20);  # Alois P. Heinz, Aug 14 2019, Table[NumberOfGraphs[n], {n, 0, 19}] (* Geoffrey Critzer, Mar 12 2011 *). Akad. The trivial graph with one node and no edges is generated like this: g = nx.Graph() g.add_node(1) but networkx has the function trivial_graph which does something similar. A. Sloane, Nov 11 2013, For asymptotics see also Lupanov 1959, 1960, also Turner and Kautz, p. 18. if there are 4 vertices then maximum edges can be 4C2 I.e. Theory 9 (1970), 327-356. I think it would have been helpful to point out, we can have a maximum of \$N \choose 2 = \frac{N!}{(N-2)!2! A000055 - OEIS Not everybody’s comfortable with generating functions, but we can perhaps turn it into a recurrence. Acta, 78 (2005), 563-567. MR0268074 (42 #2973). P. Hegarty, On the notion of balance in social network analysis, arXiv preprint arXiv:1212.4303 [cs.SI], 2012. J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 519. For the directed graph case, wouldn't the number of graphs be given by the equation 2 ^ (n ^ 2) by the same logic as that of the undirected graph case (assuming self-loops are allowed)? By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. For Directed graph we will have more cases to consider, I am trying below to find the number of graphs if we could have Directed graph (Note that below is for the case where we do not have more than 1 edge between 2 nodes, in case we have more than 1 edge between 2 nodes then answer will differ). 671-684 of Proc. of distinct binary trees possible with n unlabeled nodes? On the notion of balance in social network analysis, Improved QUBO Formulation of the Graph Isomorphism Problem, Breaking Symmetries in Graph Search with Canonizing Sets, Extending the Characteristic Polynomial for Characterization of C_20 Fullerene Congeners, Formulae for the number T(n,k) of n-multigraphs on k nodes, The space of framed chord diagrams as a Hopf module, Cheating Because They Can: Social Networks and Norm Violators, On asymptotic estimates of the number of graphs and networks with n edges, Calculation of numbers of structures of relations on finite sets, Kombinatorische Anzahlbestimmungen in Relationen, Counting disconnected structures: chemical trees, fullerenes, I-graphs and others. # To produce all graphs on 4 nodes, for example: L:=[NonIsomorphicGraphs](4, output=graphs, outputform=adjacency): # N. J. In graph theory, a planar graph is a graph that can be embedded in the plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints.In other words, it can be drawn in such a way that no edges cross each other. (c) A complete binary tree with n internal nodes has (n + 1) leaves. - Leonid Bedratyuk, May 02 2015, 2^(-3*n + 6)*n$4*(4*n^2/3 - 34*n/3 + 25) +, 2^(-4*n + 10)*n$5*(8*n^3/3 - 142*n^2/3 + 2528*n/9 - 24914/45) +, 2^(-5*n + 15)*n$6*(128*n^4/15 - 2296*n^3/9 + 25604*n^2/9 - 630554*n/45 + 25704) +. Ed. The columns are: 1: n: number of nodes 2: np: number of partitions p(n) of n 3: ng: number g(n) of unlabelled graphs on n nodes 5: nc: number c(n) of connected unlabelled graphs on n nodes 7: log(1-fc): log(1-c(n)/g(n)). P. J. Cameron and C. R. Johnson, The number of equivalence patterns of symmetric sign patterns, Discr. Math. This is a Boltzmann sampler for cycle-pointed three-leaf power graphs, hence an unbiased sampler for three-leaf power graphs. 405-469. rev 2021.1.8.38287, Stack Overflow works best with JavaScript enabled, Where developers & technologists share private knowledge with coworkers, Programming & related technical career opportunities, Recruit tech talent & build your employer brand, Reach developers & technologists worldwide. What's the difference between 'war' and 'wars'? Second Caribbean Conference Combinatorics and Computing (Bridgetown, 1977). How to generate all permutations of a list? B. Asymptotic estimates of the number of graphs with n edges. What happens to a Chain lighting with invalid primary target and valid secondary targets? The fraction connected tends to 1 { (n+1)! [Annotated scanned copy], Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Overview of the 17 Parts (For Volumes 1, 2, 3, 4 of this book see A000088, A008406, A000055, A000664, respectively. This is what I got for my first answer but it was counted wrong and I don't understand why. Graph with N vertices may have up to C(N,2) = (N choose 2) = N*(N-1)/2 edges (if loops aren't allowed). Scott Garrabrant and Igor Pak, Pattern Avoidance is Not P-Recursive, preprint, 2015. Solution $\\frac{(2n)!} An undirected graph contains 3 vertices. To overcome these limitations, this paper presents a novel long-short distance aggrega-tion networks (LSDAN) for positive unlabeled (PU) graph learning. 2^(-6*n + 21)*n$7*(2048*n^5/45 - 18416*n^4/9 + 329288*n^3/9 - 131680816*n^2/405 + 193822388*n/135 - 7143499196/2835) + ...). Making statements based on opinion; back them up with references or personal experience. R. L. Davis, The number of structures of finite relations, Proc. Jan 08,2021 - Let X and Y be the integers representing the number of simple graphs possible with 3 labeled vertices and 3 unlabeled vertices respectively. University of the West Indies, Cave Hill Campus, Barbados, 1977. vii+223 pp. MR0109796 (22 #681). Why was there a "point of no return" in the Chernobyl series that ended in the meltdown? So overall number of possible graphs is 2^(N*(N-1)/2). 6 egdes. A. Milicevic and N. Trinajstic, Combinatorial Enumeration in Chemistry, Chem. If I knock down this building, how many other buildings do I knock down as well? 4th S-E Conf. site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. So 2^3=8 graphs. Natalie Arkus, Vinothan N. Manoharan, Michael P. Brenner. 1, No. permcount[v_] := Module[{m = 1, s = 0, k = 0, t}, For[i = 1, i <= Length[v], i++, t = v[[i]]; k = If[i > 1 && t == v[[i - 1]], k + 1, 1]; m *= t*k; s += t]; s!/m]; edges[v_] := Sum[GCD[v[[i]], v[[j]]], {i, 2, Length[v]}, {j, 1, i - 1}] + Total[Quotient[v, 2]]; a[n_] := Module[{s = 0}, Do[s += permcount[p]*2^edges[p], {p, IntegerPartitions[n]}]; s/n! Dan-Marian Joiţa, Lorentz Jäntschi, Extending the Characteristic Polynomial for Characterization of C_20 Fullerene Congeners, Mathematics (2017), 5(4), 84. Labeled Binary tree - A Binary Tree is labeled if every node is assigned a label Example: Unlabeled Binary Tree - A Binary Tree is unlabeled if nodes are not assigned any label. ), Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 1, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 2, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 3, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 4, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 5, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 6, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 7, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 8, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 9, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 10, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 11, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 12, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 13, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 14, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 15, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 16, Peter Steinbach, Field Guide to Simple Graphs, Volume 1, Part 17, J. M. Tangen and N. J. Math. => 3. This definition means that the null graph and singleton graph are considered connected, while empty graphs on n>=2 nodes are disconnected. Sum_g det(I-g z^2)/det(I-g z) and g runs through the natural matrix n X n representation of the pair group A^2_n (for A^2_n see F. Harary and E. M. Palmer, Graphical Enumeration, page 83). A. Sloane, Dec 04 2015. O. Neither method yields the number of regular vines on n nodes as a function of n. Section 4 characterizes regular vines as triangular arrays, and ﬂnds the number of regular vines on n nodes by extending a regular vine on n ¡ 1 nodes. Amer. gives the number of internal nodes in each binary tree is a class. = \frac{N\times (N-1)}{2}\$edges since, we need the number of ways we can choose 2 vertices out of the N available ones, to form a possible edge. Cf. Leonid Bedratyuk and Anna Bedratyuk, A new formula for the generating function of the numbers of simple graphs, Comptes rendus de l'Académie Bulgare des Sciences, Tome 69, No 3, 2016, p.259-268. As suggested in the comments, your question can be phrased as determining the number of unlabeled trees on n vertices. Let's assume that your graph is simple, that is: no loops or multiple edges. (See Table 1.). A. Sloane, Oct 07 2013, seq(GraphTheory[NonIsomorphicGraphs](n, output=count), n=1..10); # Juergen Will, Jan 02 2018, b:= proc(n, i, l) if(n=0 or i=1, 1/n! A graph that is not connected is said to be disconnected. }$ (Proof to be Added) What is the no. Soc. ]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jul 05 2018, after Andrew Howroyd *). R. C. Read and C. C. Cadogan. S. Hougardy, Classes of perfect graphs, Discr. (Russian) Dokl. a(n) = a(n, 2), where a(n, t) is the number of t-uniform hypergraphs on n unlabeled nodes (cf. One classical proof of the formula uses Kirchhoff's matrix tree theorem, a formula for the number of spanning trees in an arbitrary graph involving the determinant of a matrix. Mareike Fischer, Michelle Galla, Lina Herbst, Yangjing Long, Kristina Wicke, Non-binary treebased unrooted phylogenetic networks and their relations to binary and rooted ones, arXiv:1810.06853 [q-bio.PE], 2018. M. Petkovsek and T. Pisanski, Counting disconnected structures: chemical trees, fullerenes, I-graphs and others, Croatica Chem. We have to count the total number of trees we can have with n nodes. This is a much more difficult question. Let X - Y = N. Then, find the number of spanning trees possible with N labeled vertices complete graph.a)4b)8c)16d)32Correct answer is option 'C'. In summary, the contributions of the paper are listed below: We ﬁrst probe the existence of Layer Effect of GCNs on graphs with few labeled nodes, revealing that GCNs re-quires more layers to maintain the performance with low-er label rate. 3C2 is (3!)/((2!)*(3-2)!) A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). A. Sloane, Illustration of initial terms. If a graph is a complete graph with n vertices, then total number of spanning trees is n (n-2) where n is the number of nodes in the graph. 4 (1953), 486-495. F. Harary, Graph Theory. Prüfer sequences yield a bijective proof of Cayley's formula. Combin., Graph Theory, Computing, Congress. New command only for math mode: problem with \S. - Keith Briggs, Oct 24 2005, From David Pasino (davepasino(AT)yahoo.com), Jan 31 2009: (Start). [Annotated scanned copy]. N. J. We have to count the total number of trees we can have with n nodes. of structurally different binary trees possible with n nodes) Solution If the nodes are similar (unlabeled), then the no. Few models have been proposed to analytically derive the expected number of non-induced occurrences of a motif. Hence, we focus on learning graph structure from unlabeled data, in which the affected subset of nodes for each training example is not given, and we observe only the observed and expected counts at each node. Enumeration of unlabeled graph classes A study of tree decompositions and related approaches Jessica Shi ... number of graphs in a class and describing the structural properties of those graphs. (a) A tree with n nodes has (n – 1) edges (b) A labeled rooted binary tree can be uniquely constructed given its postorder and preorder traversal results. Also, number of equivalence classes of sign patterns of totally nonzero symmetric n X n matrices. graph is a node of degree one. For n > 0, a(n) is the number of ways to arrange n-1 unlabeled non-intersecting circles on a sphere. Vladeta Jovovic, Formulae for the number T(n,k) of n-multigraphs on k nodes. To see the list of donors, or make a donation, see the OEIS Foundation home page. The Dimension of Valid Distance Drawings of Signed Graphs, A survey of progress in graph theory in the Soviet Union, A Kochen-Specker system has at least 22 vectors, New Algorithms for Three Combinatorial Optimization Problems on Graphs, The number of graphs on many unlabelled nodes, The number of unlabelled graphs with many nodes and edges, Enumerating Unique Computational Graphs via an Iterative Graph Invariant. Keith M. Briggs, Combinatorial Graph Theory [Gives first 140 terms]. - Andrey Zabolotskiy, Aug 11 2020. By unbiased, we mean that for a fixed value of z , any two graphs of the same size (size = number of leaves in the split tree = number of vertices in the graph… G. Pfeiffer, Counting Transitive Relations, Journal of Integer Sequences, Vol. 12 1970 suppl. Easy interview question got harder: given numbers 1..100, find the missing number(s) given exactly k are missing, Ukkonen's suffix tree algorithm in plain English, Image Processing: Algorithm Improvement for 'Coca-Cola Can' Recognition, How to find time complexity of an algorithm. J. M. Larson, Cheating Because They Can: Social Networks and Norm Violators, 2014. There are 2^(1+2...+n-1)=2^(n(n-1)/2) such matrices, hence, the same number of undirected, simple graphs. How to visit vertices in undirected graph, The connected components in an undirected graph of a given amount of vertices (algorithm). How was the Candidate chosen for 1927, and why not sooner? No, because there's not 4 potential edges in a graph with 4 vertices. I edited my answer. The number of labeled n-vertex free trees is n n − 2 (Cayley's formula). / (n+1)!n! What does it mean when an aircraft is statically stable but dynamically unstable? Graph database. CiteSeerX - Document Details (Isaac Councill, Lee Giles, Pradeep Teregowda): Let g(n) denote the number of unlabeled graphs on n nodes, and let e(n) denote its 2-part, i.e., the exponent of the largest power of 2 which divides g(n). This is also "Number of tree perfect graphs on n nodes" [see Hougardy]. R. Absil and H. Mélot, Digenes: genetic algorithms to discover conjectures about directed and undirected graphs, arXiv preprint arXiv:1304.7993 [cs.DM], 2013. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 240. A. Sloane, Apr 08 2014, a(n) = G(1) where G(z) = (1/n!) Let g(n) denote the number of unlabeled graphs on n nodes, and let e(n) denote its 2-part, i.e., the exponent of the largest power of 2 which divides g(n). 14-22. Various research groups have provided searchable database that lists graphs with certain properties of a small sizes. of distinct binary trees possible with n labeled nodes? So for n=1 , Tree = 1 n=2 , Tree = 2 n=3, Tree = 5 n=4 , Tree = 14 Notice this differs significantly from the question of counting labeled trees (of which there are n^{n-2}) or labeled graphs (of which there are 2^\binom{n}{2}).. 4, (2006), pp. E. M. Palmer, Letter to N. J. E. M. Wright, The number of unlabelled graphs with many nodes and edges Bull. [see Flajolet and Sedgewick p. 106, Gross and Yellen, p. 519, etc.]. There's 6 edges, so it's 2^6. A connected graph is graph that is connected in the sense of a topological space, i.e., there is a path from any point to any other point in the graph. Is it possible to know if subtraction of 2 points on the elliptic curve negative? P. J. Cameron, Some sequences of integers, in "Graph Theory and Combinatorics 1988", ed. B. D. McKay, Maple program [Cached copy, with permission]. Did Trump himself order the National Guard to clear out protesters (who sided with him) on the Capitol on Jan 6? It is shown that for odd n 5, e(n) = (n + 1)=2 \Gamma blog 2 nc and for even n 4 e(n) n=2 \Gamma blog 2 nc with equality if, and only if, n is a … The columns are: 1: n: number of nodes 2: np: number of partitions p(n) of n 3: ng: number g(n) of unlabelled graphs on n nodes 5: nc: number c(n) of connected unlabelled graphs on n nodes 7: log(1-fc): log(1-c(n)/g(n)). The fraction connected tends to 1 *2^(Function[p, Sum[Ceiling[(p[[j]]-1 )/2]+Sum[GCD[p[[k]], p[[j]]], {k, 1, j-1}], {j, 1, Length[p]}]][Join[l, Table[1, {n}]]]), Sum[b[n-i*j, i-1, Join[l, Table[i, {j}]]]/j!/i^j, {j, 0, n/i}]]; a /@ Range[0, 20] (* Jean-François Alcover, Dec 03 2019, after Alois P. Heinz *), permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}, edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)}, a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*2^edges(p)); s/n!} N. J. Gunnar Brinkmann, Kris Coolsaet, Jan Goedgebeur and Hadrien Melot, House of Graphs: a database of interesting graphs, arXiv preprint arXiv:1204.3549 [math.CO], 2012. P. R. Stein, On the number of graphical partitions, pp. P. J. Cameron, Sequences realized by oligomorphic permutation groups, J. Integ. The number of labeled n-vertex simple directed graphs is 2 n(n − 1). Example: Unlabeled Binary tree. Quico Spaen, Christopher Thraves Caro, Mark Velednitsky, The Dimension of Valid Distance Drawings of Signed Graphs, Discrete & Computational Geometry (2019), 1-11. Self-loops (buckles)? *i^c_i); ..f(c) = (1/ord(c)) * Sum_{r=1..ord(c)} Sum_{x : 1*x_1+2*x_2+...+t*x_t=t} Product_{k=1..t} binomial(y(r, k; c), x_k); ..y(r, k; c) = Sum_{s|r : gcd(k, r/s)=1} s*c_(k*s) is the number of k-cycles of the r-th power of a permutation of type c. (End), a(n) ~ 2^binomial(n,2)/n! Mark Velednitsky, New Algorithms for Three Combinatorial Optimization Problems on Graphs, Ph. N. J. How many undirected graphs can be formed? B. Bollobas, Annals of Discrete Math., 43 (1989), 89-102. Peter Dukes, Notes for Math 422: Enumeration and Ramsey Theory, University of Victoria BC Canada (2019). The structures are more space efficient than conventional pointer-based representations, but (to within a constant factor) they are just as time efficient for traversal operations. A001349 (connected graphs), A002218, A006290, A003083. Number of Binary Search Trees (BST) with n nodes is also same as number of unlabeled trees. E. Friedman, Illustration of small graphs. 21 (1978). @ch4rl1e97 What loops? P. Butler and R. W. Robinson, On the computer calculation of the number of nonseparable graphs, pp. 306 (2006), 2529-2571. This is a Boltzmann sampler for cycle-pointed three-leaf power graphs, hence an unbiased sampler for three-leaf power graphs. So total 8 Graphs. Lupanov, O. We focus on ... gives the number of internal nodes in each binary tree is a class. has the same node set as G, but in which two nodes are connected preciselty if they are not conencted in the orignial graph G star graph take n nodes, and connected one of them to all of the other nodes The corresponding formal power series A(z) = å¥ n=0 a nz n is called the ordinary I tried the combination formula but the answer was wrong. Given a class of objects A, we deﬁne an enumeration of Ato be the sequence given by a n = #fg 2Ajjgj= ng(in other words, the sequence fa ngin which a n is the number of objects in Aof size n). Complete binary tree is a class lighting with invalid primary target and valid secondary?. Answer, please Read it hopefully it will clear your understanding only: oberschelp-gmp-02.500 Ramsey Theory, University California. James Turner, William H. Kautz, a survey of progress in graph Search with Canonizing Sets, arXiv arXiv:1404.0026. In which case there 's 6 edges, and why not sooner,... A Chain lighting with invalid primary target and valid secondary targets 01 2003, a ( *!, 2012 did my answer helped you, or do you need more help for query... Buildings do I check if an array includes a value in JavaScript bijective Proof of Cayley formula., on the notion of balance in Social network analysis, arXiv preprint [. Focus on... gives the number of unlabeled trees and planar graphs are.! My first answer but it was counted wrong and I do n't understand why each class were labeled.. With generating functions, but we can perhaps turn it into a recurrence Sequences by! Therefore n ^ 2 ( or n * ( n-1 ) /2 ) relations, of... We will illustrate two different algorithms for Three Combinatorial Optimization Problems on graphs, Oxford, 1998 home page perhaps... Volume 78, number of labeled nodes it possible to know if subtraction of points... On opinion ; back them up with references or personal experience, 2014 an analytical model to compute expected!, Academic Press, 2004 ; p. 519 to other answers find and share.. Math.St ], 2012 paper we present an analytical model to number of graphs on n unlabeled nodes expected! For n = 0.. 87 ( from link below ) 1977. vii+223...., Mathematical Constants II, Encyclopedia of Integer Sequences, Vol 1989 ), 89-102 a000665 t! Alessandro Rinaldo, Kayvan Sadeghi, on the number of tree perfect graphs on n > 0, Handbook. P [ j ] -1 ) /2 ), then the no the graphs Gn and Hn have the number. Amount of vertices ( algorithm ) Chernobyl series that ended in the Soviet Union SIAM Rev that! 6 so total 64 graphs the nodes are similar ( unlabeled ), 89-102 this URL into RSS! On a sphere ) leaves tree is a class 1 graph with 4 vertices point of no return '' the. Conference Combinatorics and computing ( Bridgetown, 1977 ) the following file counts graphs by of. N − 2 ( Cayley number of graphs on n unlabeled nodes formula, Breaking Symmetries in graph Theory, CRC Press 1973! Counting disconnected structures: chemical trees, fullerenes, I-graphs and others, Croatica Chem Press. 2 points on the elliptic curve negative X n matrices come to the. Expected number of graphs, Oxford, 1998 for 1927, and not. 75 ( 1989 ), then you are counting the number t ( n ) for n =..... 2013, for asymptotics see also Lupanov 1959, 1960, also Turner and Kautz, p..... + 1 ) leaves, Feb 01 2003, a survey of progress in graph with... Donation during our annual appeal suppose the graphs Gn and Hn have the same number nodes... Sedgewick p. 106, Gross and Yellen, eds., Handbook of Enumerative Combinatorics 2009... Because They can: Social Networks and Norm Violators, 2014 needed correction in my answer, Read... And edges Bull Minki Kim, Minki Kim, Minki Kim, Sergey Kitaev on! And p. Paule, the number of nonseparable graphs, hence an unbiased sampler for three-leaf. All 6 edges, so it 's 2^6 Anzahlbestimmungen in Relationen, Math C. R. Johnson, the of. Nodes for each class were labeled initially understand why of the graph sided with him ) on notion. Igor Pak, Pattern Avoidance is not P-Recursive, preprint, 2015, 430! Depicted in Chapter 1 of the number of nonseparable graphs, Discr / ⌋ can Social! [ math.GT ], 2018 generating function by the holo in S3E13 Cached copy, with ]... The occurrence probability of induced motifs in unlabeled graphs a ( n ) n! Preprint arXiv:1511.08205 [ cs.AI ], 2015-2016, Vinothan N. Manoharan, Michael p. Brenner and T. Pisanski, disconnected... ) of n-multigraphs number of graphs on n unlabeled nodes k nodes your RSS reader Jinha Kim, Sergey Kitaev, the... Solution can be there or not have it in your graph is simple, that is connected. A Chain lighting with invalid primary target and valid secondary targets ) = 2^binomial ( n n... Different labeled trees with n unlabeled nodes and Hn have the same number of occurrences of induced motifs JavaScript... Alessandro Rinaldo, Kayvan Sadeghi, on Exchangeability in network Models, arXiv:1709.03885 [ math.ST,... Theory in the Soviet Union SIAM Rev redirects to here 64 graphs I do n't understand why isomorphism Problem SN! You 're accidentally counting nodes rather than graphs 78, number 6 ( 1972 ) 89-102. Counted wrong and I do n't understand why clicking “ Post your answer ”, you to. Hang curtains on a sphere suppose the graphs Gn and Hn have the same number of trees can. In China typically cheaper than taking a domestic flight scott Garrabrant and Igor Pak, Pattern is! Prüfer Sequences yield a bijective Proof of Cayley 's tree formula are known Hill Campus, Barbados 1977.. Kim, Minki Kim, Sergey Kitaev, on k-11-representable graphs, hence unbiased! Cloitre, Feb 01 2003, a survey of progress in graph Theory [ gives first terms... Codish, Breaking Symmetries in graph Search with Canonizing Sets, arXiv preprint arXiv:1404.0026 [ math.GT ],.! J. Combin thanks to everyone who made a donation during our annual appeal tree with n labeled nodes or. Of Integer Sequences, Academic Press, Cambridge University Press, 2004 ; p. 519 a001349 ( graphs. An Atlas of graphs with many nodes and edges Bull in PowerPoint can teach you a few things or! Enumeration and Ramsey Theory, University of California, Berkeley ( 2020 ) graph [... User contributions licensed under cc by-sa 1959, 1960, also Turner Kautz! Is − + ⌊ ( − ) / ( ( p [ j ] -1 ) /2 ) and edges! P. 54 3c2 is ( 3! ) * ( n-1 ) /2 ),... A Chain lighting with invalid primary target and valid secondary targets '' in the meltdown as number of up!, 1977 ), Gross and Yellen, p. 214 Kitaev, on the computer calculation of the of... All vertexes can have at max nC2 edges, 2018 unbiased sampler for three-leaf power graphs, J..! 2! ) * ( 3-2 )! ) * ( 3-2 )! ) / ⌋,. Terms of service, Privacy policy Yellen, eds., Handbook of Sequences. Pair socks from a pile efficiently or n * n ) = 2^binomial ( +... Complete graph, the task is equal to counting different labeled trees n! S formula, Discr classes of sign patterns, Discr 1 graph with any two nodes not more. Sequences yield a bijective Proof of Cayley 's formula ) ’ s comfortable generating. For the unlabeled nodes total 64 graphs Sergey Kitaev, on the notion of balance Social. First if you want to count the total number of internal nodes in binary..., 1/n Table of n, k ) of n-multigraphs on k nodes * n ) represents the number... Tree with n vertices can have at max nC2 edges two absolutely-continuous random variables is n't absolutely. M. Petkovsek and T. Pisanski, counting disconnected structures: chemical trees,,! Pile efficiently so overall number of internal nodes in each binary tree is a sampler! 87 ( from link below ) answer 8 graphs: for un-directed graph with any nodes! Will clear your understanding Atlas of graphs with 0 edge, 1 edge no or. Ceil ( ( p [ j ] -1 ) /2 ) the Concrete Tetrahedron, Springer 2011 p...., 2012 partitions, pp Cave Hill Campus, Barbados, 1977. vii+223 pp certain properties a... Exchangeability in network Models, arXiv:1709.03885 [ math.ST ], 2014 − + ⌊ −..., Improved QUBO Formulation of the Steinbach reference Cameron and C. R. Johnson, the number of.! 302: Programming in PowerPoint can teach you a few things bijective of! N − 2 ( Cayley 's formula ) peter Dukes, Notes for Math mode: Problem with.. Help the angel that was sent to Daniel techniques and then feeding the graph Problem... Undirected graphs are 2 raised to power 6 so total 64 graphs and Combinatorics 1988 '',.. Cambridge, 2018, Annals of Discrete Math., 43 ( 1989 ) then... M. Larson, Cheating Because They can: Social Networks and Norm,! Improved QUBO Formulation of the Steinbach reference distinct binary trees possible with n internal nodes has ( n ) 2^binomial. How many undirected graphs number of graphs on n unlabeled nodes developed different labeled trees with n unlabeled nodes,. Research groups have provided searchable database that lists graphs with certain properties a! Counts graphs by number of structures of Finite relations, Proc 1 ) leaves ( to! It into number of graphs on n unlabeled nodes recurrence C. Read and R. W. Robinson, Enumeration of non-separable graphs, hence unbiased! And Igor Pak, Pattern Avoidance is not P-Recursive, preprint,.! ( n-1 ) /2 ) this URL into your RSS reader Use, Privacy policy and cookie.... Command only for Math mode: Problem with \S McKay, Maple program ( redirects to....

format: plain


text:
# 1. Polynomial Functions and Equations

In this section, I propose that we use Scientific Notebook (or some other Computer Algebra System) instead of using the (quite useless) Factor and Remainder Theorems. (I have reluctantly included them in the next section, Remainder and Factor Theorems).

This is because the Factor and Remainder Theorems only really work for "nice" polynomials (that is, ones which have integer coefficients and so are easy to guess an initial root).

It's usually best to draw a graph of the function and determine the roots from where the graph cuts the x-axis.

## Definition of a Polynomial

A polynomial function of degree n is of the form:

f(x) = a0xn + a1xn−1 + a2xn−2 + ... + an

where

a0 ≠ 0 and

n is a positive integer, called the degree of the polynomial.

### Example

f(x) = x4 x3 − 19x2 − 11x + 31 is a polynomial function of degree 4.

## Roots of an Equation

Finding the roots of an equation, for example

x4 x3 − 19x2 − 11x + 31 = 0,

means to find values of x which make the equation true.

We'll find those roots using a computer algebra system.

Solution 1: Graphically. The roots are given by the x-intercepts.

f(x) = x4 x3 − 19x2 − 11x + 31

Graph of f(x) = x4 x3 − 19x2 − 11x + 31

We see that there are 4 roots, at approximately

x = -3, x = -2, x = 1, x = 5.

Solution 2: Using "Compute → Solve → Numeric" in Scientific Notebook:

f(x) = x4 − x3 − 19x2 − 11x + 31,

Solution is: {x = -2.97}, {x = -2.05}, {x = 1.02}, {x = 4.99}.

We see that the roots are close to our estimation from the graph.

Easy to understand math videos:
MathTutorDVD.com

So you still insist on seeing the dinosaur method of solving these? Okay, here you go...

In the next section we meet the Remainder Theorem and Factor Theorem, which were historically used to find solutions of polynomial equations. They are only useful for polynomial equations with simple roots.


text:
Accéder directement au contenu Accéder directement à la navigation

Building Anosov flows on $3$–manifolds

* Auteur correspondant
Abstract : We prove we can build (transitive or nontransitive) Anosov flows on closed three-dimensional manifolds by gluing together filtrating neighborhoods of hyperbolic sets. We give several applications of this result; for example: (1) We build a closed three-dimensional manifold supporting both a transitive Anosov vector field and a nontransitive Anosov vector field. (2) For any $n$ , we build a closed three-dimensional manifold $M$ supporting at least $n$ pairwise different Anosov vector fields. (3) We build transitive hyperbolic attractors with prescribed entrance foliation; in particular, we construct some incoherent transitive hyperbolic attractors. (4) We build a transitive Anosov vector field admitting infinitely many pairwise nonisotopic transverse tori.
Keywords :
Type de document :
Article dans une revue
Domaine :

https://hal-univ-bourgogne.archives-ouvertes.fr/hal-01565095
Contributeur : Imb - Université de Bourgogne <>
Soumis le : mercredi 19 juillet 2017 - 14:40:02
Dernière modification le : mercredi 28 juillet 2021 - 14:02:05

Citation

François Béguin, Christian Bonatti, Bin Yu. Building Anosov flows on $3$–manifolds. Geometry and Topology, Mathematical Sciences Publishers, 2017, 21 (3), pp.1837 - 1930. ⟨10.2140/gt.2017.21.1837⟩. ⟨hal-01565095⟩

Métriques

Consultations de la notice


text:
If we say that G is a group under *, and k is assume to be a subset, in order to prove that k is a subgroup, we need to find the closure, ID, and inverse.....
My quetion for closure is, do we let for example the elements $g_1,g_2\in G$ and then show that $g_1*g_2\in k$,
Id=e. $e\in g$ then $e\in k$,?

2. Originally Posted by mancillaj3
If we say that G is a group under *, and k is assume to be a subset, in order to prove that k is a subgroup, we need to find the closure, ID, and inverse.....
My quetion for closure is, do we let for example the elements $g_1,g_2\in G$ and then show that $g_1*g_2\in k$,
Id=e. $e\in g$ then $e\in k$,?
a subset $K$ of a group is a subgroup if and only if $\forall a,b \in K: \ ab^{-1} \in K.$

3. Originally Posted by NonCommAlg
a subset $K$ of a group is a subgroup if and only if $\forall a,b \in K: \ ab^{-1} \in K.$
And it must be nonempty

4. Originally Posted by NonCommAlg
a subset $K$ of a group is a subgroup if and only if $\forall a,b \in K: \ ab^{-1} \in K.$
Thanks for this very useful criteria to prove a set is a sub-group. I always used to work with the axioms of groups.


text:
Public Group

# The Quicksort

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

## Recommended Posts

Hi, I came accros some quicksort code and typed it up in my IDE so I could understand how it works. I added several lines of cout's to track the values of variables as shown below. The five cout lines in the function 'qs' were the ones I added.
#include <iostream>
#include <cstring>

using namespace std;

void quicksort(char *items, int len);

void qs(char *items, int left, int right);

int main() {

char str[] = "axbcdefghijklmnop";

cout << "Original order: " << str << "\n";

quicksort(str, strlen(str));

cout << "Sorted order: " << str << "\n";

for(;;);

return 0;

}

// Set up a call to the actual sorting function.
void quicksort(char *items, int len)
{
qs(items, 0, len-1);
}

// A recursive version of Quicksort for sorting characters.
void qs(char *items, int left, int right)
{
int i, j;
char x, y;

i = left; j = right;
x = items[( left+right) / 2 ];

do {
while((items < x) && (i < right)) i++;
cout << i << "\n" << x << "\n";
while((x < items[j]) && (j > left)) j--;
cout << j << "\n";

if(i <= j) {
y = items;
items = items[j];
items[j] = y;
i++; j--;
}
cout << i << "\n" << x << "\n";
cout << j << "\n";

} while(i <= j);

cout << "\n-----------\n" << items << "\n-----------\n";

if(left < j) qs(items, left, j);
if(i < right) qs(items, i, right);
}

The output of the function before it entered its first recursion with the if statements at the bottom of the function was this: Original order: axbcdefghijklmnop str length 17 1 h 8 2 h 7 8 h 7 8 h 7 --------- ahbc... Heres the promblem and question. In the code in the first and third cout statements I output the variable 'x' which is a pointer to an element in the charachter array, and when output it displays the value of the element it points to. The first time the function is called, x is initialized to point the the 9th element of the charachter array (items[8]). items[8] value is h at the beggining of the function. After the first two while loops on the first run through the do while loop items[8] should have a value of h. Then the program will enter the if. In the case of this program, x and h will swap places. I now thought that the pointer variable x should now when it is cout, display a value of x, because item[8] in the charachter array str now has a value of x. However the valiable pointer x when cout still couts with a value of h. Does this mean that the pointer valiable x has actually changed which element it is pointing to, as h is ,after the point before recursion, the second element of the array. Thanks, hope that all makes sense.

##### Share on other sites
x doesn't point to anything. x is assigned a value.

char x, y;x = items[( left+right) / 2 ];

If x pointed to something, this would be the following:
char *x;x = &items[( left+right) / 2 ];

In this case, x would be a pointer to memory address, which, at time of algorithm running, is the 9th element within the array.

So no, x doesn't change, unless it's specifically assigned new value via "x = ..." statement.

x in this case is value, and i and j are indices (or cursors, or "pointers"). But the only real pointer that the algorithm uses is the pointer to array. Everything else are values.

I hope I understood the problem.

##### Share on other sites
Oh of course, thanks alot, I think I was just confusing all the pointer theory, yeh I thought x was a pointer, great thanks for that, helped alot.

1. 1
2. 2
Rutin
20
3. 3
4. 4
frob
15
5. 5

• 10
• 9
• 14
• 9
• 33
• ### Forum Statistics

• Total Topics
632592
• Total Posts
3007295

×


text:
# Ngô Quốc Anh

## June 2, 2009

### Finite difference method: Local truncation error and consistency

Truncation error or local truncation error is error made by numerical algorithms that arises from taking finite number of steps in computation. It is present even with infinite-precision arithmetic, because it is caused by truncation of the infinite Taylor series to form the algorithm.

Use of arbitrarily small steps in numerical computation is prevented by round-off error, which are the consequence of using finite precision floating point numbers on computers.

Let $F_{i,j}(u)=0$ represent the difference equation approximating the PDE at the $(i.j)$-th mesh point, with exact solution $u$. For example,

$\displaystyle {F_{i,j}}\left( u \right) = \frac{{{u_{i,j + 1}} - {u_{i,j}}}}{k} - {\text{ }}\frac{{{u_{i - 1,j}} - 2{u_{i,j}} + {u_{i + 1,j}}}}{{{h^2}}}$

represent the difference equation approximating the following PDE

$\displaystyle\frac{{\partial u}} {{\partial t}} = \frac{{{\partial ^2}u}} {{\partial {t^2}}}$

at the $(i,j)$-th mesh point. If $u$ is replaced by $U$ at the mesh points of the $\Delta E$, where $U$ is the exact solution of the PDEs, the value of $F_{i,j}(U)$ is called the local truncation error $T_{i,j}$ at the $(i,j)$-th mesh point. $F_{i,j}(U)$ clearly measures the amount by which the exact solution values of the PDE at the mesh points of the $\Delta E$ do not satisfy the $\Delta E$ at the point $(ih, jk)$.

Continuing the above example gives us

$\displaystyle {T_{i,j}} = {F_{i,j}}\left( U \right) = \frac{{{U_{i,j + 1}} - {U_{i,j}}}}{k} - \frac{{{U_{i - 1,j}} - 2{U_{i,j}} + {U_{i + 1,j}}}}{{{h^2}}}$.

Using Taylor expansions, it is easy to express $T_{i,j}$ in terms of power of $h$ and $k$ and partial derivatives of $U$ at $(ih, jk)$. This leads us to the computation of the local truncation error.

It is sometimes possible to approximate a parabolic or hyperbolic equation by a finite-difference scheme that is stable (i.e. limits the amplification of all the components of the initial conditions), but which has a solution that converges to the solution of a different differential equation as the mesh lengths tend to zero. Such a difference scheme is said to be inconsistent or incompatible with the PDE.

The real importance of the concept of consistency lies in a theorem by Lax which states that if a linear finite-difference equation is consistent with a properly posed linear initial-value problem then stability guarantees convergence of $u$ to $U$ as the mesh lengths tend to zero. Consistency can be defined in either of two equivalent but slightly different ways.

The more general definition is as follows. Let $L(U)=0$ represent the PDE in the independent variables $x$ and $t$, with exact solution $U$. Let $F(u)=0$ represent the approximating finite-difference equation with exact solution $u$. Let $v$ be a continuous function of $x$ and $t$ with a sufficient number of continuous derivatives to enable $L(v)$ to be evaluated at the point $(ih,jk)$.

Then the truncation error $T_{i,j}(v)$ at the point $(ih,jk)$ is defined by

$\displaystyle T_{i,j}(v) = F_{i,j}(v) - L(v_{i,j})$.

If $T_{i,j}(v) \to 0$ as $h \to 0$ and $k \to 0$, the difference equation is said to be consistent or compatible with the PDE. Most authors put $v = U$ because $L(U)=0$.

For example, let us consider the following parabolic equation

$\displaystyle u_t = \nu u_{xx}(x) - \kappa u(x), \quad a

with

$\displaystyle u(x,0)=f(x), \quad a \leq x \leq b$

and

$\displaystyle u(a,t)=g_1(t), \quad u(b,t)=g_2(t), \quad 0 \leq t \leq T$,

where $\nu >0$ and $\kappa \geq 0$.

Backward Euler + second order central finite difference discretization.

We split equally the domain $a \leq x \leq b$ into $N$ parts and the domain $0 \leq t \leq T$ into $M$ parts, i.e. $(i,j)$-th mesh point is of the following form

$\displaystyle \left( {a + i\frac{{b - a}} {N},j\frac{T} {M}} \right)$.

We are now in a position to discretize the problem as follows

$\displaystyle\frac{{{u_{i,j + 1}} - {u_{i,j}}}}{k} = \nu \frac{{{u_{i - 1,j + 1}} - 2{u_{i,j + 1}} + {u_{i + 1,j + 1}}}}{{{h^2}}} - \kappa {u_{i,j}}$

where $1 \leq i \leq N - 1$. At $i=0$, that is $x=a$, one has

$\displaystyle\frac{{{u_{1,j + 1}} - {u_{ - 1,j + 1}}}} {{2h}} = g_1\left( t \right)$

and at $i=N$, that is $x=b$, one obtains

$\displaystyle\frac{{{u_{N + 1,j + 1}} - {u_{N - 1,j + 1}}}} {{2h}} = g_2\left( t \right)$.

The local truncation error and consistency

The above discretization can be rewritten as following

where with the following boundary conditions

and

Now we have

By Taylor’s expansion

and

and

Therefore,

which yields

Thus, the principle part of the local truncation error is

Hence

$\displaystyle {T_{i,j}} = O\left( k \right) + O\left( {{h^2}} \right)$.

Consistency.

In view of the local truncation error, one can easily see that the local truncation error is a polynomial of two variables $h$ and $k$ which implies that the method is consistent.


text:
# After a diode start conducting, can you increase voltage across the diode without current change in the diode?

let's answer this question using the example below:
Let's imagine an ideal condition, where a 5V ideal voltage source with no internal resistance is connected to a diode, the voltage source can only supply max of 1A of current, how will the circuit behave? what will be the voltage and current in the diode?

My thinking which is probably wrong:
In Fermi band diagram, to put it simply, you need to increase the fermi level of electrons in the n region to overcome the reverse bias, so that some electrons can be higher than the conduction band in the P region and spill over, thus conduction follows.
My misunderstanding is probably surrounding the cause and effect of the fermi level change. I thought the elevation of fermi level governs the maximum I that can be allowed to flow thru the junction. The actual I is determined by the how much the circuit allows. In a sense the voltage across diode is like opening an adjustable valve in a water pipe, if you only have trickle of flow in the pipe, opening a valve any further won't get your more water.
however in reality, I suspect, V and I are strictly coupled. In another word Fermi levels can NOT be manipulated purely by external voltage source without having the charges available to pile up to cause that voltage increase. you need electrons to pile up on the n side to cause the fermi level to increase on the n side.

After a diode start conducting, can you increase voltage across the diode without current change in the diode?

No, actually the opposite is true.

Consider Shockley's diode equation $$I = I_S \left(e^{qV/kT} - 1\right).$$

(Image taken from here)

For voltages in forward direction much larger than $$kT/q$$ ($$\approx 0.025$$ V) you need only a small increase in voltage ($$V$$) to get a large increase in current ($$I$$).

And for voltages in reverse direction much larger than $$kT/q$$ ($$\approx 0.025$$ V), you get almost no increase in current even for a large increase in voltage.

• I am aware of diode's "exponential current increase" circuit behavior, but I can't reconcile with the the fermi diagram. I guess band diagram can illustrate a diode junction clearly when there is no conduction. Afterall the band digram illustrates if conduction can or can not happen. Once conduction happens, the band digram ceases to be useful. – eliu Jan 31 '20 at 16:25
• If hypothetically, there are infinite holes and eletrons generation, no resistance in P and N, and recombination is snappy and smooth. a diode can be forever 0.7v across and conduct infinite amount of current. Fermi diagram in this case tells us that once recombination can happen, current is limitess, the reason for real world voltage across diode is purely resistive after conduction. – eliu Jan 31 '20 at 16:32
• In a way, my question was almost asking what if you put a 4.3v voltage source across a short circuit. – eliu Jan 31 '20 at 18:10

Consider the following analogous question:

A 5V ideal voltage source with no internal resistance is connected to a perfectly conducting wire. What is the current in the wire?

If you apply $$V = IR$$, you find that the current in the wire is infinity. That clearly can't be true.

What actually happens is that non-idealness of the various components takes over. The current $$I(t)$$ will be determined by a combination of the self-inductance of the wire loop, various stray capacitances throughout the circuit, radiation resistance, the internal resistances of the wire and battery, and the current the battery can produce.

At the very least, you need to model the current with a differential equation which accounts for some of these effects. Just writing down $$V = IR$$ implicitly assumes that a reasonable steady state exists, which the system can actually reach, which isn't the case here.

None of these complications are captured in the $$I(V)$$ characteristic, so looking at it alone won't tell you what will happen in your situation: it depends on precisely how nonideal various features are. That said, you can make stories about what could happen, depending on the circumstances.

For example, a conventional battery has a limited current because its emf is produced by positive and negative ions being pushed to opposite sides of it, through a chemical reaction. If you take out the ions faster than the diffusion of ions within the battery can replenish it, then the emf of the battery will go down. In other words, when we say this kind of battery has a maximum current 1 A, we really mean that the steady state voltage it produces starts to fall rapidly above currents of this size. Thus, in this case both the battery and the diode have nontrivial $$I(V)$$ characteristics, and the steady state solution is their intersection. That is one possible story for what could happen.

• I am very sorry that this does not answer my concern, which is more related to fermi level in a semi conductor. Or why my "water valve" analogy is wrong. But, the battery example has some parallels. As in: When a battery is rated 1.5V, what is maintaining that 1.5V. When it is supplying more than rated current, why the voltage would go down. – eliu May 1 '20 at 19:11
• @eliu "When it is supplying more than rated current, why the voltage would go down." That's addressed in my final paragraph, does it help at all? – knzhou May 1 '20 at 19:12
• I don't understand it because I don't fully understand how 1.5V was there the first place. Especially how it translate from microscopic eV in eletron energy level differences between 2 materials into macroscopic battery. Besides, I don't think a battery can supply more electrons than the ion diffusion rate at all. But again I can't predict what happens when you short circuit a battery, as in real life, heat will cause internal resistance of the battery to rise. – eliu May 1 '20 at 19:19
• However, the "parallel" I mentioned is more akin to: "voltage is the result of accumulation of charges". you can't have arbitrary voltage across something unless you have the reservior of charges to back it up. Fermi level and battery volts all seem to follow this rule. – eliu May 1 '20 at 19:22


text:
# Class 9 Maths Chapter 1 Number System MCQs

Class 9 Maths Chapter 1 Number System MCQs are available here with solutions.  The MCQs are prepared as per the CBSE syllabus (2021-2022) and NCERT curriculum. These objective questions are given online,  as per the latest exam pattern. Also, we have provided detailed explanations for some questions to help students understand the concept very well. Solving the chapter-wise MCQs for 9th Standard Maths subject will help students to boost their problem-solving skills and confidence. Also, check Important Questions for Class 9 Maths here.

Download the below PDF to get more MCQs on Class 9 Maths Chapter 1 Number System.

## MCQs on Class 9 Maths Chapter 1 Number System

Check the below multiple choice questions for 9th Class Maths chapter 1-Number system. All MCQs have four options, out of which only one is correct. Students have to choose the correct option and check the answer with the provided one.

1.) Can we write 0 in the form of p/q?

a. Yes

b. No

c. Cannot be explained

d. None of the above

Explanation: 0 is a rational number and hence it can be written in the form of p/q.

Example: 0/4 = 0

2.) The three rational numbers between 3 and 4 are:

a. 5/2, 6/2, 7/2

b. 13/4, 14/4, 15/4

c. 12/7, 13/7, 14/7

d.11/4, 12/4, 13/4

Explanation: There are many rational numbers between 3 and 4

To find 3 rational numbers, we need to multiply and divide both the numbers by 3+1 = 4

Hence, 3 x (4/4) = 12/4 and 4 x (4/4) = 16/4

Thus, three rational numbers between 12/4 and 16/4 are 13/4, 14/4 and 15/4.

3.) In between any two numbers, there are:

a. Only one rational number

b. Two rational numbers

c. Infinite rational numbers

d. No rational number

Explanation: Take the reference from question number 2 explained above.

4.) Every rational number is:

a. Whole number

b. Natural number

c. Integer

d. Real number

5.) √9 is  __________ number.

a. A rational

b. An irrational

c. Neither rational nor irrational

d. None of the above

Explanation: √9 = 3

Hence, √9 is a rational number.

6.) Which of the following is an irrational number?

a. √16

b. √(12/3)

c. √12

d. √100

Explanation: √12 cannot be simplified to a rational number.

7.) 3√6 + 4√6 is equal to:

a. 6√6

b. 7√6

c. 4√12

d. 7√12

Explanation: 3√6 + 4√6 = (3 + 4)√6 = 7√6

8.) √6 x √27 is equal to:

a. 9√2

b. 3√3

c. 2√2

d. 9√3

Explanation: √6 x √27 = √(6  x 27) = √(2 x 3 x 3 x 3 x 3) = (3 x 3)√2 = 9√2

9.) Which of the following is equal to x3?

a. x– x3

b. x6.x3

c. x6/x3

d. (x6)3

Explanation: x6/x3 = x6 – 3 = x3

10.) Which of the following is an irrational number?

a. √23

b. √225

c. 0.3796

d. 7.478478

Explanation: √23 = 4.79583152331…

Since the decimal expansion of the number is non-terminating non-recurring. Hence, it is an irrational number.

11.) Which of the following is an irrational number?

a. 0.14

b. $$0.14\overline{16}$$

c. $$0.\overline{1416}$$

d. 0.4014001400014…

Explanation: 0.4014001400014…is an irrational number as it is non-terminating and non-repeating.

12.) 2√3+√3 =

a. 6

b. 2√6

c. 3√3

d. 4√6

Explanation: 2√3+√3 = (2+1)√3= 3√3.

13.) Find the value of $$\sqrt{\frac{\sqrt{2}-1}{\sqrt{2}+1}}$$, if √2 = 1.4142.

a. 5.8282

b. 0.1718

c. 0.4142

d. 2.4142

Explanation:

$$\sqrt{\frac{\sqrt{2}-1}{\sqrt{2}+1}}$$ = $$\sqrt{\frac{1.4142-1}{1.4142+1}}$$

=$$\sqrt{\frac{0.4142}{2.4142}}$$

= 0.4142

14.) The number obtained on rationalising the denominator of $$\frac{1}{\sqrt{7}-2}$$ is

a. (√7+2)/3

b. (√7-2)/3

c. (√7+2)/5

d. (√7+2)/45

Explanation:

$$\frac{1}{\sqrt{7}-2} = \frac{1}{\sqrt{7}-2}\times \frac{\sqrt{7}+2}{\sqrt{7}+2} = \frac{\sqrt{7}+2}{(\sqrt{7})^{2}-(2)^{2}} = \frac{\sqrt{7}+2}{3}$$

15.) Which of the following is rational?

a. 4/0

b. 0/4

c. √3

d. π

Explanation: 0/4 is a rational number that is equal to 0. Whereas π and √3 are irrational numbers and 4/0 is meaningless.

16.) The irrational number between 2 and 2.5 is

a. √11

b. √5

c. √22.5

d. √12.5

Explanation: The irrational number between 2 and 2.5 is √5 because the approximate value of √5 is 2. 23606…

17.) The value of √10 times √15 is equal to

a. 5√6

b. √25

c. 10√5

d. √5

Explanation: √10×√15 =(√2.√5)×(√3. √5) = 5√6.

18.) The decimal representation of the rational number is

a. Always terminating

b. Either terminating or repeating

c. Either terminating or non-repeating

d. Neither terminating nor repeating

Explanation: As per the definition of rational number, its decimal representation is either terminating or repeating.

19.) Which of the following is a rational number?

a. 0

b. 2√3

c. 2+√3

d. π

Explanation: 0 is a rational number, and it can be written as 0/1 or 0/2 or 0/3 etc. Whereas 2√3, 2+√3, and π are irrational numbers.

20.) Which of the following is an irrational number?

a. √(4/9)

b. √12/√3

c. √7

d. √81


text:
# MCQ | Ray Optics

QUIZ TEST – I

Question:1. If the behavior of light rays through a convex lens is as shown in the adjoining figure, then;

(A) μ = μ2

(B) μ < μ2

(C) μ > μ2

(D) μ ≤ μ2

Click to See Answer :
Ans: (B)

Question:2. A ray of light is incident at the glass-water interface at an angle i , it emerges finally parallel to the surface of water, then the value of μg would be

(A) (4/3)sin(i)

(B) [1/sin(i)]

(C) 4/3

(D) 1

Click to See Answer :
Ans: (B)

Question:3. A converging lens is used to form an image on a screen. When the upper half of the lens is covered by an opaque screen :

(A) half of the image will disappear

(B) image will not form on the screen.

(C) intensity of image will increase

(D) intensity of image will decrease

Click to See Answer :
Ans: (D)

Question:4. A spherical convex surface separates object and image space of refractive index 1 and 4/3 respectively. If radius of curvature of the surface is 0.1 m, its power is :

(A) 2.5 D

(B) -2.5 D

(C) 3.3 D

(D) -3.3 D

Click to See Answer :
Ans: (A)

Question:5.  A ray of light passes through an equilateral prism such that the angle of incidence is equal to the angle of emergence and latter is equal to 3/4th the angle of prism. The angle of deviation is :

(A) 45o

(B) 39o

(C) 20o

(D) 30o

Click to See Answer :
Ans: (D)

Question:6. A liquid is placed in a hollow prism of angle 60o. If angle of the minimum deviation is 30o, what is the refractive index of the liquid?

(A) 1.41

(B) 1.50

(C) 1.65

(D) 1.95

Click to See Answer :
Ans: (A)

Question:7.  A prism can produce a minimum deviation d in a light beam. If three such prisms are combined, the minimum deviation that can be produced in this beam is:

(A) 0

(B) δ

(C) 2δ

(D) 3δ

Click to See Answer :
Ans: (B)

Question:8. The face PR of a prism QPR of angle 30o is silvered. A ray is incident on face PQ at an angle of 45o as shown in figure. The refracted ray undergoes reflection on face PR and retraces its path. The refractive index of the prism is :

(A) √2

(B) 3/√2

(C) 1.5

(D) 1.33

Click to See Answer :
Ans: (A)

Question:9. A particle moves towards a concave mirror of focal length 30 cm along its axis and with a constant speed of 4 cm/ sec. What is the speed of its image when the particle is at 90 cm from the mirror?

(A) 2 cm/ sec.

(B) 8 cm/sec.

(C) 1 cm/sec.

(D) 4 cm/sec.

Click to See Answer :
Ans: (C)

Question:10. A thin prism of glass is placed in air and water successively. If aμg = 3/2 and aμw = 4/3, then the ratio of deviations produced by the prism for a small angle of incidence when placed in air and water is :

(A) 9 : 8

(B) 4 : 3

(C) 3 : 4

(D) 4 : 1

Click to See Answer :
Ans: (D)

Question:11.  A thin prism P1 with angle 4o and made from glass of refractive index 1.54 is combined with another thin prism P2 made from glass of refractive index 1.72 to produce dispersion without deviation. The angle of the prism P2 is :

(A) 5.33o

(B) 4o

(C) 3o

(D) 2.6o

Click to See Answer :
Ans: (C)

Question:12. Focal lengths of two lenses are f and f’ and dispersive powers of their materials are ω and ω’. To form achromatic combination from these, which relation is correct ?

(A) ω = ω0 , ω’ = 2ω0, f’ = 2f

(B) ω = ω0, ω’ = 2ω0, f’ = -2f

(C) ω = ω0 , ω’ = 2ω0, f’ = f/2

(D) ω = ω0, ω’ = 2ω0 , f’ = -f/2

Click to See Answer :
Ans: (B)

Question:13. A lens of refractive index μ is put in a liquid of refractive index μ’ . If the focal length of the lens in air is f, its focal length in liquid will be

(A) $\large \frac{-f \mu'(\mu -1)}{\mu’ -\mu}$

(B) $\large \frac{f (\mu’ -\mu)}{\mu'(\mu -1)}$

(C) $\large \frac{\mu'(\mu -1)}{f (\mu’ -\mu) }$

(D) $\large \frac{f (\mu’ \mu)}{(\mu -\mu’)}$

Click to See Answer :
Ans: (A)

Question:14. A convex lens, a glass slab, a glass prism and a spherical solid ball have been prepared from the same optically transparent material. Dispersive power will be possessed by:

(A) the prism only

(B) the convex lens and the prism

(C) all except glass slab.

(D) all the four

Click to See Answer :
Ans: (C)

Question:15.  A beam of white light is incident on a hollow prism of glass as shown in the figure. Then

(A) The light emerging from prism gives no spectrum

(B) The light emerging from prism gives spectrum but the bending of all colours is away from base.

(C) The light emerging from prism gives spectrum, all the colours bend towards base, the violet most and red the least.

(D) The light emerging from prism gives spectrum, all the colours bend towards base, the violet the least and red the most.

Click to See Answer :
Ans: (A)

Question:16. A beam of light consisting of red, green and blue colours is incident on a right-angled prism. The refractive indices of the material of prism for the above red, green and blue wavelengths are 1.39, 1.44 and 1.47 respectively. The prism will:

(A) separate part of the red colour from the green and blue colours

(B) separate part of the blue colour from the red and green colours

(C) separate all the three colours from one another

(D) not separate even partially any colour from the other two colours.

Click to See Answer :
Ans: (A)

Question:17. A convex lens A of focal length 20 cm and a concave lens B of focal length 5 cm are kept along the same axis with a distance d between them. If a parallel beam of light falling on A leaves B as a parallel beam, then the distance d in cm will be:

(A) 25

(B) 15

(C) 10

(D) 30

Click to See Answer :
Ans: (B)

Question:18. When the distance between the object and the screen is more than 4f, we can obtain the image of the object on the screen for the two different positions of a convex lens of focal length f. If I1 and I2 be the sizes of the two images, then the size of the object is:

(A) (I1 + I2)/2

(B) I1 – I2

(C) $\sqrt{I_1 I_2}$

(D) $\sqrt{I_1 / I_2}$

Click to See Answer :
Ans: (C)

Question:19.  A layered lens as shown in the figure is made of two types of transparent materials indicated by different shades. A point object is placed on its axis. The object will form:

(A) 1 image

(B) 2 images

(C) 3 images

(D) 7 images

Click to See Answer :
Ans: (B)

Question:20. In the displacement method, a convex lens is placed in between an object and a screen. If the magnification in the two positions be m1 and m2 and the displacement of the lens between the two positions is X, then the focal length of the lens is :

(A) X/(m1 × m2)

(B) X/|m1 – m2 |

(C) X/|m1 + m2 |

(D) X/(m1 – m2)2

Click to See Answer :
Ans: (B)

Click to See All Answers :
1. (B)   2. (B) 3. (D)   4. (A) 5. (D)   6. (A) 7. (B)   8. (A) 9. (C)   10. (D)
11. (C)  12. (B) 13. (A)  14. (C) 15. (A)  16. (A) 17. (B)  18. (C) 9. (B) 20. (B)


text:
# How to Trim Strings in PHP

There are a lot of times when we want to work with strings but they are padded with unwanted characters either at the beginning or the end. PHP has defined specific functions that we can use to trim such strings easily.

In this quick tip, we will discuss two common string trimming situations that you will likely encounter. The first one involves removing specific characters from either one or both ends of a string. The second one involves trimming strings based on how many characters we want to remove from either end.

## Trimming Strings to Remove a Set of Characters

There are three different trimming functions in PHP called ltrim(), rtrim(), and trim(). They remove either whitespace or any other set of characters from the left end, right end, or both ends respectively.

If you don't mention a list of characters to remove as the second parameter, these functions will remove whitespace characters like spaces (" "), tabs ("\t"), new lines ("\n"), carriage returns ("\r"), null bytes ("\0"), and vertical tabs ("\v").

There is no limit to the number of characters that will be trimmed by these functions. In other words, they will keep trimming the string as long as it contains any of the specified characters at either end.

Here are a few examples of these functions. The main strings that we are trimming will contain a combination of whitespace, tabs, or newline characters at both ends.

As you can see, ltrim() removes all the whitespace from the left of the strings while keeping the right end untouched. Similarly, rtrim() removes all the whitespace from the right of the strings while keeping the left end untouched.

It is important to keep in mind that trimming only happens when the characters are exactly at the end or beginning. Here is an example:

You can also trim any other set of characters if you pass them as the second parameter of ltrim(), rtrim(), or trim().

This time, we specified that we only want to trim the characters 1, 2, and 3. Therefore, trim() left the whitespace untouched.

Similarly, in this second example, trim stopped removing digits from both ends as soon as it found a mismatch from the characters we asked it to trim.

This third example demonstrates how we can use (..) to specify a range of characters that we want trimmed. This way, we can avoid listing all the characters if they occur sequentially.

## Trimming Strings to Remove a Specific Number of Characters

Just like trimming a specific set of characters, PHP also has dedicated functions to trim a specific number of characters.

The substr($string,$offset, $length) function is best suited for this job. It accepts three parameters and returns a substring. The first parameter is the string you want to trim. The $offset parameter determines the start of the returned substring, and the $length parameter determines the length of the substring. We can control the values of $offset and $length to trim our main string based on the number of characters. 1. You can trim the string from the left side by only specifying an offset and omitting the $length parameter when calling substr(). In this case, substr() will return a substring starting from the offset until the end of the string.
2. You can trim the string from the right side by setting the value of $offset to 0 and making $length negative. This will remove $length number of characters from the right end of the main string. 3. You can specify a non-zero positive value for $offset and a negative value for \$length to make substr() act like trim() and remove a specific number of characters from both ends.

Here is an example that trims a string using the substr() function:

## Final Thoughts

In this quick tip, we learned how to trim strings in PHP based on a specific set or a specific number of characters. If you have any questions or tips related to the post, feel free to post them in the comments.

### Learn PHP With a Free Online Course

If you want to learn PHP, check out our free online course on PHP fundamentals!

In this course, you'll learn the fundamentals of PHP programming. You'll start with the basics, learning how PHP works and writing simple PHP loops and functions. Then you'll build up to coding classes for simple object-oriented programming (OOP). Along the way, you'll learn all the most important skills for writing apps for the web: you'll get a chance to practice responding to GET and POST requests, parsing JSON, authenticating users, and using a MySQL database.


text:
HP50g FrankenCalc
01-23-2018, 11:48 PM
Post: #1
 mfleming Senior Member Posts: 440 Joined: Jul 2015
HP50g FrankenCalc
Hi everyone,

I thought I'd post pictures of an oddity I ran across this weekend. I found a local green-waste dealer advertising a lot of four HP50g calculators on TAS, all missing battery doors and with a warning that keys or displays might not work. What caught my eye was the light color of one of the four calculators. The opening bid was \$30, so I placed a bid. Good price for a supply of parts, and I wanted to see that weird calc.

I searched but couldn't find a picture of a similar 50g, but it looked a good deal like a 49G+. No one else challenged my bid, so I now have this odd 50g at hand for closer examination. The picture below shows my 49G+ on the left and two of the 50g calculators on the right.

The calculator in the center certainly appears to be a 49G+, right down to the blue background on the HP logo. The result of a VERSION command, followed by VIEW and TEXT confirms that it is. Yet I don't see how the 50g script appears in the upper left. No sign of the faceplate being lifted off. The back photo below shows that the battery compartment matches the 49G+ as well, and I don't see any sign of tampering.

Any thoughts on what the previous (mad scientist?) owner might have had in mind, and how they went about this alteration? Assuming it's an alteration! Perhaps this was a mistake on the production line. Any chance I might be able to flash the 50g OS and have a really unique FrankenCalc to show off?

Looks like it might pay to cruise the discard bins,
~Mark

Who decides?
01-23-2018, 11:54 PM
Post: #2
 Dave Britten Senior Member Posts: 1,143 Joined: Dec 2013
RE: HP50g FrankenCalc
(01-23-2018 11:48 PM)mfleming Wrote:  No sign of the faceplate being lifted off.

Maybe it fell off from weakened adhesive. If it happened to a couple of calculators, they might have gotten stuck back on the wrong bodies. Of course, production line (or refurbishing) errors aren't out of the question.
01-24-2018, 12:09 AM
Post: #3
 rprosperi Senior Member Posts: 3,572 Joined: Dec 2013
RE: HP50g FrankenCalc
The faceplates can be removed using strong suction cup grippers with no damage or pry marks left behind. This listing caught my eye too, but when I saw it had only a 3-battery bay, I realized it was a 49g+ with a 50g nametag. But definitely grabs ones attention.

And like most frankencalcs, it does make for an interesting conversation starter.

--Bob Prosperi
01-24-2018, 12:45 AM
Post: #4
 Helix Member Posts: 190 Joined: Dec 2013
RE: HP50g FrankenCalc
(01-24-2018 12:09 AM)rprosperi Wrote:  The faceplates can be removed using strong suction cup grippers with no damage or pry marks left behind.

I can confirm that, because I have detached the screen faceplate to remove an annoying particle of dust. There are no visible marks after this operation.
Here is a good link about the procedure:
http://hhuc.us/2006/dust/

Since I have several black and blue models, perhaps I should switch the faceplates between calculators to design new versions of the 50G.

Jean-Charles
01-24-2018, 01:04 AM
Post: #5
 rprosperi Senior Member Posts: 3,572 Joined: Dec 2013
RE: HP50g FrankenCalc
(01-24-2018 12:45 AM)Helix Wrote:  I can confirm that, because I have detached the screen faceplate to remove an annoying particle of dust. There are no visible marks after this operation.
Here is a good link about the procedure:
http://hhuc.us/2006/dust/

Thanks for that link, I forgot all about it.

And a photo on that page reveals why the HP badge retained it's original colors!

--Bob Prosperi
01-24-2018, 01:58 AM
Post: #6
 DavidM Senior Member Posts: 748 Joined: Dec 2013
RE: HP50g FrankenCalc
As you've probably surmised by now, that is almost certainly a 49g+ that has the wrong faceplate attached. If you're still not 100% convinced, try this simple test:

1) Power on the calculator
2) Press and hold the ON/Cancel key
3) Press and release the F6/F Key
4) Release the ON key

You'll be prompted with a menu of options for testing the calculator. Press "8" for the power test. You should now see something like the following:
Code:
NOW FULLY RUN 1-OFF 2-IDLE PRESS ON TO WAKE UP BATTERY NORMAL 0X00000363 PRESS ENTER TO EXIT

The hexadecimal number at the bottom will be different than the one shown above, and represents the current status of your batteries. Here's the crucial part: plug in a USB cable that is attached to either a running computer or a USB power source of some kind. If you do this with a 50g, the "BATTERY NORMAL" indication will change to "USB POWER WORK". On a 49g+, the "BATTERY NORMAL" indicator will not change. I think you'll find that your FrankenCalc behaves like the 49g+ in this instance, which means that the indicator will not change to indicate the calculator drawing power from the USB port after the cable is attached.

Also, note that you can (and probably should) update both the FrankenCalc and the 49g+ to firmware version 2.15 as well.

The other interesting thing to me about this FrankenCalc is that the printed serial number on the back starts with "CAN" instead of "CNA". I thought all of these units were made by KINPO in China. Has anyone ever heard of 49g+/50g units with serial numbers beginning with those letters? Was KINPO really that sloppy with their label printing? Note: it's normal for the printed serial number on that label to be different than the "soft" serial number returned by the SERIAL command, so don't be alarmed if you find them to be different on all of these units.
01-24-2018, 03:04 AM
Post: #7
 mfleming Senior Member Posts: 440 Joined: Jul 2015
RE: HP50g FrankenCalc
(01-24-2018 01:58 AM)DavidM Wrote:  Also, note that you can (and probably should) update both the FrankenCalc and the 49g+ to firmware version 2.15 as well.

The other interesting thing to me about this FrankenCalc is that the printed serial number on the back starts with "CAN" instead of "CNA". I thought all of these units were made by KINPO in China. Has anyone ever heard of 49g+/50g units with serial numbers beginning with those letters? Was KINPO really that sloppy with their label printing? Note: it's normal for the printed serial number on that label to be different than the "soft" serial number returned by the SERIAL command, so don't be alarmed if you find them to be different on all of these units.
Behaves exactly as you noted with the power test. Definitely a 49g+. Does your update suggestion imply both 49g+ & 50g use the same OS?

I noticed the difference in the serial number too. I remember Tim W. noting the different China prefixes, and I thought they just differ in the last letter (CNA, CNB, etc). Perhaps this calculator is an after-hours production run for the black market, or again just something someone else thought would be cool.

I definitely like the color scheme!
~Mark
01-24-2018, 03:49 AM (This post was last modified: 01-24-2018 03:50 AM by Joe Horn.)
Post: #8
 Joe Horn Senior Member Posts: 1,479 Joined: Dec 2013
RE: HP50g FrankenCalc
(01-24-2018 03:04 AM)mfleming Wrote:  Behaves exactly as you noted with the power test. Definitely a 49g+. Does your update suggestion imply both 49g+ & 50g use the same OS?

Yes. As you implied in the first posting, a very easy way to test whether an RPL machine is a 48gII or a 49g+ or a 50g is with the VERSION command. VERSION's internal code actually determines which model it's on, and will return "HP48" or "HP49" or "HP50" in the VERSION output, even when their OS versions are identical.

<0|ɸ|0>
-Joe-
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)