text:
# Have we directly observed the electric component to EM waves?

For example, has anyone has directly observed charges oscillating due to standing EM waves? I am particularly interested because it'd demonstrate that radiation has a transverse electric component to it. Anything else (historical or modern) that shows that light has a transverse electric component would also be gladly invited.

Yes, we have. As other answers have explained, this is easy to do in the radio regime, but over the past fifteen years or so we've been able to do it for light too.

The landmark publication here is

Direct measurement of light waves. E. Goulielmakis et al. Science 305, 1267 (2004); author eprint.

which broke new ground on a method called attosecond streaking that lets us see things like this:

$\qquad$

On the left you've got the (mildly processed) raw data, and on the right you've got the reconstruction of the electric field of an infrared pulse that lasts about four cycles.

To measure this, you start with a gas of neon atoms, and you ionize them with a single ultrashort burst of UV radiation that lasts about a tenth of the period of the infrared. (For comparison, the pulse length, $250\:\mathrm{as}$, is to one second as one second is to $125$ million years.) This releases the electron out of the atom, and it does so at some precisely controlled point within the infrared pulse. The electric field of the infrared can then have a strong influence on the motion of the electron: it will be forced up and down as the field oscillates, but depending on when the electron is released this will accumulate to a different impulse, and therefore a different final energy. The final measurement of the electron's energy, as a function of the relative delay between the two pulses (top left) clearly shows the traces of the electric field of the infrared pulse.

Yes. Radio waves are low frequency, long wavelength light waves. They drive electrons up and down an antenna. The radio detects the voltage changes this induces, amplifies them, and produces sound to match.

It depends on what you mean by "directly observed charges oscillating" and whether the formation of a standing wave is essential.

Using microwaves to demonstrate that they can be polarised you can infer the direction of oscillation of the electric vector in an electromagnetic wave.

If there is a horn receiver as well as a horn transmitter then just rotating one relative to the other produce a variation the amplitude of the received signal to show that the transmitted microwaves are polarised.

This can lead on to demonstrating polarisation of light using a Polaroid which on a molecular scale has crystals orientated in parallel which can form a conducting path just like the rods for microwaves.

If you do need the condition that the demonstration has to be for standing waves then a pair of Letcher lines might be of use?

Microwaves (or UHF waves) from a transmitter $b$ are guided along a pair of parallel uninsulated conducting rods with a spacing less than that of the wavelength of the microwaves and if shorted ($c$ in the diagram) produce a standing wave pattern which can be investigated by either observing the voltage nodes and antinodes or current nodes and antinodes.
Leybold produce an excellent leaflet describing the sort of experiments which can be performed with such an apparatus.

At radio frequencies the rotation of an fm dipole aerial showing the variation in signal strength will illustrate polarisation.
In this case unlike the microwave demonstration with the parallel metal rods the response is a maximum when the dipole is orientated parallel to the electric field.

Oscillating charges themselves produce radiation, but not along their axis of oscillation.

It is straightforward to show, with linearly polarised laser light, that no scattered light is received from a material in the direction(s) of laser polarisation, but is a maximum in a plane at right angles to these directions.

This demonstrates that the electrons have been made to accelerate in a particular direction -- the direction of E-field polarisation of the wave.

A waveguide slotline with a probe and a detector diode connected to an oscilloscope, a so-called Standing Wave Ratio (SWR) meter: https://en.wikipedia.org/wiki/SWR_meter

Yes, we have observed, but not for all em waves. Detailed answer follows from “Planets and electromagnetic waves”. Light waves or rays interact with electric fields of electrons in a solar cell to produce a disturbance in electrons so that electricity is produced. In a tungsten bulb, electrons try to move with very close distance because of a voltage, and at the same time the electric fields of these electrons repel them. So, light energy is released. Light energy is associated only with electric fields. Moving electrons have magnetic fields. Radio waves interact with magnetic fields of moving electrons, and disturb the moving electrons to make variations in current. Radio waves are associated only with magnetic fields. No one practically observed combined form of magnetic field type and electric field type of waves with common wavelength. In Hertz’s experiment, it happens that both light waves and radio waves are released but not with common wavelength. Some researchers do not consider microwaves as electromagnetic waves, because their velocity in vacuum is less than the velocity of light in vacuum.


text:
assigned today:

Due today:

in class

• review of using complex notation for damped driven (take imag part at end)
• voted for hearing more about even function Fourier series
• took a while to show the impact of a different end point (instead of $$\pm\pi$$)
• talked about which integrals went to zero still
• quiz on damped driven

edit

format: plain


text:
# CHAPTER XXXVII

Charles Dickens I HAVE now arrived at the close of my little history. The events which succeeded the famous Revolution of one thousand six hundred and eighty-eight, would neither be easily related nor easily understood in such a book as this.William and Mary reigned together, five years. After the death of his good wife, William […]

Charles Dickens THE late Kings eldest son, the Prince of Wales, called EDWARD after him, was only thirteen years of age at his fathers death. He was at Ludlow Castle with his uncle, the Earl of Rivers. The prince`s brother, the Duke of York, only eleven years of age, was in London with his mother. […]


text:
# EppsNet Archive: Biographies

## See You in Hell

26 Apr 2015 /

Satan

[See You in Hell is a feature by our guest blogger, Satan — PE]

Greetings from the underworld!

I see that Pope Francis put a bee in Turkey’s bonnet a couple of weeks ago by calling the mass killing of Armenians in 1915 a genocide. According to the Turks, the Vatican should look to its own history before casting stones. Tu quoque!

On that note, the 2015 Pulitzer Prize for Biography was just awarded to David I. Kertzer for The Pope and Mussolini: The Secret History of Pius XI and the Rise of Fascism in Europe. Historically, popes have been far more circumspect in condemning genocide and other atrocities when committed by countries willing to aggrandize the Church (or when committed by the Church itself!)

See you in Hell, clerics of all stripes . . .

## “Keep it Simple,” Nobel Prize Winner Advises

22 Jan 2012 /

Image via Wikipedia

I soon was taught that [Linus] Pauling’s accomplishment was a product of common sense, not the result of complicated mathematical reasoning. Equations occasionally crept into his argument, but in most cases words would have sufficed. The key to Linus’ success was his reliance on the simple laws of structural chemistry. The $\alpha$-helix had not been found by only staring at X-ray pictures; the essential trick, instead, was to ask which atoms like to sit next to each other. In place of pencil and paper, the main working tools were a set of molecular models superficially resembling the toys of preschool children.

We could thus see no reason why we should not solve DNA in the same way. All we had to do was to construct a set of molecular models and begin to play — with luck, the structure would be a helix. Any other type of configuration would be much more complicated. Worrying about complications before ruling out the possibility that the answer was simple would have been damned foolishness. Pauling never got anywhere by seeking out messes.

## So You Want to Be a Writer

23 Feb 2009 /

The world is what it is; men who are nothing, who allow themselves to become nothing, have no place in it.

This book would be a great gift from a parent to a child who is interested in becoming a writer. When Junior discovers that winning the Nobel Prize in Literature at age 69 entails spending most of one’s decades depressed, impoverished, ignored, and bitter, he will likely knuckle under and agree to pursue radiology.


text:
# Theory Seminar: The Maximum Star Forest and The Maximum Carpool Matching Problems

דובר:
גלעד יקותיאל (מדעי המחשב, טכניון)
תאריך:
יום רביעי, 13.12.2017, 12:30
מקום:
טאוב 201

The minimum dominating set problem in a graph $G = (V, E)$ asks to find a minimum size set $D \subseteq V$ such that every vertex not in $D$ is adjacent to at least one member of $D$. It is a well known NP-hard optimization problem that was studied from the 1950s onwards. A greedy algorithm for the minimum dominating set problem yields a $O(\log \Delta)$-approximation ratio, where $\Delta$ is the maximum degree in $G$, and this is the best possible, assuming $P \neq NP$. The maximum spanning star forest problem is the dual problem of the minimum dominating set problem and it asks to find a maximum set $L \subseteq V$ such that every vertex in $L$ is adjacent to at least one member of $V \setminus L$. In other words, the maximum spanning star forest problem, asks to find a spanning star forest (a forest in which each connected component is a star) that maximize the number of edges in the forest.

The maximum carpool matching problem is a generalization of the maximum star forest problem, in which we are given a directed graph $D = (V, A)$, a weight function $w:A \to \mathbb{R}$, and a capacity function $c:V \to \mathbb{N}$. the goal is to find a collection of vertex disjoint in-branching of depth one where the in degree of the roots are limited by the capacity function. that maximize the number of edges in the forest.
that maximize the number of edges in the forest.
The maximum spanning star forest and maximum carpool matching problems only been studied in the last decade. In this talk I will present some of the results and the open questions related to these problems.

בחזרה לאינדקס האירועים


text:
RMM 2017 – UK Team Blog

This is the customary and slightly frivolous account of a trip to Bucharest for the ninth edition of the Romanian Master of Mathematics, an annual competition for school students, widely recognised as the hardest of its kind.

I discuss the problems in two previous posts (here and here), and there is also a pdf with fewer pictures, which includes both the discussion and this diary, as well as some more formal comments about the competition itself, the results, and thanks.

Wednesday 22 February

Did you know that trains in Moldova use different width tracks to trains in Romania? Well, I didn’t know either, but I found out at 1am today, as my wagon lit from Chisinau was painstakingly jacked up to allow the transfer from ex-Soviet gauge to Western gauge. Outside, a man in a smart uniform and epaulettes shouted loudly and continuously at a group of men in smart uniforms without epaulattes. When their task was done, four sets of border and custom checks remained before the opportunity for another visit to the samovar, and finally a chance to sleep.

All of which is to say that I have arrived at maths competitions in better mental shape than 6am today at Gara de Nord. The UK students have a more conventional itinerary, but their flight from Luton doesn’t arrive until mid-afternoon. After my first Haifa ‘winter’, I’m craving pork and snow, and find both in the mountain town of Sinaia, an hour away by train in Transylvania. I also find a bear. The bear seems very scared.

I return in time to meet the UK students as well as James and MT. Some of our contestants are now into their fourth year of attending international competitions, and the labour of finding them fresh material resembles Hercules against the hydra, but some problems on combinatorial geometry with convexity seem to have kept everyone entertained on the flight. Dinner is at the Moxa campus of the University of Economics, and features chicken with one of two possible carbohydrates, as in fact do the next six meals. However, today is Thomas’s 18th birthday, and so his parents have arranged a delicious cake, which elicits considerably more enthusiasm. On the short walk back to our meeting, we notice it is possible both to buy fireworks and get a tattoo among other options, so Thomas is spoiled for choice about how to take advantage of his majority.

The team’s activities remain a mystery to James and me though, as we have to join the other leaders for the first meeting, to receive the proposed problems. We spend some time thinking about them separately then together, and our initial impression is that it’s a very suitable paper, that hopefully our team will enjoy.

Thursday 23 February

The leaders meet to finalise the choice and statement of the problems. With a bit more time this morning, I’ve solved Q1, Q2, Q5, and proved Q3 once I’d looked up the correct bound. James eats conics for breakfast and shows me a glorious range of interpretations of Q4. We feel happy that our students will have a chance at all of these, while Q6 may prove more restricting. Either way, it’s clearly an appropriate set for this competition, and is approved quickly. So it’s time to finalise the English version of the paper, or finalize the American version. Many alternatives to the word sieve are proposed. Andrea from Italy is clearly already craving home comforts, but his suggestion of cheese grater is not taken up. This time I’m sorting the LaTeX, so get to settle the commas, but also take the blame for inconsistently spacing the rubric between the two papers. I’m sure everyone noticed.

While all this has been happening, the students have been at a lecture by Sergiu Moroianu at the Institute of Mathematics. Joe Benton gives an account of what they learned in the longer pdf version of this report.

For all the charms of Chipping Norton, I sense MT is enjoying the grittier nature of Bucharest Sector 1, and has been shepherding the students round various sites in between attempts at practice problems. I join them for a brief visit to a geology museum. I am very cynical, but it slightly exceeds my expectations, and is infinitely better than the nearby Museum of the Romanian Peasant, which currently ties with the Hanoi Ethnology Museum as my least favourite olympiad excursion of all time.

The opening ceremony is held in the grand hall of the university, and includes several welcoming and thoughtful speeches from the Mayor of Bucharest and the headteacher of Tudor Vianu, the school which hosts this competition every year. Each team briefly presents themselves on stage. Joe and Neel have accumulated a large collection of UK flags from previous competitions, and should hereby consider themselves publicly shamed for forgetting their promise to bring them. It is over soon, and while the students enjoy a quiet evening and an early night, the leaders have to finalise markschemes for all the problems. The walk back takes us through Victory Square, and past the protesters whose fires and slogans have been on front pages around the world in the past months. It’s an interesting time, and the atmosphere of this city feels very different from my first visit, for the inaugural edition of this competition in 2008.

Friday 24 February

The first day of the contest starts at 9am. The British students seem fairly relaxed, and hopefully are aiming high. Contestants may ask questions of clarification during the first 30 minutes. Rosie does this, and I send my reply to her two queries back via the courier. Five minutes later it is returned to me with the explanation that the student does not understand the answer. Even under competition pressure this seems unlikely, given that my answers are, respectively ‘yes’, and putting a ring around one of three options she has listed. It turns out that actually the student courier did not understand what to do with the answer, and the situation is quickly corrected.

We approve more markschemes. The US deputy leader Po-Shen and I share our views on the challenge of correctly finding the bound in Q3, and our suggestion that this instead be worth 2 points is upheld. Various further discussions fill the morning, and we return just in time to meet the students at the end of the exam. Harvey claims all three problems with a relaxed grin, while Joe claims all three problems with the haunted look of a man whose twelfth espresso of the day has just worn off. Alexander and Thomas say that they spent most of the time making sure their solutions to Q1 were totally watertight, which, given the intricacy of the arguments, was clearly a very sensible strategy.

To provide a distraction, if not actually a break from time-pressured problem-solving, I’ve booked a pair of escape rooms for the UK students later in the afternoon. Bucharest is the home of these games, where the aim is to solve themed puzzles as part of a story in time to escape a locked room. I join one of the rooms, where there are some theatrical reveals involving wrenches, and clues hidden in combination-locked cabinets, where ability to add three-digit numbers proves useful. Someone’s carrying voice means we get to enjoy some of the drama and twists of the other room too. Anyway, this proved an ideal way to avoid useless post-mortems, and I highly recommend Vlad and his pair of rooms.

Later, James and I get to look at the students’ work from this morning. Their assessments are pretty accurate. Harvey’s solutions to everything are beautiful, while Neel’s bounding argument in Q2 is certainly the most vulgar (and, in fact, unnecessary) calculation of the year so far. Joe’s solution to Q3 bears such obvious resemblence to an official solution that his uncharacteristic abundance of small errors probably won’t matter, including the memorable set $A_i\backslash\{i\}$, where the two is mean different things. Some of the team might reflect that a moment of casualness in checking the n=2 case on Q2 is a frustrating way to lose a potential mark, but when I compare notes with James, it sounds like the slow and steady approach to Q1 has indeed paid off for everyone, so hopefully it will not be too painful to agree the scores tomorrow.

Saturday 25 February

It’s the second day of the competition, and the UK team look bright-eyed and positive at breakfast. They aren’t the only ones under pressure this morning, as James and I must settle the scores from yesterday’s questions with local markers, known as coordinators. It’s hard to guess in how much detail one will have to explain your contestants’ scripts, so it is safer to prepare almost line-by-line. On this occasion though, perhaps we have over-prepared, as every meeting ends quickly with offers of 7/7 exactly where we were hoping, and indeed in a couple of places where we were not hoping. The markschemes are very clear about certain omissions which carry a point deduction, so to ensure fairness and consistency, we insist that two scores are moved down. I’m confident that any British student would prefer an honourable 41/42 than an accidental 42/42.

No-one’s going to be scoring 41 nor 42 unless they solve the extremely challenging geometry Q6, and as we meet our students afterwards, it turns out they have not managed any progress there. However, they claim an almost full set of solutions to Questions 4 and 5, which, if accurate, is a very good return. Everyone is in a good mood, and after I explain a couple of approaches to Q6, no-one seems too disappointed that they didn’t spot these.

There are various schedules floating around, listing multiple locations and times for lunch, but our space-time trajectory intersects none of them, so we follow the Chinese team to a recommended cheap Szechuan restaurant round the corner. Various circle theorems are explored via the Lazy Susan, and there is a grand reveal of the marks we’ve recently confirmed. There’s time for another pair of escape rooms while the second day scripts arrive. As Rosie remarks, two in two days can lead to excessive outside-the-box thinking. Sometimes a radiator really isn’t a sinister prop, a device for encoding five-digit numbers, or a clue to a Templar tunnel; it’s just a radiator. Otherwise we’d be cold.

When the scripts arrive, as expected the cupboard is pretty bare on Q6. If there were marks for quantity, Neel might get some, and if there were marks for most uses of esoteric theory in a single page, Alexander might get one. No set of scripts for an international-level medium combinatorics problem will ever be perfect, but our Q5s come close. It’s therefore not a long evening, and we can join the students for dinner with the American team. For most of them it’s their first visit to Europe, and there’s much comparing of culture and maths training programmes. There’s also a long discussion of whether it’s sensible to teach maths in primary school. Those present who have small children or younger siblings weigh in on the mysteries of the ‘grid method’, and whether toddlers implicitly understand commutativity, even if they can’t spell it.

Sunday 26 February

The UK leaders gather early in the ‘philosophical anti-cafe’ opposite Vianu school, to ponder the final scripts with a coffee and a view of an artfully-arranged folio of Spinoza. James has a loyalty card here. Unfortunately two of our students have clear algebraic errors in Q4, but apart from that everything is very straightforward. Though following last night’s conversation, we note that maybe a revision clinic on mathematical spelling might prove useful. Anonymous student X thinks there’s one L in ‘ellipse’, counterbalanced by anonymous student Y who thinks there are two in ‘column’. The word ‘parallel’ comes in many disguises.

Of course, the coordinators couldn’t care less about that, and they don’t even mind Neel’s two-cases-at-once inductive step, so again we get what we ask for on Q5 immediately, and on Q4 in the time it takes James to draw a lozenge tiling representing Thomas’s shearing argument. For Q6, it turns out there clearly is a mark for most uses of esoteric theory in a single page, so Alexander gets it. They show us a diagram with over a hundred lines which suggests that the exotic equivalence he claims is actually true. There we go. Overall, the quality of our written solutions has been extremely high. It feels like I say this every time now, but it isn’t idle propaganda. We remember the horrors that used to emerge occasionally, and the effort to make this improvement permanent feels well worth it.

Meanwhile, to fill the day, the students have gone to Sinaia. Two of their guides went with them to help with tickets at the station, apparently under the impression that never having taken a train before wouldn’t be an obstacle to this role. Either way, they made it, and following my request for material for this report, I receive a trickle of presentable photos, though there is talk afterwards of some rather more informal versions which are apparently not suitable. The Transylvanian winter is thawing, but slowly and messily, and Harvey reports that several of the group spent more time horizontal than vertical. Irrespective of their preferred axis, there’s no comment on whether they saw my bear, or any other bear. But since my bear was scared of me, one wonders what it would make of MT’s telling-off face? (Last seen by me during the notorious ‘balcony incident’ at a summer school in 2005, but hardly forgotten.)

The students return in time for confirmation of the results and their medals. As so often, there is pleasure that we have done so well collectively, mixed with mild disappointment for those who ended up just short of a boundary, and that the UK was so close to placing first. Because of the strength of the invited countries, earning a medal of any colour is a very worthwhile achievement, and so Rosie is impressively sanguine about missing out so narrowly in such an unfortunate manner. Alexander was closer than it appears, and could have two more opportunities to take part.

The closing ceremony at Vianu school proceeds rapidly. There is the usual challenge of photographing the students receiving their prizes, but this time is easy. Thomas is about a foot taller than everyone else on the stage, while Neel is flanked by almost the entire Russian team, but his chutzpah trumps their numerical advantage, with laughter all round. Joe claims this year’s gold medal is substantially weightier. He hasn’t brought his previous pair, so the chance to verify this and recreate a Mark Spitz moment goes begging.

It’s 7pm, and UK student enthusiasm for the closing disco (not my words) is about as high as MT’s enthusiasm to chaperone the closing disco. Instead we find a Middle Eastern restaurant, and it’s refreshing to eat hummus in a place which doesn’t claim to be the ‘best in Israel’ though I don’t think Abu Said in Akko will be rushing to steal the recipe. Po-Shen outlines his vision of a year-long maths camp. I think present company are tired enough after five days here. Some are interested to view, if not actually participate in, the protests in Victory Square, but it seems tonight is a quiet one and nothing is being burned, so late-night cards and a perusal of each others’ scripts will have to do.

Monday 27th February

The rest of the group have a flight back to London later today which apparently cost 99p per person before tax. I don’t know how much less the 5am option was, but I think it’s probably worth it. My own flight is truly at 5am tomorrow and I plan to stay up all night. The students return to school tomorrow, doubtless to receive a glorious mix of adulation and apathy. Harvey requests whether next year this trip can be timed differently so that he can miss the whole of his local Eisteddfod, rather than just one day. I promise to ask the organisers, say goodbye, then head for the hills on a train journey long enough to write the entirety of this report.

3am at Bucharest airport, and thoughts can now turn to the future. Many of us will meet in five weeks’ for another round of mathematics in the more tranquil setting of Cambridge. Meanwhile, I certainly enjoyed, admittedly through red eyes, the entertainment of a flight to Israel where baggage size regulations are actually enforced at the boarding gate, and apparently everyone else made it back safely too.

RMM 2017 – Problems 2, 3 and 6

In the previous post, I discussed Problems 1, 4 and 5 from this year’s Romanian Master of Mathematics competition. In this post, I discuss the harder problems (modulo my subjective appreciation of difficulty).

Problem 2

Determine all positive integers n satisfying the following condition: for every monic polynomial P of degree at most n with integer coefficients, there exists a positive integer $k \leq n$, and (k+1) distinct integers $x_1,\ldots,x_{k+1}$ such that

$P(x_1) + P(x_2) + \cdots + P(x_k) = P(x_{k+1}).$

Parsing this question deserve at least a moment. Straight after a first reading, I find it worth writing down any key quantifiers which I might forget later. Here, it’s the words at most. If you want to show the statement holds for n=2, you need to investigate monic polynomials with degree zero, one and two. You should also make sure that any instances of $x_i$ really are always distinct.

This matters in competitions! Two of our contestants failed to get the mark for showing n=2 works, precisely because of not checking the linear case, and a third could have lost it for using examples which are sometimes not distinct. On hard papers, one mark actually is the difference between triumph and frustration. And of course it matters outside competitions too, since small cases are exactly what your reader might examine first, to check they understand the problem posed, so it’s not a good place for awkward errors.

I started by trying to show that it couldn’t possibly happen that every polynomial with degree at most n had this property, for some combinatorial reason. For example, that if every set of distinct integers could only be a solution set for a small number of polynomials, then we would end up with not enough polynomials. But I couldn’t make this work at all; every bound ended up heavily in the wrong direction.

The next natural question is, does a typical polynomial of degree at most n have this property? But choosing a typical polynomial is hard, so in fact I asked, do the simplest polynomials of degree at most n have this property? I think the simplest polynomials of degree at most n are $\{1,x,x^2,\ldots,x^n\}$. Under what circumstances does

$x_1^m + \ldots x_k^m = x_{k+1}^m,$ (1)

have solutions in distinct integers? Famously, when k=2 and $m\ge 3$ this is a very very hard problem indeed. So the first point is that it though it might be useful to use Fermat’s Last Theorem, it would be foolish to pursue a strategy which, if successful, would have a proof of FLT as a sub-problem. At least, it would be foolish if the aim was to finish this strategy within a few hours.

So my main comment on this question is meta-mathematical. If lots of attempts at general arguments don’t work, there must be some special example that does it. And what properties do I want this special example to have? Maybe one might have thought of this from scratch, but my motivation came from (1) in the case m=p-1. Then, by Fermat’s Little Theorem, all the summands are equal to 1 or 0 modulo p. If k>p, then after discounting any uniform factors of p, we obtain a congruence equation which is, in informal terms,

$\left(0\text{ or }1\right)+\ldots+\left(0\text{ or }1\right) \equiv \left(0\text{ or }1\right).$

This looks really promising because it’s quite restrictive, but it’s still just a bit annoying: there are quite a few solutions. But it does give us the right idea, which is to find a polynomial P for which $P(x)\equiv 1$ modulo n. The equation $1+\ldots+1\equiv 1$ modulo n has solutions only if the number of summands on the LHS is 1 modulo n. So in this context, this reduces to showing that P is, additionally, injective on the integers, ie that P(x)=P(y) only when x=y.

It’s a nice exercise to show the existence of polynomials which are constant modulo n, and a good problem to work out how to force injectivity. If a polynomial is increasing everywhere, then it is certainly injective, and so the problem ends up being slightly easier in the case where the degree is odd than when the degree is even, but this is a nice conclusion to a nice problem, so I’ll save it for any interested readers to finish themselves.

Problem 3

Let n be an integer greater than 1 and let X be an n-element set. A non-empty collection of subsets $A_1,\ldots, A_k$ of X is tight if the union $A_1 \cup \dots \cup A_k$ is a proper subset of X and no element of X lies in exactly one of the $A_i$s. Find the largest cardinality of a collection of proper non-empty subsets of X, no non-empty subcollection of which is tight.

Note. A subset A of X is proper if $A\neq X$. The sets in a collection are assumed to be distinct. The whole collection is assumed to be a subcollection.

By Neel Nanda:

If |X|=n, there are $2^n$ possible subsets, so at first glance the answer could be a variety of things, from a linear to an exponential function of n, each of which would suggest a different approach. So the first step is to conjecture an answer, and by examining small cases it seems impossible to do better than 2n-2. There are several natural constructions for this bound, such as n subsets of size (n-1) and (n-2) subsets of size 1, so we guess this to be our answer (which later turn out to be right!).

From here, a solution is deceptively simple, though empirically the five full solutions in the contest show that it was by no means easy to find. We proceed by induction on the size of X, and want to show that any collection of subsets S has size at least (2n-2). By assumption all subcollections are not tight, so if the union of a subcollection is not the whole set X, then there is an element which appears in exactly one subset. This is a useful result, so we’d like to force a subcollection whose union is not the whole set X.

One way to guarantee that the union of a subcollection is not X is by taking the subcollection of all subsets not containing some element b. So there is some element c which appears in only one subset not containing b. If we choose b so that it’s the element contained in the fewest subsets of S, c is in at least as many subsets of S, but in only one subset not containing b. This means that at most one subset containing b doesn’t contain c. This is useful, because after removing at most 2 subsets (the coefficient of n in 2n-2, importantly!), we now have that every subset in S either contains both b and c or neither. This means that we can replace the pair (b,c) with a new element d, to get a new collection of subsets S’ of a set X’, of size n-1, so by induction $|S| \le |S'|+2\le 2n-2$.

There is also the case where all subsets contain b, but we can create an equivalent collection of subsets of X \ {b} by removing b from all subsets. So again by induction we are done.

Problem 6

Let ABCD be any convex quadrilateral and let P, Q, R, S be points on the segments AB, BC, CD, and DA, respectively. It is given that the segments PR and QS dissect ABCD into four quadrilaterals, each of which has perpendicular diagonals. Show that the points P, Q, R, S are concyclic.

I thought this problem was extremely hard. The official solution starts with a ‘magic lemma’, that isn’t quite so magic if you then read how it’s used. The overall claim is that PQ, RS and AC are concurrent (or parallel), and this is proved using the fact that the radical axis of the two circles with diameters PQ and RS also passes through this point of concurrency. Hunting for key properties of subsets of points in the diagram is an important skill in hard olympiad geometry, since it exactly reflects how problem-setters produce the problems. All the more so when there is lots of symmetry in the construction. But this is a hard example – there are a lot of potentially relevant subsets of the configuration.

When you’re really stuck with how to get involved in a synthetic configuration, you might consider using coordinates. Some of the UK students have been reading some chapters of a book (Euclidean Geometry in Mathematical Olympiads by Evan Chen. I’ve only had my own copy for a couple of days, but my initial impression is very positive – it fills a gap in the literature in a style that’s both comprehensive and readable.) focusing on various analytic approaches, so James and I felt it was safer to make sure we knew what the best settings were, and how far we could take them.

You almost certainly want the intersection of PR and QS to be your origin. I wanted to set up the configuration using the language of vectors, referenced by (P,Q,R,S). This was because $PQ\perp BO$ and so on, hence $\mathbf{b}\cdot (\mathbf{q}-\mathbf{p})=0$ and so on. An alternative is to use complex numbers, which makes this condition a bit more awkward, but is more promising for the conclusion. Concyclity is not a natural property in vectors unless you can characterise the centre of the circle, but can be treated via cross-ratios in $\mathbb{C}$. You also have to decide whether to describe the collinearity of A, B and P by expressing $\mathbf{p}=\lambda_{\mathbf{p}} \mathbf{a}+(1-\lambda_{\mathbf{p}})\mathbf{b}$, or via something more implicit. There definitely are not four degrees of freedom here, since specifying A certainly defines at most one valid set of (B,C,D), so one is mindful we’ll have to eliminate many variables later. We also have to account for fact that $\mathbf{r}$ is a negative scalar multiple of $\mathbf{p}$, and it’s not clear whether it’s better to break symmetry immediately, or use this towards the end of a calculation.

The point of writing this was that if your initial thought was ‘this looks promising via coordinate methods’, then I guess I agree. But there’s a difference between looking promising, and actually working, and there are lots of parameterisation options. It’s certainly worth thinking very carefully about which to choose, and in this case, challenging though they were, the synthetic or synthetic-trigonometric methods probably were better.

RMM 2017 – Problems 1, 4 and 5

I’ve recently taken a UK team to the 2017 edition of the Romanian Master of Mathematics competition in Bucharest. The British students did extremely well and we all enjoyed ourselves mathematically and generally. The customary diary may appear shortly, but this time I want to focus mainly on the questions, since that is after all the main point of these competitions! I hope that what follows is interesting, and at slightly education to potential future students.

I’ve split this into two posts based on my opinion on difficulty, which is subjective but probably correlates fairly positively with most people’s. The account of Q1 is guest-written by two British students, based on their solutions during the competition.

Problem 1

a) Prove that every positive integer n can be written uniquely in the form

$n = \sum_{j=1}^{2k+1} (-1)^{j-1} 2^{m_j},$

where $k\geq 0$ and $0 \leq m_1 < m_2 < \cdots < m_{2k+1}$ are integers. This number k is called the weight of n.

b) Find (in closed form) the difference between the number of positive integers at most $2^{2017}$ with even weight and the number of positive integers at most $2^{2017}$ with odd weight.

Rosie Cates and Neel Nanda:

a) We are trying to express n in terms of powers of 2, so it seems sensible to write in binary. As $2^{m_1}$ is the smallest power of 2, this term is responsible for the last 1 in the binary representation of n. Let $letx x = n – 2^{m_1}$ (ie n with the last 1 removed from its binary expansion). Now if we pair up terms in the sum to get

$x = (2^{m_{2k}+1} - 2^{m_{2k}}) + \ldots + (2^{m_3} - 2^{m_2}),$

we can see that each bracket looks like 11…100…0 when written in binary. Also, the condition that $m_i < m_{i+1}$ is equivalent to ensuring that we do not break any strings of consecutive 1s that were in the binary expansion of x (so for example 111110 = 110000 +1110 is not allowed). So writing x in the desired form is the same as writing it as the sum of numbers of the form 11…100\ldots 0 without breaking any strings of 1s. For example

1110100110 = 1110000000 + 100000 + 110.

Clearly there is exactly one way of doing this for every x, so (as each n has exactly one x) there is exactly one way to do it for each n as well.

This approach allows k to be understood differently. Write n in binary and remove the last 1; now count the number of groups of consecutive 1s. This is equal to k.

b) The second half of the problem becomes a lot simpler with the observation that $n\leq 2^{m_{2k+1}}$, as

$n=2^{m_{2k+1}}-(2^{m_{2k}}-2^{m_{2k-1}})-\ldots-(2^{m_2}-2^{m_1}),$

and the sequence $m_n$ is increasing, so each bracket is positive. As each sequence of $(m_n)$s corresponds uniquely to an integer, this means we just want to count sequences of $(m_n)$s with greatest term at most 2017. The sequence is increasing, so each sequence corresponds to a subset of {0, 1, …, 2017} of size (2k+1). There are $\binom{2018}{2k+1}$ subsets of size (2k+1), so the question reduces to finding a closed form for $\sum_{k=0}^{1008} (-1)^k {{2018}\choose{2k+1}}$.

This is reminiscent of a classic problem in combinatorics: using the binomial theorem to evaluate sums of binomial coefficients weighted by powers. The best example is

$\sum_{k=0}^n (-1)^k \binom{n}{k} =(1-1)^n=0,$

but here rather than (-1) we want something whose square is $(-1)$, so we consider the complex number i. Using the same ideas, we get that

$\sum_{r=0}^{2018} i^r \binom{2018}{r}=(1+i)^{2018},$

which contains what we want, but also binomial coefficients with even r. But if r is even, $i^r$ is real, and if r is odd, $i^r$ is imaginary. So the sum we want appears as the imaginary part, that is

$\mathrm{Im}\left((1+i)^{2018}\right)=\mathrm{Im}\left((\sqrt{2} \cdot e^{\frac{i\pi}{4}})^{2018}\right)=2^{1009}.$

Dominic: note that in both parts, the respective authors find slightly more than what they were required to. That is, respectively, the interpretation of k, and a bound on $m_{2k+1}$. The latter is an excellent example of the general notion that sometimes it is better to use a stronger statement than what you actually require in an induction argument (here for existence). The stronger statement (which you guess from playing with examples) makes the inductive step easier, as it’s then clear that the new term you get is distinct from the terms you already have.

Problem 4

In the Cartesian plane, let $\mathcal G_1, \mathcal G_2$ be the graphs of the quadratic functions $f_1(x) = p_1x^2 + q_1x + r_1, f_2(x) = p_2x^2 + q_2x + r_2$, where $p_1 > 0 > p_2$. The graphs $\mathcal G_1, \mathcal G_2$ cross at distinct points A and B. The four tangents to $\mathcal G_1, \mathcal G_2$ at~A and B form a convex quadrilateral which has an inscribed circle. Prove that the graphs $\mathcal{G}_1$ and $\mathcal{G}_2$ have the same axis of symmetry.

This question is quite unusual for an olympiad of this kind, and I was initially skeptical, but then it grew on me. Ultimately, I was unsurprised that many contestants attacked entirely with coordinate calculations. If you use this strategy, you will definitely get there in the end, but you have to accept that you aren’t allowed to make any mistakes. And because of the amount of symmetry in the configuration, even if you make a mistake, you might still get the required answer, and so not notice that you’ve made a mistake. But I decided I liked it because various levels of geometric insight either reduced or removed the nastier calculations.

Typically, one could gain geometric insight by carefully observing an accurate diagram, but an accurate parabola is hard to draw. However, even from a vague diagram, we might guess the key intermediate property of the configuration, which is that the line joining the other two points in the quadrilateral is parallel to the y-axis. This means that they have the same x-coordinate, and indeed this x-coordinate must in fact be the same for any parabola through A and B, so it is reasonable to guess that it is $\frac{x_A+x_B}{2}$, the mean of the x-coordinates of A and B.

Since you know this is the goal, it’s not too bad to calculate the equations of the tangent lines directly, and demonstrate this algebraically. But I was determined to use the focus-directrix definition of a parabola. Either recall, or digest the interesting new fact that a parabola may be defined as the locus of points which are the same distance from a fixed point P (the focus), and a fixed line $\ell$ (the directrix). Naturally, the distance to the line is perpendicular distance.

To ensure the form given in the statement where y is a quadratic function of x, in this setting the directrix should be parallel to the x-axis. To define the tangent to the parabola at A, let A’ be the foot of the perpendicular from A onto $\ell$, so AA’=PA. I claim that the tangent at A is given by the perpendicular bisector of A’P. Certainly this passes through A, and it is easy to convince yourself that it can’t pass through any other point B on the parabola, since BA’> PB, as A’ is on $\ell$ but is not the foot of the perpendicular form B to $\ell$. This final observation is truly a lot more obvious if you’re looking at a diagram.

We now want to finish geometrically too. In our quadrilateral, one diagonal is parallel to the y-axis, and it will suffice to show that the existence of an incircle implies that A and B must have the same y-coordinate. We have just shown A and B are the same (horizontal) distance from the other diagonal. So certainly if they have the same y-coordinate, then the quadrilateral is a kite, and the sums of opposite sides are equal, which is equivalent to the existence of an incircle. One could then finish by arguing that this ceases to be true if you move one of A and B in either direction, or by some short explicit calculation if such a perturbation argument leaves you ill at ease.

Question 5

Fix an integer $n \geq 2$. An n x n  sieve is an n x n array with n cells removed so that exactly one cell is removed from every row and every column. A stick is a 1 x k or k x 1 array for any positive integer k. For any sieve A, let m(A) be the minimal number of sticks required to partition A. Find all possible values of m(A), as A varies over all possible n x n sieves.

This is a fairly classic competition problem, and while in my opinion the statement isn’t particularly fascinating, it’s interesting that it admits such a wide range of approaches.

As ever, you need to start by playing around with the setup, and guessing that the answer is 2n-2, and not thinking `it can’t possibly be the same answer as Q3??’ Then think about reasons why you couldn’t do better than 2n-2. My very vague reason was that if you only use horizontal sticks, the answer is clearly 2n-2, and the same if you only use vertical sticks. But it feels like you can only make life harder for yourself if you try to use both directions of sticks in lots of places. Note that some sort of argument involving averaging over stick lengths is definitely doomed to fail unless it takes into account the Latin square nature of the location of holes! For example, if you were allowed to put all the holes in the first row, m(A) would be n-1.

Induction is tempting. That is, you remove some number of sticks, probably those corresponding to a given hole, to reduce the board to an (n-1)x(n-1) configuration. If you do this, you need to be clear about why you can remove what you want to remove (in particular, the number of sticks you want to remove), and whether it’s qualitatively different if the hole in question lies on the border of the board. In all of these settings, you want to be careful about 1×1 sticks, which it’s easy inadvertently to count as both horizontal and vertical. This is unlikely to affect the validity of any argument (just picking either an arbitrary or a canonical direction if it’s 1×1 should be fine) but does make it much harder to check the validity.

Joe exhibited directly a construction of 2n-2 cells which must be covered by different sticks. This approach lives or dies by the quality of the written argument. It must look general, even though any diagram you draw must, almost by definition, correspond to some particular case. Alternatively, since the problem is set on a grid, the cells correspond naturally to edges of a bipartite graph, where classes correspond to rows and columns. The holes form a perfect matching on this bipartite graph. But, as Harvey observed, if you split the rows and columns in two, on either side of the relevant hole (or not in the 2+2 cases where the hole is at the border), you have a (2n-2)+(2n-2) bipartite graph, and a perfect matching here corresponds to a set of cells which must be covered by different sticks. This is an ingenious idea, and if you’ve recently met Hall’s Marriage Theorem, which gives a verifiable criterion for the existence of such a perfect matching, there are few better uses of your next ten minutes than to check whether Hall’s condition a) should hold; b) can be proven to hold in this setting.


text:
Browse Questions

# Calculate the amount of ammonium sulphate required to prepare 500ml of 1 molar solution of ammonium sulphate? (m.wt of $(NH_4)_2SO_4$ is 132.14gm/mol)

$\begin{array}{1 1}(a)\;66gm\\(b)\;132gm\\(c)\;198gm\\(d)\;212gm\end{array}$

Given Molarity of Ammonium Sulphate solution $= 1$, Volume of solution is $500\;mL$ and the Molecular Weight $= 132.14 \; g\;mol^{-1}$
Molarity (M) is defined as number of moles of solute dissolved in one litre (or one cubic decimetre) of solution, $M = \large\frac{\text{ Moles of solute }}{\text{Molarity Volume of solution in litre}}$
$\Rightarrow$ Molues of solute $= 1M \times 0.5\;L = 0.5\; mol$
$\Rightarrow 0.5\; mol = \large\frac{\text{Amount of Ammonium Sulphate}}{\text{Molar Mass of Ammonium Sulphate}}$
$\Rightarrow$ Amount of Ammonium Sulphate $= 0.5\;mol \times 131.14\; g\;mol^{-1} = 66\;g$
edited Jul 16, 2014


text:
## Phase structure and Hosotani mechanism in gauge theories with compact dimensions revisited    [PDF]

Kouji Kashiwa, Tatsuhiro Misumi
We investigate the phase structure of SU(3) gauge theory in four and five dimensions with one compact dimension by using perturbative one-loop and PNJL-model-based effective potentials, with emphasis on spontaneous gauge symmetry breaking. When adjoint matter with the periodic boundary condition is introduced, we have rich phase structure in the quark-mass and compact-size space with gauge-symmetry-broken phases, called the $SU(2)\times U(1)$ split and the $U(1)\times U(1)$ re-confined phases. Our result is qualitatively consistent with the recent lattice calculations. When fundamental quarks are introduced in addition to adjoint quarks, the split phase becomes more dominant and larger as a result of explicit center symmetry breaking. We also show that another $U(1)\times U(1)$ phase (pseudo-reconfined phase) with negative vacuum expectation value of Polyakov loop exists in this case. We study chiral properties in these theories and show that chiral condensate gradually decreases and chiral symmetry is slowly restored as the size of the compact dimension is decreased.
View original: http://arxiv.org/abs/1302.2196


text:
# Error while using combine package [closed]

I am using LaTeX combine package for combining articles in Mathematics having document class amsart, but very time I had a problem with

\newtheorem{theorem}{\bf Theorem}[section]

Can anyone help me to get out of this.

This is using for Main file:

\documentclass[12pt,colclass=amsart,reqno]{combine}

\usepackage{amsmath,a4,amsfonts,amssymb,enumerate,fleqn,breqn,times}

\usepackage{hyperref}

\usepackage{keyval}

\title{Proceedings of the ...}

\author{ Editor\thanks{Support ...}}

\begin{document}

\pagestyle{combine} % use the combine page style
\maketitle % main title

\tableofcontents % main ToC

\clearpage

\begin{papers}

\begingroup\import{file1}\endgroup % first article, may have own ToC,

\end{papers}

\end{document}

For file1 I am using:

\documentclass[a4paper,11pt,reqno]{amsart}

\usepackage{amsmath,a4,amsfonts,amssymb,amsthm,enumerate,fleqn,breqn}

\usepackage{enumitem}

\setdescription{leftmargin=0cm,labelindent=0cm}

\mathindent4em

\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}

\mathsurround1pt

\def\disp{\displaystyle}

\def\CC{\mathbb{C}}

\def\ZZ{\mathbb{Z}}

\pretolerance=5000

\hyphenpenalty=5000

\def\cc#1{\{#1\}}

\def\pp#1{\|#1\|}

\def\ra{\rangle}

\def\la{\langle}

\def\nh{\mathcal{H}}

\def\A{\mathcal{A}}

\theoremstyle{plain}

\newtheorem{theorem}{\bf Theorem}[section]

\newtheorem{lemma}[theorem]{\bf Lemma}

\theoremstyle{remark}

\newtheorem{definition}[theorem]{\bf Definition}

\newtheorem{observations}[theorem]{\bf Observations}

\newtheorem*{notationn}{\bf Notation}

\newtheorem{example}[theorem]{\bf Example}

\newtheorem{remark}[theorem]{\bf Remark}

\newtheorem{proposition}[theorem]{\bf Proposition}

\newtheorem{corollary}[theorem]{\bf Corollary}

\newtheorem*{noten}{\bf Note}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{FILE 1}

\author{C}

\email{acs@gmail.com}

\def\Ker{\mathop{\rm Ker}}

\subjclass[2010]{ xxC40}

\keywords{asc}

\thispagestyle{empty}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\maketitle
\begin{abstract}

abs

\end{abstract}

\section{Introduction}

\end{document}

The error shows:

! Undefined control sequence.
l.7 \setdescription
{leftmargin=0cm,labelindent=0cm}
?
! Missing \endcsname inserted.
\relax
l.39 \newtheorem{theorem}{\bf Theorem}[section]

?

## closed as off-topic by Joseph Wright♦Mar 5 '16 at 21:22

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• You shouldn't use \bf but "had a problem" means what??? Did you get an error if so what (exactly) was the message, cut the message from the log file and show us. Please always include a small complete document that demonstrates the error. – David Carlisle May 14 '14 at 11:17
• Welcome to TeX.SX! On topic of \bf: tex.stackexchange.com/q/41681 – LaRiFaRi May 14 '14 at 11:41
• You had ommited the important part of the error message that says what the error is, I edited your question to add back both error messages (The benefit of having provided an example that reproduces the error:-) The error is that \setdescription is not defined That isn't a command I recognise – David Carlisle May 14 '14 at 14:46
• I'm voting to close this question as off-topic because it involves some unknown macro that hasn't been detailed in edits. – Joseph Wright Mar 5 '16 at 21:22


text:
agg_vec(x = character(), aggregated = logical(vec_size(x)))

## Arguments

x The vector of values. A logical vector to identify which values are .

## Details

An aggregation vector extends usual vectors by adding <aggregated> values. These vectors are typically produced via the aggregate_key() function, however it can be useful to create them manually to produce more complicated hierarchies (such as unbalanced hierarchies).

## Examples

agg_vec(
x = c(NA, "A", "B"),
aggregated = c(TRUE, FALSE, FALSE)
)
#> <agg_vec[3]>
#> [1] <aggregated> A            B


text:
# PHP framework building: initializer and object loader classes

I am building a PHP framework and would like to get some feedback on a few different sections of the project. I consider myself still a neophyte in PHP so I would like to ask if I'm going about completing these different tasks in an efficient and or correct way.

I have create two classes, initializer and Loader. The initializer class setup the autoload for the including of the class scripts and the loader instantiates the object using Singleton pattern. I have include the code below.

Initializer class

    class Initializer{
private static $extention = array('.core.php','.class.php'); private static$directories = array('core/','controller/','model/');

}

private static function autoload($class){ set_include_path(get_include_path().PATH_SEPARATOR.implode(PATH_SEPARATOR,self::$directories));
spl_autoload_extensions(implode(',',self::$extention)); spl_autoload($class);
}

}

class  ObjectLoader{
public static $objectsArray = array(); public static function loadClass($object){
if (empty(self::$objectsArray[$object])) {
self::$objectsArray[$object] = new $object(); } return self::$objectsArray[$object]; } }  Example of the classes being used. Please Note: That class files with the extensions .core.php or .class.php are being looked for in directories core/, controller/ or model/. Initializer::loadClassFiles();$objectOne = ObjectLoader::loadClass('objectone');
$objectTwo = ObjectLoader::loadCLass('objecttwo');  I would like to know if this is a good way to go about it. • There is one issue from what I can see from a quick glance. The class loader will only ever create one instance of the class. You should add a method to overwrite this. I will write a more extensive answer later when I have more time. Feb 2 '15 at 10:34 • I only want to create one instance. I'm using singleton patter to insure only one instance of an object is used. There may be changes that more then one operation might use an object. To minimize resources(memory) usage I thought I would be best to prevent this. Feb 2 '15 at 11:03 • This is also a solid way of thinking, but my suggestion is only to help you ensure you can use the same class for multiple cases where the purpose is same. But having one instance may limit you. Consider instantiating a PostEntry class. If there are multiple posts you would need to discard your class and use plain PHP. Feb 2 '15 at 11:35 ## 1 Answer As promised in the comments I would write a more extensive answer. So here it goes. Before I start I would like to say that I think it is a perfect learning opportunity building your own framework. I have been in the process of creating my own the last year or so. I started from scratch with little knowledge of the different things, so the things I point out in this answer is a mixture of experience (from trial and error) and best practices I have learned as valuable over that year. I think the code you have provided shows you have a basic (though bare minimum) idea of how the code should work, a good start. Everything mentioned below should be taken as my way of helping you and pointing out errors that I made and I wished somebody helped me correct sooner. ## The Initializer class First of, your Initializer class attempts to load classes by declaring the include path and extensions over and over and THEN load the class. This should only be done once. It happens because you have provided the name of the function autoload to the spl_autoloader_register. PHP then runs this function each time a class is loaded. You then make a call to spl_autoload() which is irrelevant. A call to spl_autoload_register() with no parameters is just a good, in fact it might be a little faster as it is written in highly optimized code by PHP. I feel like the initializer class needs another name. All it is doing is setting up autoloading of classes. A more appropriate name could be Autoloader? Now to the class itself. The class uses static methods. I think the use of static methods has it place, but it is misused here. The autoloader class should only be instantiated once, so the need for static properties is not required. When declaring paths to directories in which your classes resides, consider using fully qualified paths as they are a little faster than their relative counterpart. When loading a lot of classes this little improvement can save you some resources. Fully qualified paths can be achieved by: $directories = []; // An array of directories.

/*
* Hard-coding the paths when all paths are known would be preferred.
* The function realpath() requires executable rights on all directories used.
*/
foreach($directories as$key => $directory) {$directories[$key] = realpath($directory);
}

Another thing which caught my eye was the hardcoded properties. Part of the solid principle states that a class should be open for extension, but closed for modification. This can be easily achieved by providing the directories/paths and extensions used as arguments in a constructer of the class. This would allow you to easily add more directories without altering the code you have already written.

Below I have written an example of the things I have stated above. Feel free to use it, but remember this is bare minimum code.

class Autoloader {

private $directories = []; private$extensions = [];

public function __construct(array $directories, array$extensions) {
$this->directories =$directories;
$this->extensions =$extensions;

$this->register(); } private function register() {$directories = array_merge((array) get_include_path(), $this->directories);$extensions  = implode(',', $this->extensions); set_include_path(implode(PATH_SEPARATOR,$directories));

spl_autoload_extensions($extensions); spl_autoload_register(); } }  The usage will now look like: $directories = [
'core/',
'controller/',
'model/'
];

$extensions = [ '.php', // Added for compatibility with other libraries. '.core.php', '.class.php' ]; /* * Storing the instance in a variable is * not required. */$autoloader = new Autoloader($directories,$extensions);

As I said in the comments one of the two biggest issues that caught my eye was the inability to instantiate a new instance. I made the same assumption that storing each instance in a static property would save a lot of resources. But the reality proved me wrong. Here is one of the issues I have encountered.

With the good intention of saving resources you store the instances, so they can be referenced. But then you have a problem when you want to delete an resource intensive instance entirely. You cannot use unset($instance), because the reference to the instance would remain in the loader and no resources would be freed. I therefore think you should provide a way to indicate that the class SHOULD be a shared (singleton) and all classes by default are non-shared. But this would render the purpose of the class useless, as you would only wrap the way a class is instantiated and you might even limit yourself at the same time as you cannot pass arguments to the class. So what I would do is make the class able to store an array of class names that should be shared and let it keep track of them. You would then provide it with an array of shared class names once (during instantiation of the Loader itself) and when you create a new class and need it shared, you would update that array. The second issue is that you are unable to provide arguments to the instantiated class through the loader as it is. You would have to use plain PHP which renders the loader useless. This can easily be changed, which I will show in my version/refactoring of your code. Then there is a litte bug in your code, where you check if an instance exists. The empty keyword checks if an array or string is empty and not if an array key exists (check the documentation to see which values are considered empty). Use the isset() keyword or the more verbose (but more readable in my opinion) array_key_exists() function. I also think the class should avoid using static methods. I know this will prevent you from using class inside other classes as easily, but the classes required by other classes (dependencies) should be provided as arguments. Read up on Dependency injection (Tutsplus). I will also provide you with some resources you can read at the end. Now when we stitch all this together an example of the loader class could look like the following: class Loader { private$instances = [];
private $shared = []; /* * The$shared argument has a default value of an empty array. This
* makes the argument optional. Use this if no classes should be shared.
*/
public function __construct(array $shared = []) {$this->shared = $shared; } /** * Load an instance of the specified class. * * @param string$class
* @param array  $arguments * @param bool$singleton
*
* @return object
*/
public function load($class, array$arguments = [], $singleton = false) { /* * Check if a shared instance exists. */ if(array_key_exists($class, $this->instances)) { return$this->instances[$class]; } /* * Create a new instance. * The use of the ReflectionClass gives us the ability to provide * an array as arguments. * * If no arguments was provided we skip the instantiation if the reflection class. */ if(empty($arguments)) {
$instance = new$class;
}else{
$instance = (new \ReflectionClass($class))->newInstanceArgs($arguments); } /* * Check if a singleton is requested or the class is marked as shared. */ if($singleton === true || array_key_exists($class,$this->shared)) {
$this->instances[$class] = $instance; } return$instance;
}

/**
* Removes a class from the shared instances array.
* Use this to free up resources used by intensive classes.
*
* @param string $class * * @return bool Returns TRUE of the class was removed. Returns FALSE of the class is not shared. */ public function free($class) {
if(array_key_exists($class,$this->instances)) {
unset($this->instances[$class]);
return true;
}
return false;
}

}

Usage of this class would look like:

$shared = [ 'Foo', 'Bar' ];$loader = new Loader($shared);$obj = $loader->load('Foo'); // Would be shared$obj = $loader->load('Bar'); // Would be shared$obj = $loader->load('BumbleBee'); // Would provide a new instance every time.$obj = $loader->load('BumbleBee', [], true); // BumbleBee is now shared.$loader->free('BumbleBee'); // Is not shared anymore.

Phew, that was quite a lot. I hope this isn't too overwhelming. All the things I have pointed out are issues that I have experienced as solved like shown. Every single change may not suit your framework, but they helped me.

As promised I have listed some resources you can look at. I learned a lot even though some of them isn't PHP they certainly do apply.

• Most of the resources linked at the bottom of this epic answer.
• Dependency injection
• (Advanced) SOLID Design principle. Not all of the principles can be easily achieved, but having them in mind while coding will help you out later, I know it have for me.
• Document your code . The code you have provided are relatively simple. But when you have grown into a PHP guru and others look up to your code (or yourself six months later), good documentation of the more complex code is good. Do not document every single little array look up or variable initialization, but when the code doesn't immediately reveal its purpose documentation is lovely.

Happy coding out there!

• Thank you @anotherguy for you answer. To be honest I first started by creating a class I called core which used methods similar to yours suggestions. I thought I might change the structure to use a Initializer and Loader class. I then thought using using autoloader might help simply it. You have given me a few things to consider. Thank you for your time. Since you suggested modification resemble my core class will with continue to build off it. Feb 2 '15 at 15:33
• I'm sorry but I must say that your introduction was a little surprising and hurtful but still taken as a honest observation from a peer. Feb 2 '15 at 15:39
• Im glad to hear you took it as an honest observation. I had no intention of making it sound hurtful in any way, but now that I read it again I can understand your point, sorry. The point of my introduction is that I think you are taking a wonderful opportunity to learn and you should keep going. The reason I may have been a little rough is that I wanted to spare you for many simple mistakes that is hard to learn and few tutorials if any actually show you. Feb 2 '15 at 17:44
• Once again thank you for your answer @anotherguy it really does help. As I continue to build I do hope that you might take the time to review future posts. I am open to all comments and suggestions from everyone. Feb 2 '15 at 18:15
• I will keep an eye out for your posts. It seems I learned something new today as well. Feb 2 '15 at 19:21


text:
## Elementary Geometry for College Students (6th Edition)

$\sqrt 80$ units
(-4,1) and (4,5) To find the distance between the two points we need to use the distance formula $\sqrt (x2-x1)^{2} + (y2-y1)^{2}$ $\sqrt (4+4)^{2} + (5-1)^{2}$ $\sqrt (8)^{2} + 4^{2}$ = $\sqrt 80$ units


text:
# Confused on the interpretation of regression coefficients

Let's suppose we have the following regression model:

$$Y_i=\beta_0+\beta_1D_i+\beta_2D_iX_i+\epsilon_i$$ where $Y_i$ represents the test score of the i-th student, $D_i$ is a dummy variable that takes the value 1 if the student's family is an immigrant and 0 otherwise, and $X_i$ is also a dummy variable that takes 1 if the student's father has an above average income.

Now if I were to describe what the coefficients $B_0,B_1,B_2$ mean how would I go about doing that?

I believe $B_0$ is simply the slope. $B_1$ is the change in the mean test score ($Y_i$) when comparing a family who is an immigrant with a non-immigrant. $B_2$ is a bit more difficult. The answers I have here are that $B_2$ is just the effect of father's income on immigrant students' average test score.

I'm a bit confused as to how to correctly interpret these coefficients (especially when there is interaction) and help would be greatly appreciated!

$\bf{EDIT}$: Here is an original picture of the question since it appears as though my professor's model is a bit out of the ordinary.

• Your model is unusual. You don't have a term w/ only X & not also D, but then you have an interaction term. This is usually a bad thing to do, but perhaps this is intended as the data generating process. Are you sure you want it that way? Also, we don't usually add the $_i$s w/ capital letters. The caps indicate random variables, whereas lower case are realized values & the subscript indexes which realization out of the set is being referred to. – gung - Reinstate Monica Feb 22 '15 at 18:02
• @gung I am not sure if this is unusual but this is how my professor gave it. I can attach a photo of the original problem in the edited question. – nicefella Feb 22 '15 at 18:05
• Hmmm, it might help if you showed the exact question. You may also benefit from reading some related, existing answers. I have relevant answers here & here. – gung - Reinstate Monica Feb 22 '15 at 18:08

You can lay out different scenarios in a table like this:

The 1 and 0 indicates if the regression estimates will be included (1) or excluded (0)

Since there isn't an indicator just for father's income, both non-immigrants with either rich or poor father were grouped together, represented just by the intercept, $\beta_0$.

Now, if we recast this into a 2x2 table, it'd be easier to look at:

Pay attention to which two groups that are only differ by $\beta_2$, and those are the groups whose mean difference $\beta_2$ is intended to capture. Hints: focus on the last column.

You have 3 different types of students described by the regression equation.

1. non-immigrants
2. immigrants without fathers earning above average income
3. immigrants with fathers earning above average income

Consider the value of $\beta_0+\beta_1D_i+\beta_2D_iX_i$ in each of the above cases as it will help you interpret the coefficients.

• Could you please go a little bit more in depth? I understand that $D_i$ is immigrant/non-immigrant but for 2/3 why do we not have non-immigrants without fathers earning above average income and non-immigrants with father earning above average income? Why is it that in the interaction term, we keep $D=1$ while we change $X$ but not vice versa (so why don't we do $D=0$ while we change $X$ – nicefella Feb 22 '15 at 22:26
• This is the way the regression is set up, if a student is non-immigrant, $D_i=0$ and so $X_i$ does not enter into the equation for non-immigrants. I cannot tell you why the regression is set up this way, perhaps whoever wrote it wanted to focus more on interpreting coefficients instead of conventional specification. The regression you are thinking of is $$Y_i=\beta_0+\beta_1D_i+\beta_2X_iD_i+\beta_3X_i$$. In which case non-immigrants would be split into two further groups; those with and without fathers earning above average income. But this isn't whats given. – Zachary Blumenfeld Feb 22 '15 at 22:40
• By systematically going through each type of student above and calculating $\beta_0+\beta_1D_i+\beta_2X_i$ you should be able to interpret the coefficients better. – Zachary Blumenfeld Feb 22 '15 at 22:43

If your model were as follows: $$y_i = B_0 + B_1*\text{Immigrant}_i +B_2*\text{UpperIncome}_i +B_3*\text{Immigrant}_i*\text{UpperIncome}_i + e_i,$$ where $$\text{Immigrant}_i$$ and $$\text{UpperIncome}_i$$ were 0,1 dummy variables, then $$B_1$$ would be the effect of immigrant status when $$\text{UpperIncome}$$ status = 0, and the effect of immigrant status is $$B_1 + B_3$$ when $$\text{UpperIncome}$$ status = 1. Similarly, $$B_2$$ would be the effect of $$\text{UpperIncome}$$ status = 1 when Immigrant status = 0, and the effect of UpperIncome status is $$B2 + B3$$ when Immigrant status = 1. If there is no interaction ($$B_3 = 0$$), then the effect of Immigrant status is independent of UpperIncome status and vice versa.

• True, but given that that isn't the model, this is of only partial use to the OP. In addition, please note our policies regarding answering [self-study] questions (viz: provide hints only). – gung - Reinstate Monica Feb 22 '15 at 18:34


text:
Percentiles for ungrouped data

Percentiles are the values of arranged data which divide whole data into hundred equal parts. They are 9 in numbers namely $P_1,P_2, \cdots, P_{99}$. Here $P_1$ is first percentile, $P_2$ is second percentile, $P_3$ is third percentile and so on.

Formula

The formula for $i^{th}$ percentile is

$P_i =$ Value of $\bigg(\dfrac{i(N+1)}{100}\bigg)^{th}$ observation, $i=1,2,3,\cdots,99$

where $N$ is the total number of observations.


text:
# Notes on Kleinberg and Slivkins, Sharp Dichotomies for Regret Minimization in Metric Spaces

As with all my handwritten notes, this has the usual disclaimer: these posts are just so I can use nice inedxed search to easily search for my notes, which are sufficient for me to recall talks and papers but probably not much use to anyone else. Paper here. Slides here, password protected, because Alex asked me not to distribute them (sorry, folks).

The Lipschitz multi-armed bandit (MAB) problem generalizes the classical multi-armed bandit problem by assuming one is given side information consisting of a priori upper bounds on the difference in expected payoff between certain pairs of strategies. Classical results of (Lai and Robbins 1985) and (Auer et al. 2002) imply a logarithmic regret bound for the Lipschitz MAB problem on finite metric spaces. Recent results on continuum-armed bandit problems and their generalizations imply lower bounds of $\sqrt{t}$, or stronger, for many infinite metric spaces such as the unit interval. Is this dichotomy universal? We prove that the answer is yes: for every metric space, the optimal regret of a Lipschitz MAB algorithm is either bounded above by any $f\in \omega(\log t)$, or bounded below by any $g\in o(\sqrt{t})$. Perhaps surprisingly, this dichotomy does not coincide with the distinction between finite and infinite metric spaces; instead it depends on whether the completion of the metric space is compact and countable. Our proof connects upper and lower bound techniques in online learning with classical topological notions such as perfect sets and the Cantor-Bendixson theorem. Among many other results, we show a similar dichotomy for the “full-feedback” (a.k.a., “best-expert”) version.


text:
# Context: proveit.logic.set_theory.enumeration¶

Enumeration provides a simple way to define a finite set via enumerating the containing elements. For example, $S = \{e_1, e_2, e_3\}$, is the set containing only $e_1$, $e_2$, and $e_3$. That is, $x \in S$ if $x=e_1$ or $x=e_2$ or $x=e_3$; otherwise, $x \notin S$.

In [1]:
import proveit
%context