text:
## Measure of sums

Consider a set X, define $\displaystyle f:X \rightarrow [0, \infty ]$ by $\displaystyle f(x)=1 \ \ \ \ \forall x \in X$.

Let $\displaystyle E \subset \mathbb {P}(X)$, the set of all subsets in X.

Define $\displaystyle \mu (E)= \sum _{x \in E } f(x) = sup \{ \sum _{x \in F } f(x) : F \subset E, F \ finite \ \}$

Prove that $\displaystyle \mu$ is a measure.

Proof.

Let $\displaystyle E_1,E_2,... \subset X$, with all $\displaystyle E_n$ disjoint.

I claim that $\displaystyle \mu ( \bigcup ^{ \infty }_{n=1}E_n)= \sum ^{ \infty }_{n=1} \mu (E_n)$

Now suppose that $\displaystyle F \subset \bigcup ^{ \infty } _{n=1} E_n$ is the largest finite subset.

Then $\displaystyle F = F_1 \bigcup F_2 \bigcup F_3 \bigcup . . . = \bigcup _{n=1}^{ \infty }$ for $\displaystyle F_n \subset E_n$ the biggest subset. Note that $\displaystyle F_n$ are disjoint since each $\displaystyle E_n$ is disjoint.

Then we have $\displaystyle |F|=|F_1|+|F_2|+...$

It follows that $\displaystyle \mu ( \bigcup ^ \infty _{n=1} E_n ) = sup \{ \sum _{x \in F } f(x) : F \subset \bigcup _{n=1}^ \infty En, F \ finite \ \} $$\displaystyle = \sum _{x \in F } f(x) \displaystyle =|F|=|F_1|+|F_2|+...= \sum _{x \in F_1 } f(x) + \sum _{x \in F_2 } f(x) + . . . =$$\displaystyle \mu (E_1)+ \mu (E_2) + . . . = \sum ^ \infty _{n=1} \mu (E_n)$

Therefore $\displaystyle \mu$ is a measure.

Is this okay? I know that idea should be right, but it is just the part about choosing the largest finite subset could be a bit verge.

Thank you!


text:
Parameters

 options - (optional) equation(s) of the form name = value

Returns

 • list : list of the attachments in the linked model

Description

 • A:-ListAttachments returns the list of names of the existing attachments in the linked model A.
 • The A := MapleSim:-LinkModel() statement needs to be run prior to successfully using any of the ModelObject A's export functions.

Examples

 > $A≔\mathrm{MapleSim}:-\mathrm{LinkModel}\left('\mathrm{filename}'=\mathrm{cat}\left(\mathrm{kernelopts}\left('\mathrm{toolboxdir}'=\mathrm{MapleSim}\right),"/data/examples/RLCcircuit.msim"\right)\right):$

 > $\mathrm{data}≔"this will be the ship"$
 ${\mathrm{data}}{:=}{"this will be the ship"}$ (1)
 > $A:-\mathrm{SetAttachment}\left("data.txt",\mathrm{data},'\mathrm{category}'="other"\right)$

 > $A:-\mathrm{ListAttachments}\left(\right)$
 $\left[{"data.txt"}\right]$ (2)

List the attachments with the categories.

 > $A:-\mathrm{ListAttachments}\left(\mathrm{showcategories}\right)$
 $\left[\left[{"data.txt"}{,}{"other"}\right]\right]$ (3)

format: plain


text:
# Plot with x-axis in radians with ticks at multiples of pi

I have a plot where the x-axis is an angle in radians. Is there an easy way to make the ticks and the tick labels be multiples of pi?

For example, I would like to obtain a figure like this:

You may check this example from il bel paese.

A working example with Plots.jl:

using Plots, LaTeXStrings
pyplot(fmt=:svg)

function pitick(start, stop, denom; mode=:text)
a = Int(cld(start, π/denom))
b = Int(fld(stop, π/denom))
tick = range(a*π/denom, b*π/denom; step=π/denom)
ticklabel = piticklabel.((a:b) .// denom, Val(mode))
tick, ticklabel
end

function piticklabel(x::Rational, ::Val{:text})
iszero(x) && return "0"
S = x < 0 ? "-" : ""
n, d = abs(numerator(x)), denominator(x)
N = n == 1 ? "" : repr(n)
d == 1 && return S * N * "π"
S * N * "π/" * repr(d)
end

function piticklabel(x::Rational, ::Val{:latex})
iszero(x) && return L"0"
S = x < 0 ? "-" : ""
n, d = abs(numerator(x)), denominator(x)
N = n == 1 ? "" : repr(n)
d == 1 && return L"%$S%$N\pi"
L"%$S\frac{%$N\pi}{%$d}" end a, b = -2π, 2π plot(sin, a, b; xtick=pitick(a, b, 4), label="y = sin(x)", size=(720, 250))  plot(sin, a, b; xtick=pitick(a, b, 4; mode=:latex), label="y = sin(x)", size=(720, 250), tickfontsize=10)  Edit: LaTeX style tick labels 7 Likes A solution with Makie: using CairoMakie format_π_fracs(xs; denom=round(Int, π/minimum(diff(xs)))) = map(xs) do x # This will error if x is not an expected fraction of π frac = Int(round(x/(π/denom), digits=1))//denom sign = x < 0 ? "-" : "" absnum = abs(frac.num) == 1 ? "" : string(abs(frac.num)) frac.den == 1 && return frac.num == 0 ? L"0" : L"%$sign%$(absnum)\pi" return L"%$sign\frac{%$(absnum)\pi}{%$(frac.den)}"
end

lines(-2π..2π, sin, figure=(; resolution=(600, 200)),
axis=(xticks=-2π:π/2:2π, xtickformat=format_π_fracs))

5 Likes


text:
## Elliptical Discussions

Posted in Cute Problems, Education, Maynooth, The Universe and Stuff with tags , , on April 7, 2022 by telescoper

It’s the ninth week of Semester 2 and I’m coming to the end of lectures and laboratory sessions for my Computational Physics module; for the remaining three weeks (plus the Easter vacation) the students in this class will be mainly concentrating on the mini-projects that form part of the assessment.

This afternoon, though we had a session on how to transform higher-order differential equations into sets of coupled first-order ODEs suitable for vectorization and consequent solution using standard techniques. The problem we focussed on today was the simple problem of orbital motion of a test particle under the gravitational force in plane-polar coordinates, which can be prepared for physical solution thusly:

This sort of thing reminds me of my undergraduate theory project at Cambridge, where I did a similar thing to solve the equations governing the action of a four-level laser, though that was in Fortran rather than Python. In my own solution I used Python’s off-the-shelf solver `odeint`.

I like the orbital motion problem a lot because it’s a bit more than a coding exercise: students have to think about how to choose initial data, how to test the their code and interpret the results. Even before that there’s the issue of what units to use; SI units are a bit daft for astronomical problems. For solar system calculations it makes sense to use Astronomical Units for distances and years for time; in such a system it’s easy to work out that GM is just 4π2, which avoids having to deal with ridiculously large or ridiculously small numbers.

Anyway, the fun thing about this lab was that once everyone had got their code working they could try setting initial data to get a circular orbit as a special case, explore how the shape of elliptical orbits depends on the input data, how to make an unbound orbit, and so on. It’s important to understand the output of a numerical calculation in terms of basic physical principles. All that led to a discussion in class of solar system exploration, transfer orbits, what would happen if the mass of the Sun suddenly changed, or if G was a function of time, and lots of other things.

I find sessions like this that encourage students to explore problems themselves very rewarding and I think they add a valuable extra dimension to standard teaching formats. I hope the projects that they’ll be doing from now on – involving topics in areas ranging from atomic physics, cosmology, particle physics and climate science, and done in groups – will provoke even more discussion of this type.

## A Day of Computing

Posted in Biographical, Education, Maynooth, The Universe and Stuff with tags , , , , , , on February 3, 2022 by telescoper

Last Semester, Thursday was what I optimistically called a “Research Day” (on the basis that I had no teaching on it). This Semester it’s one of my busiest teaching days, with lecturing in the morning and a lab session in the afternoon, both for Computational Physics.

For most of the last two years I’ve been delivering the lectures and running the lab remotely, but now that we’re back teaching face-to-face I gave the lecture in person and was in the lab with the class for this afternoon’s session. I’ve got about twice as many students this year as last year swill be running two lab sessions (one next Tuesday repeating the material from the Thursday one, and so on throughout the term).

Running the lab remotely worked reasonably well because Python is available to download for free and works on a standard Windows-based PC. In the lab however we use a Linux (Ubuntu) system, which gives the students the chance to try a different operating system (and one which is for many purposes better than Windows).

It’s good to be back running the computing laboratory class in person but I was a bit nervous this morning because since I last did it that way the machines we have in our laboratory have all been upgraded to a new operating system and have a new (and very different) version of Python (3.9 versus the now obsolete 2.7). I’ve been around long enough to realize that things can go wrong in such situations, so I warned the class during this morning’s lecture that there might be teething troubles. Sure enough we had quite a few technical glitches but, to be honest, it it could have been a lot worse. Next Tuesday’s lab should be a bit less stressful as we’ve fixed a few of the things that went wrong.

So, by no means a disaster, but a busy and quite stressful day. Time to go home and relax.

## Ireland’s Covid-19 Models

Posted in Covid-19, mathematics, Maynooth with tags , , , , , on July 1, 2021 by telescoper

Yesterday the Chair of the National Public Health Emergency Team (NPHET), who also happens to be the President of Maynooth University, Professor Philip Nolan published a lengthy but interesting Twitter thread (which you can find unrolled here). In these tweets he explained the reason behind NPHET’s recommendation to pause the process of relaxing Covid-19 restrictions, postponing the next phase which was due to begin on 5th July with indoor dining.

The basic reason for this is obvious. When restrictions were lifted last summer the reproduction number increased to a value in the range 1.4 to 1.6 but the infection rate was then just a handful per day (on July 1st 2020 the number of new cases reported was 6). Now the figures are orders of magnitude higher (yesterday saw 452 new cases). A period of exponential growth starting from such a high base would be catastrophic. It was bad enough last year starting from much lower levels and the Delta variant currently in circulation is more transmissable. Vaccination obviously helps, but only about 40% of the Irish population is fully immunized.

Incidentally the target earlier this year was that 82% of the adult population should have received one jab. We are missing detailed numbers because of the recent ransomware attack on the HSE system, but it is clear that number has been missed by a considerable margin. The correct figure is more like 67%. Moreover, one dose does not provide adequate protection against the Delta variant so we’re really not in a good position this summer. In fact I think there’s a strong possibility that we’ll be starting the 2021/22 academic year in worse shape than we did last year.

In general think the Government’s decision was entirely reasonable, though it obviously didn’t go down well with the hospitality sector and others. What does not seem reasonable to me is the suggestion that restaurants should be open for indoor dining only for people who are fully vaccinated. This would not only be very difficult to police, but also ignores the fact that the vast majority of people serving food in such environments would not be vaccinated and are therefore at high risk.

As things stand, I think it highly unlikely that campuses will be open in September. Rapidly growing pockets of Delta variant have already been seeded in Ireland (and elsewhere in Europe). It seems much more likely to me that September will see us yet again in a hard lockdown with all teaching online.

But the main reason for writing this post is that the thread I mentioned above includes a link to a paper on the arXiv (by Gleeson et al.) that describes the model used to describe the pandemic here in Ireland. Here is the abstract:

We describe the population-based SEIR (susceptible, exposed, infected, removed) model developed by the Irish Epidemiological Modelling Advisory Group (IEMAG), which advises the Irish government on COVID-19 responses. The model assumes a time-varying effective contact rate (equivalently, a time-varying reproduction number) to model the effect of non-pharmaceutical interventions. A crucial technical challenge in applying such models is their accurate calibration to observed data, e.g., to the daily number of confirmed new cases, as the past history of the disease strongly affects predictions of future scenarios. We demonstrate an approach based on inversion of the SEIR equations in conjunction with statistical modelling and spline-fitting of the data, to produce a robust methodology for calibration of a wide class of models of this type.

This model is a more complicated variation of the standard compartment-based models described here. Here’s a schematic of the structure:

This model that makes a number of simplifying assumptions but it does capture the main features of the growth of the pandemic reasonably well.

Coincidentally I set a Computational Physics project this year that involved developing a Python code that does numerical solutions of this model. It’s not physics of course, but the network of equations is similar to what you mind find in physical systems – it’s basically just a set of coupled ODEs- and I thought it would be interesting because it was topical. The main point is that if you study Theoretical Physics you can apply the knowledge and skills you obtain in a huge range of fields and disciplines. Developing the model does of course require domain-specific epidemiological knowledge but the general task of modelling complex time-evolving systems is definitely something physicists should be adept at doing. Transferable skills is the name of the game!

P.S. It came as no surprise to learn that the first author of the modelling paper, Prof. James Gleeson of the University of Limerick, has an MSc in Mathematical Physics.

## Language Lessons

Posted in History, Irish Language, Maynooth with tags , , , , , , , , , , on February 4, 2021 by telescoper

Thursday is Computational Physics Day this term so this morning I delivered the first Panopto lecture of that module and in the afternoon we had our first laboratory session. The students are all at home of course so we had to run the lab with them using their own laptops rather than the dedicated Linux cluster we have in the Department and interacting via Microsoft Teams.  The first lab is very introductory so it was really just me presenting and them following on their machines without too much interaction. The ability to share a screen is actually very useful though and I imagine using it quite a lot to share Spyder. It went fairly well, I think, with all the students getting started out on the business of learning Python.

In between lecturing the morning and running the laboratory session this afternoon I had the chance to study another kind of language. Soon after I first arrived in Maynooth I got an email from Maynooth University about Irish language classes. Feeling a bit ashamed about not having learned Welsh in all my time in Cardiff, I thought I’d sign up for the Beginners class and fill in a Doodle Poll to help the organizers schedule it. Unfortunately, when the result was announced  it was at a time that I couldn’t make owing to teaching, so I couldn’t do it. That  happened a couple of times, in fact. This year however I’ve managed to register at a time I can make, though obviously the sessions are online.

I’m not sure how wise it is for me to try learning a new language during a term as busy as this, but I have to say I enjoyed the first session enormously. It was all very introductory, but I’ve learnt a few things about pronunciation – unsurprisingly the Irish word for pronunciation fuaimniú is unsurprisingly quite difficult to pronounce – and the difference between slender and broad vowels. I also learnt that to construct a verbal noun, instead of putting -ing on the end as you would in English, in Irish you use the word ag in front of the verb.

That’s not to say I had no problems. I’m still not sure I can say  Dia duit (hello) properly. The second “d” is hardly pronounced.

Irish isn’t much like Welsh, which I failed to learn previously.  Although Irish and Welsh are both Celtic languages they are from two distinct groups: the Goidelic group that comprises Irish, Manx and Scottish Gaelic; and the Brythonic group that comprises Welsh, Cornish and Breton. These are sometimes referred to as q-Celtic and p-Celtic, respectively, although not everyone agrees that is a useful categorization. Incidentally, Scottish Gaelic is not the language spoken by the Celtic people who lived in Scotland at the time of the Romans, the Picts, which is lost. Scottish Gaelic is actually descended from Middle Irish. Also incidentally, Breton was taken to Brittany by a mass migration of people from South-West Britain fleeing the Anglo-Saxons which peaked somewhere around 500 AD. I guess that was the first Brexodus.

Welsh and Irish don’t sound at all similar to me, which is not surprising really. It is thought that the Brythonic languages evolved from a language  brought to Britain by people from somewhere in Gaul (probably Northern France), whereas the people whose language led to the Goidelic tongues were probably from somewhere in the Iberia (modern-day Spain or Portugal). The modern versions of Irish and Welsh do contain words borrowed from Latin, French and English so there are similarities there too.

Only a diacritic mark appears in Irish, the síneadh fada (`long accent’), sometimes called the fada for short, which looks the same as the acute accent in, e.g., French. There’s actually one in síneadh if you look hard enough. It just means the vowel is pronounced long (i.e. the first syllable of síneadh is pronounced SHEEN). The word sean (meaning old) is pronounced like “shan” whereas Seán the name is pronounced “Shawn”.

One does find quite a few texts (especially online) where the fada is carelessly omitted, but it really is quite important. For example Cáca is the Irish word for `cake’, while the unaccented Caca means `excrement’…

I took the above text in Irish and English from the front cover of an old examination paper. You can see the accents as well as another feature of Irish which is slightly similar to Welsh, the mysterious lower-case h in front of Éireann. This is a consequence of an initial mutation, in which the initial character of word changes in various situations according to syntax or morphology (i.e. following certain words changing the case of a noun or following certain sounds). This specific case is an an example of h-prothesis (of an initial vowel).

In Welsh, mutations involve the substitution of one character for another. For example, `Wales’ is Cymru but if you cross the border into Wales you may see a sign saying Croeso i Gymru, the `C’ having mutated. The Irish language is a bit friendlier to the learner than Welsh, however, as the mutated character (h in the example above) is inserted in front of the unmutated character. Seeing both the mutated and unmutated character helps a person with limited vocabulary (such as myself) figure out what’s going on.

Mutations of consonants also occur in Irish. These can involve lenition (literally `weakening’, also known as aspiration) or eclipsis (nasalisation). In the case of eclipsis the unmutated consonant is preceded by another denoting the actual sound, e.g. b becomes m in terms of pronunciation, but what is written is mb. On the other hand, lenition is denoted by an following the unmutated consonant. In older forms of Irish the overdot (ponc séimhithe) -another diacritic – was used to denote lenition.

Anyway, I’ve seen Dia duit written Dia dhuit which might explain why the d sounds so weak. We live and learn. If I keep at it long enough I might eventually be able to understand the TG4 commentary on the hurling..

## The Start of Spring Semester

Posted in Biographical, Education, Maynooth with tags , , , , , , , on February 1, 2021 by telescoper

It’s February 1st 2021, which means that today is Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox, i.e. it’s a Cross-Quarter Day. To be pedantic, Imbolc is actually the period between this evening and tomorrow evening as in the Celtic calendar days were counted from sunset to sunset.

The first Day of February is also the Feast day of St Brigid of Kildare (c. 451-525), one of Ireland’s patron saints along with Saints Patrick and Colm Cille. One of her miraculous powers was the ability to change water into ale, which perhaps explains her enduring popularity among the Irish.

In Ireland this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’. According to legend it is also the day on which jackdaws mate. Given how many of them there are around Maynooth there should be a lot of action today.

Today is, appropriately enough in the light of all this, the start of the Spring Semester of teaching at Maynooth University, the fourth Spring Semester I will have experienced here although this is obviously not like the others in that we’ll be teaching online at least for the first half and probably for the entirety. I was planning to stay at home today but I realised I’d left some things I need in the office on campus so will have to go to collect them. That’s why I’m up early. That and the need to shake myself out of the lockdown torpor that has afflicted me since New Year. It’s time to get my act together, pull my finger out, put my best foot forward, etc.

This Semester I am teaching Engineering Mathematics II, Computational Physics I and Advanced Electromagnetism. The former, what you would probably call a `service course’, covers a mixture of things, mainly Linear Algebra but with some other bits thrown in for fun, such as Laplace transforms. Interestingly I find the Mathematical Physics students do not encounter Laplace Transforms in the first year, but perhaps engineers use them more often than physicists do? I think I’ve written only one paper that made use of a Laplace transform. Anyway, I have to start with this topic as the students need some knowledge of it for some other module they’re taking this semester. I reckon six lectures will be enough to give them what they need. That’s two weeks of lectures, there being three lectures a week for this module.

Once again my teaching timetable for this module is quite nice. I have lectures on Monday, Tuesday and Wednesday and then the students have a choice of tutorial (on either Thursday or Friday). That means I can get through a decent amount of material each week before each tutorial. I don’t do the tutorials, by the way: that’s left to one of our PhD students, who gets paid for doing that and correcting the weekly coursework. There are about 50 students on this module, divided into two courses: Electronic Engineering and Robotics and Intelligent Devices. We don’t have Civil or Mechanical or Chemical Engineering, etc, at Maynooth, in case you were wondering. Lectures will be done as webcasts using Panopto but also recorded for later viewing.

My first Computational Physics lecture, which I will do from home, is on Thursday, after which there is a lab session which we will do via Microsoft Teams. That’s the way we did it after lockdown last year and it worked OK. Students attend one two-hour lab session in addition to the lecture, on either Thursday or Tuesday. The first lecture being on Thursday the first lab session will be Thursday afternoon, with the same material being covered the following Tuesday. Fortunately, Python is free to download and easy to install so it’s quite straightforward to run the labs remotely. Teams has a screen sharing facility so it’s quite easy for myself or my demonstrator to see what is wrong in the same way we would do in a laboratory class.

The Advanced Electromagnetism module is a new one for me but I’m quite looking forward to it. Being a final-year module its content is less prescriptive than others and I’ll be adding a few things that I find interesting. Both lectures for that one are on Wednesdays and again will be given as webcasts with recordings available later.

Today is a particularly busy day because in addition to my first lecture (at 2pm) I have a meeting of Academic Council (3pm via Teams), a Euclid telecon (via Zoom) and a meeting with my PhD student via Teams. I have also been trying to sort out tutors and tutorials for the forthcoming Semester: these don’t start until next week so there’s time, but it has been quite a challenge to get everyone sorted. Fortunately I think that’s now done.

Oh, and another thing. I signed up for Irish language lessons (Beginners Level) and will be having classes once a week from now on.

It’s going to be a very busy term but I reckon being busy is probably going to be a good way to get through the next few months.

## Spring Semester Starts

Posted in Biographical, Education, Maynooth with tags , , , , , , on February 3, 2020 by telescoper

It’s February 3rd 2020, which means that today is two days after Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox. The 1st Day of February is also the Feast day of St Brigid of Kildare (c. 451-525), one of Ireland’s patron saints along with Saints Patrick and Colm Cille. One of her miraculous powers was the ability to change water into ale, which perhaps explains her enduring popularity among the Irish.

In Ireland this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’.

Today is, appropriately enough in the light of all this, the start of the Spring Semester of teaching at Maynooth University, the third Spring Semester I will have experienced here. The weather has even played along; it has definitely been spring-like. The Campus, whicgh has beenhas been very quiet for the last week or so since the examinations finished, is full of students again.

This Semester, as was the case last year, I am teaching Engineering Mathematics II and Computational Physics I. The former, what you would probably call a `service course’, covers a mixture of things, mainly Linear Algebra but with some other bits thrown in for fun, such as Laplace transforms. Interestingly I find the Mathematical Physics students do not encounter Laplace Transforms in the first year, but perhaps engineers use them more often than physicists do? I think I’ve written only one paper that made use of a Laplace transform. Anyway, I have to start with this topic as the students need some knowledge of it for some other module they’re taking this semester. I reckon six lectures will be enough to give them what they need. That’s two weeks of lectures, there being three lectures a week for this module.

Once again my teaching timetable for this module is quite nice. I have lectures on Monday, Tuesday and Wednesday and then the students have a choice of tutorial (on either Thursday or Friday). That means I can get through a decent amount of material each week before each tutorial. I don’t do the tutorials, by the way: that’s left to one of our PhD students, who gets paid for doing that and correcting the weekly coursework. There are about 50 students on this module, divided into two courses: Electronic Engineering and Robotics and Intelligent Devices. We don’t have Civil or Mechanical or Chemical Engineering, etc at Maynooth, in case you were wondering.

Anyway, my first lecture was this afternoon at 2pm and had a good turnout. It was so sunny outside that we had to close all the blinds. That’s quite an unusual event for a February lecture!

My first Computational Physics lecture is on Thursday, after which it will be back to the Department for some frantic behind-the-scenes activity ahead of the afternoon lab session, which is in a computer room near my office. Students attend one two-hour lab session in addition to the lecture, on either Thursday or Tuesday. The first lecture being on Thursday the first lab session will be Thursday afternoon, with the same material being covered the following Tuesday.

While my teaching duties are the same this year as they were in the corresponding semester last year, there is a significant difference this year in that I am now also Head of Department. Either side of my first lecture I had to attend a meeting of the Faculty Executive for Science & Engineering, a meeting on `Project LEGO’ (which, sadly, did not involve any actual Lego but was instead about the proposed redesign of the University’s website) and a meeting of Academic Council. I have also been trying to sort out tutors and tutorials for the forthcoming Semester: these don’t start until next week so there’s time, but it’s quite a challenge to get everyone sorted out. A few timetable clashes have also come to light. So, in summary, I’m a bit worn out after today and will shortly go home to vegetate.

At least I didn’t have to find time for the regular Monday afternoon Euclid telecon in which I usually participate. There wasn’t one today because the working group of which I am part is actually meeting in person for a few days… in Paris! I couldn’t go because of all the above!

## Marking the End of Term

Posted in Maynooth with tags , , , , , on May 11, 2019 by telescoper

So here we are, then. The term is finally over. Lectures officially finished yesterday, and there’s now another week or so before examinations start (next Friday, 17th May). The examinations for my two modules take place on Tuesday 21st and Wednesday 22nd May, and after that I’ll be busy with marking for a while. In fact, I’ll probably be getting much busier in general pretty soon, but more of that in due course…

Marking doesn’t just mean written examinations. I have been teaching a module on Computational Physics to 3rd Year students here in Maynooth, and 40% of the assessment for that is a mini-project (usually done in groups of two or three). Early on the term, I put up a list of a dozen or so projects and ask them to pick first second and third choices so I can form groups in such a way that most students get to work on a project they like the look of. This year I made up a new set of projects, but I feel a bit sorry for one of them (`Scattering in a Spherical Potential’), which didn’t appear anywhere \at all on any student’s list of preferences. That’s a shame as I thought it was a well-rounded project, with lots of potential. Hopefully it will prove more popular next year…

Anyway, the deadline for projects to be handed in came yesterday so I’ve got a stack of those to mark which, you will realise, why I am indulging in a displacement activity by writing this blog post. My plan is to mark these next week so that they’re done before the written examinations come in.

Before I get on with what I should be doing I’ll just mention another thing that happened yesterday: the President of Ireland (Uachtarán na hÉireann), Michael D. Higgins visited Maynooth University yesterday:

That’s him at the front, on the right, of course. The reason for his visit was to attend a memorial service.

Posted in Biographical, Education, mathematics, Maynooth, Music with tags , , , , on February 3, 2019 by telescoper

It’s 3rd February 2019, which means that today is two days after Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox. This either happens 1st or 2nd February, and this year it was former, i.e. last Friday In Ireland this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’.

I wrote a post about this time last year, on the day I gave my first ever lecture in Maynooth University, on Computational Physics, in a theatre called Physics Hall. That was on Thursday February 1st 2018. It’s hard to believe that was a full year ago. Time certainly has gone quickly this year.

Owing to the vagaries of the academic calendar we’re a week later getting back to teaching this year than last year so my first Computational Physics lecture won’t be until this Thursday (7th February) at 9am, but sadly it won’t be in Physics Hall, which I rather liked, but in Hall C – a much less atmospheric venue, but one rather closer to my office, which will be handy if I forget anything (which I am prone to do). There are about 25 students taking this module, a few down on last year, which means they should fit comfortably into our computer lab. I’m not surprised they moved the lecture, really. The capacity of Physics Hall is 90, and even last year I only had about 30 students. Still, it did have a piano (which Hall C does not):

Computational Physics doesn’t start until Thursday. Before that I have to start my other module: Engineering Mathematics II. This (what you would probably call a `service course’) covers a mixture of things, mainly Linear Algebra but with some other bits thrown in for fun, such as Laplace transforms. Interestingly I find the Mathematical Physics students do not encounter Laplace Transforms in the first year, but perhaps engineers use them more often than physicists do? I think I’ve written only one paper that made use of a Laplace transform. Anyway, I have to start with this topic as the students need some knowledge of it for some other module they’re taking this semester. I reckon six lectures will be enough to give them what they need. That’s two weeks of lectures, there being three lectures a week for this module.

By coincidence rather than good planning, the timetable for this module is quite nice. I have lectures on Monday, Tuesday and Wednesday and then the students have a choice of tutorial (on either Thursday or Friday). That means I can get through a decent amount of material each week before each tutorial. I don’t do the tutorials, by the way: that’s left to one of our PhD students, who gets paid for doing that and correcting the weekly coursework. There are about 50 students on this module, divided into two courses: Electronic Engineering and Robotics and Intelligent Devices. We don’t have Civil or Mechanical or Chemical Engineering, etc at Maynooth.

Campus has been very quiet for the last week or so. The exam period finished in late January but lectures don’t start until tomorrow morning (Monday 4th February) so there have been few students around. No doubt it will be a different story tomorrow. I’ve done my first week’s notes and compiled my first problem set so I’m more-or-less ready to go. First lecture at 2pm tomorrow in Hall H, which is one of the rooms I taught in last term so at least I know where it is!

## Fun with the Airy Equation

Posted in Education, mathematics with tags , , , , , , on April 12, 2018 by telescoper

Today being a Maynooth Thursday, it has, as usual, has been dominated by computational physics teaching. We’re currently doing methods for solving ordinary differential equations. At the last minute before this afternoon’s lab session I decided to include an exercise that involved solving the following harmless-looking equation: $y'' = xy.$

This is usually known as Airy’s equation and it comes up quite frequently in problems connected with optics. It was first investigated by a former Astronomer Royal George Airy, after whom the function is named; incidentally, he was born in Alnwick (Northumberland, i.e. not the Midlands).

Despite its apparent simplicity, the Airy equation describes some very interesting phenomena. Indeed it is the simplest ODE (that I know of) that has the property that there’s a point at which the behaviour of the solution turns from oscillatory to exponential. Here’s a result of a numerical integration of the equation: obtained using a simple Python script:

(I stopped the integration at $x=5$ as the magnitude of the solution grows very quickly beyond that value for the particular initial conditions chosen).

One of the reasons for including this example (apart from the fact that Airy was a Geordie) is that the students were so surprised by the behaviour of the solution and most of them assumed that there was some problem with the numerical stability of their results. Some integration methods do struggle with such simple equations as the simple harmonic oscillator, but just sometimes weird numerical results are not mere numerical artifacts!

Anyway, my point is not about this particular equation or even about computational physics, but a general pedagogical one: finding interesting results for yourself is much more likely to motivate you to think about what they mean than if they’re just described to you by someone else. I think that goes for numerical experiments in a computer lab just as much as it does for any other kind of practical experiment in a science laboratory.

## Spring comes to Maynooth

Posted in Biographical, Cardiff, Maynooth with tags , , on April 5, 2018 by telescoper

After a good night’s sleep last night I was up early this morning to give my usual Thursday 9am lecture on Computational Physics. It was a bright sunny morning, though there was overnight frost and a distinct chill in the air, as I made my way to Physics Hall. Once there, for the first time this year, I had to close the blinds because the Sun was shining too bright for the projector screen. It has hitherto always been too gloomy outside for this to happen. The picture above (of St Joseph’s Square, on the South Campus) was taken as I left St Patrick’s House after a very nice lunch of roast lamb in Pugin Hall. By this time of day it was pleasantly warm.

Here’s a nice picture of the Library circulated by the Maynooth social media folk earlier today.

Anyway, this mornings’s lecture was an introduction numerical solutions of ordinary differential equations, beginning with Euler’s method applied to initial value problems. Further studies of this topic – which is very important for bidding computational physics – will take up the rest of the lectures as we explore the delights of, e.g. Runge-Kutta codes and boundary value problems. This morning’s lecture was followed this afternoon by a two-hour lab session in which the students had to write their own ODE solver.

Among the advantages (for me) of teaching this module is that I’m actually becoming reasonably competent at Python. At any rate I’ve difficult improved my ability to spot bugs in codes written by other people. In fact, it is traditional for the exam in this module to include a question that involves finding 10 mistakes in a piece of Python code. That’s a fun challenge, the only real problem for me being to write a bit of code with only 10 mistakes in it in the first place…

Talking of exams, the timetables for my two current employers are now out. Computational Physics in Maynooth is on Friday 11th May while Physics of the Early Universe in Cardiff is almost a fortnight later, on Thursday 24th May. The Easter recess is shorter here in Maynooth than in Cardiff, where lectures do not resume until April 16th (assuming the UCU strike does not continue), which is why the exams in Maynooth are earlier. I’m grateful there isn’t a clash. I should have ample time to mark the Maynooth ones before the Cardiff ones are due. After the first week or so of May I won’t have to teach in both institutions, so my somewhat hectic schedule should become a little more relaxed from then onwards.

I mentioned the UCU strike above in passing. The UCU leadership has decided that there will be an online ballot on whether to accept the `offer’ recently made by the management organisation UUK. The ballot will be open until April 13th. If the vote goes against acceptance then Cardiff staff will be back on strike from 16th April, and there will be further industrial action over the examination period. I can’t predict what the result of the ballot will be. Although the UCU leadership is recommending acceptance I don’t know anyone personally who intends to vote for it, but there’s a probably a big selection effect there! There is a distinct possibility that examinations will be badly disrupted not only in Cardiff but all over the UK. It’s a very sad state of affairs but all those on strike (and the majority of students) consider the UUK side to be to blame…


text:
# Thread: Limit of arctan(C tan(x))

1. ## Limit of arctan(C tan(x))

Hello

What is

$\mathrm{\lim_{x\rightarrow\frac{\pi}{2}}}\arctan\l eft[C\tan(x)\right]$

where $C$ is a constant. My guess is that it is $-\frac{\pi}{2}$ for $C < 0$ and $\frac{\pi}{2}$ for $C > 0$. However, if this is correct I require more technical treatment.

Many thanks in advance.

2. I evaluated this limit numerically and it obviously converges to $\pi/2$ when $C > 0$ and to $- \pi/2$ when $C < 0$ as $x$ converges to $\pi / 2$. However, I am still looking for a formal proof.
Thanks.

3. Originally Posted by JulieK
Hello

What is

$\mathrm{\lim_{x\rightarrow\frac{\pi}{2}}}\arctan\l eft[C\tan(x)\right]$

where $C$ is a constant. My guess is that it is $-\frac{\pi}{2}$ for $C < 0$ and $\frac{\pi}{2}$ for $C > 0$. However, if this is correct I require more technical treatment.

Many thanks in advance.
Dear JulieK,

The limit does not exist.

Notice that, $\lim_{x\rightarrow{\frac{\pi}{2}}^+}(\tan{x})\neq{ \lim_{x\rightarrow{\frac{\pi}{2}}^{-}}(\tan{x})}$

4. Dear Sudharaka

Thank you for your reply. Yes, you are right. But what about one-sided limits. In fact I am mainly interested in $\lim_{x\rightarrow{\frac{\pi}{2}}^-}(\arctan(C\tan{x}))$ and that is what I numerically evaluated.

5. Originally Posted by JulieK
Dear Sudharaka

Thank you for your reply. Yes, you are right. But what about one-sided limits. In fact I am mainly interested in $\lim_{x\rightarrow{\frac{\pi}{2}}^-}(\arctan(C\tan{x}))$ and that is what I numerically evaluated.
Dear JulieK,

$\lim_{x\rightarrow{\frac{\pi}{2}}^-}tan^{-1}(C\tan{x})=tan^{-1}\left[c\lim_{x\rightarrow{\frac{\pi}{2}}^-}\tan{x}\right]$ ; Since $tan^{-1}$ is continuous.

$If~c>0\Rightarrow~y=c\lim_{x\rightarrow{\frac{\pi} {2}}^-}\tan{x}=\infty$

Therefore, $\lim_{x\rightarrow{\frac{\pi}{2}}^-}tan^{-1}(C\tan{x})=\lim_{y\rightarrow\infty}tan^{-1}y=\frac{\pi}{2}$

$If~c<0\Rightarrow~y=c\lim_{x\rightarrow{\frac{\pi} {2}}^-}\tan{x}=-\infty$

Therefore, $\lim_{x\rightarrow{\frac{\pi}{2}}^-}tan^{-1}(C\tan{x})=\lim_{y\rightarrow~-\infty}tan^{-1}y=-\frac{\pi}{2}$

6. Dear Sudharaka
Thank you very much.
Best wishes
JulieK

7. Originally Posted by JulieK
Dear Sudharaka
Thank you very much.
Best wishes
JulieK
Dear JulieK,

You are welcome.


text:
# Wizard UI / Sequence Map. Skipping a step

I have 4 step process. At the top I have a typical sequence map... step 1, step 2, etc..

The contents of step 3 depends on what happens in step 2. 90% of the time the 3rd step will be full of content that was driven from step 2. However, there is the off chance that there will be 0 content to put in that screen.

So I am wondering what is a better user experience.

1. Automatically transport the person to step 4. Skipping past step 3, but leaving it in the sequence map above.
2. Automatically transport the person to step 4, and remove the 3rd step from the sequence map.
3. Let the person arrive at the 3rd step and present them with some messaging letting them know, "ain't nothing here bub, move on".

Thoughts? Recommendations? Especially interested if anyone can site a study or some data.

A few specifics should help in my particular scenario. This particular wizard process is an order process for an internal web portal. Step 1 is some setup information. Step 2 is products (browsing or typing in skus), Step 3 is a mix of information/up-sell content. For example, maybe the user has bought $300 and if they clear$350 they'll get an extra 10% off. Depending on the # of rules this can be time consuming... thus a separate step. The last step is a combination of payment and review.

-
If you're able to provide a general concept of what's happening at each step we can probably give more accurate feedback. A lot of the users' expectations will be informed by the content of the steps, naturally. Without more details it's tough to say what kind of sequence adjustments will be the least disruptive. –  Noah C Mar 8 '13 at 2:45

Interesting question.

The first option which I would prefer would be to combine step 2 and step three such so that that users can directly add information there. A example of that would be the online insurance form which might have only five steps in the navigation pane but might require you to fill in additional details if you added information such as "Yes,you do smoke" or "you have a history of heart disease"

Alternatively if that is not a viable choice, I recommend going with option one,but providing a summary which informs the user what all information was provided in each step. This method is often used by survey sites which will take you to the end of the survey if you dont satisfy a specific requirement. I have also seen this used in profile creation sites while applying for jobs where specific steps are skipped based upon your previous answers.

I understand that users might be confused if they missed a specific step but then going to a page and finding nothing there might confuse them more.

-
+1 for combining 2 & 3. Showing an empty step reminds me of rusty old Windows installations. –  JOG Mar 7 '13 at 21:00
Short term I will be skipping the step. Longer term I will try to fold the functionality of the 3rd step into the 2nd step. Also, plan on changing my sequence map to stop showing all steps spelled out and instead do something like, "Setup / Step 1 of 4". –  Scott Dietrich Mar 8 '13 at 23:20

I'd just gray it out saying that "Step 3 N/A (?)", with Step 4 being the active step, and on hover, I'd explain in a tooltip that "since you've answered blahblah at Step 2, we automatically blahblah".

Either that, or if it's the case of automatically filling out data based on some condition, I'd still let the user overview (and modify) this data, even if through an Edit button.

Like, if users have to register their billing address, and address is omitted as it already comes from the registration data, I'd still show a step 3 with a display form (ie. no field rectangles), with an "Edit my billing address" button.

-

One option could be skipping the printing out of the discrete step numbers, and replace them with a loading bar.

Step 1 Step 2 Step 3 Step 4

... you would have ...

[_ |||||||||||||||||||||||||||||||||||||| ______]

Perhaps with a percentage number.

This way the user will be less aware of that one step is omitted.

-

On the completion of Step 2, if you already know Step 3 is not required, Make your navigation say something like the following

"Finish" "Next"

If the user wants, they can proceed to the next screen. But I guess most people would prefer the Finish option.

-

Since users expect to move back and forward in a wizard like this I would go with option 3. Let the user know that there is nothing here because of their previous options and let them have the ability to move back to step 2 and 1 to change their previous choises.

Skiping over steps might let the user believe something went wrong. That builds uncertainty and cognitive load - which we want to avoid. An extra click is better than uncertainty!

-
This is what my intuition says is the right answer. I interviewed 10 people and they were split 50/50. Half said show. Half said skip. I think the best option for now is to simply ensure that there is always something there. Essentially a "good default". –  Scott Dietrich Mar 8 '13 at 23:23


text:
# A Recurrence Relation of Dynamic Programming

(For simplicity, this discussion will assume time-invariance. If ever I need to do the time-variant version of this problem, I will post about whatever differences I find.)

As discussed last time, we have the discrete-time system (actually the discrete-time equivalent of the original system) $\def\avec{\boldsymbol a} \def\uvec{\boldsymbol u} \def\xvec{\boldsymbol x} \def\dscrt{_{\mathrm D}} \xvec[k+1] = \avec\dscrt(\xvec[k], \uvec[k]),$ for which we wish to minimize the performance measure $J = h(x[N]) + \sum_{k=0}^{N-1} g\dscrt(\xvec[k], \uvec[k]).$

Now, adapting the “tedious notation” from the other post to our purposes, we have $$J_{NN}\left(\xvec(N)\right) := h(x[N])$$ defined as the cost associated with whatever final state we end up with; and \begin{aligned} J_{N-1,N}(\xvec[N-1], \uvec[N-1]) := & g\dscrt(\xvec[N-1], \uvec[N-1]) + h(x[N]) \\ = & g\dscrt(\xvec[N-1], \uvec[N-1]) + J_{NN}(\xvec[N]) \end{aligned} the cost of getting to the final state $$\xvec[N]$$ from the penultimate state $$\xvec[N-1]$$ via control $$\uvec[N-1]$$. And, since $$\xvec[N]$$ is completely determined by $$\xvec[N-1]$$ and $$\uvec[N-1]$$, we can rewrite this as $\begin{multline} J_{N-1,N}(\xvec[N-1], \uvec[N-1]) := \\ g\dscrt(\xvec[N-1], \uvec[N-1]) + J_{NN}(\avec\dscrt(\xvec[N-1], \uvec[N-1])) \end{multline}$ This yields the optimal (i.e., minimal) cost $\begin{multline} J_{N-1,N}^* (\xvec[N-1]) := \mathrm{min}_{ \{\uvec[N-1]\} } \big\{ g\dscrt(\xvec[N-1], \uvec[N-1]) \\ {} + J_{NN}(\avec\dscrt(\xvec[N-1], \uvec[N-1])) \big\} \end{multline}$ Denote this minimizing control function by $$\uvec^*(\xvec[N-1], N-1)$$.

Now consider the last two intervals together: $\begin{multline} J_{N-2,N}(\xvec[N-2], \uvec[N-2], \uvec[N-1]) \\ \shoveleft \quad = g\dscrt(\xvec[N-2], \uvec[N-2]) + g\dscrt(\xvec[N-1], \uvec[N-1]) + h(\xvec[N]) \\ \shoveleft \quad = g\dscrt(\xvec[N-2], \uvec[N-2]) + J_{N-1,N}(\xvec[N-1], \uvec[N-1]) \end{multline}$ The optimal policy for this yields the cost $\begin{multline} J_{N-2,N}^* (\xvec[N-2]) := \mathrm{min}_{ \{\uvec[N-2], \uvec[N-1]\} } \big\{ g\dscrt(\xvec[N-2], \uvec[N-2]) \\ {} + J_{N-1,N}(\xvec[N-1], \uvec[N-1]) \big\} \end{multline}$

By the principle of optimality, the remaining decision $$\uvec[N-1]$$ must be optimized with respect to $$\xvec[N-1]$$ regardless of the values of $$\xvec[N-2]$$ and $$\uvec[N-2]$$. We can therefore express $$J_{N-2,N}^*(\xvec[N-2])$$ in terms of $$J_{N-1,N}^*(\xvec[N-1])$$: $\begin{multline} J_{N-2,N}^*(\xvec[N-2]) = \mathrm{min}_{ \{\uvec[N-2]\} } \big\{ g\dscrt(\xvec[N-2], \uvec[N-2]) \\ {} + J_{N-1,N}^*(\xvec[N-1]) \big\} \end{multline}$ And, as above, we can use $$\avec()$$ to express everything in terms of a single time point: $\begin{multline} J_{N-2,N}^*\left(\xvec[N-2]\right) = \mathrm{min}_{ \{\uvec[N-2]\} } \big\{ g\dscrt(\xvec[N-2], \uvec[N-2]) \\ {} + J_{N-1,N}^*(\avec\dscrt(\xvec[N-2], \uvec[N-2])) \big\} \end{multline}$ This, finally, points us to the recurrence relation promised.

For the system as described at the $$K$$th-to-last stage, the minimal cost is: $\begin{multline} J_{N-K,N}^*\left(\xvec[N-K]\right) = \\ \mathrm{min}_{\{\uvec[N-K], \ldots, \uvec[N]\}} \left\{ h(\xvec[N]) + \sum_{k=N-K}^{N-1} {g\dscrt(\xvec[k],\uvec[k])} \right\} \\ = \mathrm{min}_{\{\uvec[N-K]\}} \big\{ g\dscrt(\xvec[N-K], \uvec[N-K]) \\ {} + J_{N-K+1,N}^*(\avec\dscrt( \xvec[N-K], \uvec[N-K])) \big\} \end{multline}$

Notice also the embedding principle: $$J_{N-K,N}^*(\xvec[N-K])$$ is both the minimum cost for the final $$K$$ stages of the $$N$$-stage process with state $$\xvec[N-K]$$ given, and equally the minimum cost for a $$K$$-stage process with initial state $$\xvec[N-K]$$; i.e., the $$K$$-stage process is embedded in the $$N$$-stage process.

Next time: The Hamilton-Jacobi-Bellman equation is analogous to this recurrence relation, but in the continuous-time case.

Posted in control theory on
Tags: Control Systems and Dynamic Programming.


text:
# Count Unique Characters of All Substrings of a Given String in C++

C++Server Side ProgrammingProgramming

Suppose we want to define a function called countUniqueChars(s) that will return the number of unique characters on s, so if s = "HELLOWORLD" then "H", "E", "W", "R", "D" are the unique characters since they appear only once in s, therefore countUniqueChars(s) = 5.

Now on this problem given a string s we have to find the sum of countUniqueChars(t) where t is a substring of s. (Here some substrings can be repeated so on this case we have to count the repeated ones too.)

As the answer can be very large, we can return answer modulo 10^9+7.

So, if the input is like "HELLOWORLD", then the output will be 128

To solve this, we will follow these steps −

• Define a function add(), this will take a, b,

• return (a mod m) + (b mod m)

• Define a function mul(), this will take a, b,

• return (a mod m) * (b mod m)

• From the main method, do the following −

• n := size of s

• ans := 0

• Define an array cnt of size 26

• for initialize i := 0, when i < n, update (increase i by 1), do −

• x := s[i]

• if size of cnt[x - 'A'] is same as 0, then −

• insert -1 at the end of cnt[x - 'A']

• insert i at the end of cnt[x - 'A']

• for initialize i := 0, when i < 26, update (increase i by 1), do −

• if size of cnt[i] is same as 0, then −

• insert n at the end of cnt[i]

• for initialize j := 1, when j < size of cnt[i], update (increase j by 1), do −

• temp := mul(cnt[i, j] - cnt[i, j - 1], cnt[i, j + 1] - cnt[i, j])

• return ans

Let us see the following implementation to get better understanding −

## Example

Live Demo

#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
const lli m = 1e9 + 7;
class Solution {
public:
return (a % m) + (b % m);
}
lli mul(lli a, lli b){
return (a % m) * (b % m);
}
int uniqueLetterString(string s) {
int n = s.size();
int ans = 0;
vector<int> cnt[26];
for (int i = 0; i < n; i++) {
char x = s[i];
if (cnt[x - 'A'].size() == 0) {
cnt[x - 'A'].push_back(-1);
}
cnt[x - 'A'].push_back(i);
}
for (int i = 0; i < 26; i++) {
if (cnt[i].size() == 0)
continue;
cnt[i].push_back(n);
for (int j = 1; j < cnt[i].size() - 1; j++) {
lli temp = mul(cnt[i][j] - cnt[i][j - 1], cnt[i][j +
1] - cnt[i][j]);
}
}
return ans;
}
};
main(){
Solution ob;
cout << (ob.uniqueLetterString("HELLOWORLD"));
}

## Input

"HELLOWORLD"

## Output

128
Published on 08-Jun-2020 14:00:24


text:
# Revision history [back]

### Checking the Sample Size Input for cv::ml::StatModel::predict() Loaded from File?

I noticed that when calling predict() with an input sample of the wrong size, the function does not (necessarily) fail! Apparently there is no internal checking that the input is of the right size!

I want to verify that when I'm calling predict(), my input sample is of the correct size. How can I do that? I cannot seem to find such a method to provide this info.

### Checking the Sample Size Input for cv::ml::StatModel::predict() Loaded from File?

I noticed that when calling predict() with an input sample of the wrong size, the function does not (necessarily) fail! Apparently there is no internal checking that the input is of the right size!

I want to verify that when I'm calling predict(), my input sample is of the correct size. How can I do that? I cannot seem to find such a method to provide this info.

OpenCV 3.4. Some "sample" code:

 cv::Ptr<cv::ml::statmodel> classifier = cv::Algorithm::load(...); // ...

cv::Mat sample32f; // fill sample32f

//...

classifier->predict(sample32f.reshape(1, 1)); // How to verify the correct expected size???

### Checking the Sample Size Input for cv::ml::StatModel::predict() Loaded from File?

I noticed that when calling predict() with an input sample of the wrong size, the function does not (necessarily) fail! Apparently there is no internal checking that the input is of the right size!

I want to verify that when I'm calling predict(), my input sample is of the correct size. How can I do that? I cannot seem to find such a method to provide this info.

OpenCV 3.4. Some "sample" code:

 cv::Ptr<cv::ml::statmodel> classifier classifier = cv::Algorithm::load(...); // ...

cv::Mat sample32f; // fill sample32f

//...

classifier->predict(sample32f.reshape(1, classifier->predict(sample32f.reshape(1, 1)); // How to verify the correct correct expected size??? size???

### Checking the Sample Size Input for cv::ml::StatModel::predict() Loaded from File?

I noticed that when calling predict() with an input sample of the wrong size, the function does not (necessarily) fail! Apparently there is no internal checking that the input is of the right size!

I want to verify that when I'm calling predict(), my input sample is of the correct size. How can I do that? I cannot seem to find such a method to provide this info.

OpenCV 3.4. Some "sample" code:

cv::Ptr<cv::ml::statmodel> classifier

cv::Ptr<cv::ml::StatModel> classifier = cv::Algorithm::load(...);  // ... ...
cv::Mat sample32f;  // fill sample32f //... classifier->predict(sample32f.reshape(1,
1)); sample32f
//...
classifier->predict(sample32f.reshape(1,1)); // How to verify the correct
correct expected size???
size???


text:
I'm wondering if there are any known result for the maximum large cardinal strength which can be preserved by Radin forcing? For instance, with any large cardinal hypothesis in the ground model, can one show that in $$V[G]$$ which is a generic for a Radin forcing of some length $$\kappa$$ is $$V_{\kappa + 2}$$-strong?
If you start with a strong (or a supercompact cardinal) and if you force with Radin forcing $$\mathbb{R}_u$$, for some suitable $$u$$, then you can preserve the full strength (or supercompactness) of $$\kappa$$.
• Thanks for the references. I'm sorry for the ambiguity of my question. What I actually want to know is that, when you have a supercompact $\kappa$, but you can only use the measure sequence on $V_\kappa$ (i.e. not the supercompact Radin forcing associate to $P_\kappa(\lambda)$), how much strength can you preserved, can you find a particular length to show that $\kappa$ is strong. – Jiachen Yuan Apr 10 '19 at 6:04
• For ordinary Radin forcing, you can preserve all supercompactness even, see Radin's paper (he shows you can preserve $\lambda$-supercompactness). My paper with Gitik also uses the ordinary Radin forcing and not its supercompact version. Similar facts about strong cardinals. – Mohammad Golshani Apr 10 '19 at 6:08


text:
# Calculate the molar mass in "g"/"mol"of diacetyl (butanedione) given that in the gas phase 100 degrees Celsius and 747 torr, a 0.3060 g sample of diacetyl occupies a volume of 0.111L?

May 26, 2017

The molar mass of diacetyl, $\text{C"_4"H"_6"O"_2}$, as calculated based on the question parameters is $\text{85.83 g/mol}$. Its actual molar mass is $\text{86.09 g/mol}$.

#### Explanation:

You can use the ideal gas law to answer this question. The equation is:

$P V = n R T$,

where $P$ is pressure, $V$ is volume, $n$ is moles, $R$ is the gas constant, and $T$ is the temperature in Kelvins. Add $273.15$ to the Celsius temperature to get the temperature in Kelvins: ${100}^{\circ} \text{C" + 273.15="373 K}$.

We will use the ideal gas law to determine moles of diacetyl gas, then divide the given mass by the moles of diacetyl gas to determine its molar mass.

Known

$m = \text{0.3060 g}$

$P = \text{747 torr}$

$V = \text{0.111 L}$

$R = 62.364 \textcolor{w h i t e}{.} {\text{L torr K"^(-1) "mol}}^{- 1}$
https://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/States_of_Matter/Properties_of_Gases/Gas_Laws/The_Ideal_Gas_Law

$T = \text{373 K}$

Unknown

n=?

$\text{molar mass = ? g/mol}$

Solve for $n$.
Rearrange the equation to isolate $n$. Insert the known data and solve.

$n = \frac{P V}{R T}$

n=(747color(red)cancel(color(black)("torr"))xx0.111color(red)cancel(color(black)("L")))/((62.364color(white)(.)color(red)cancel(color(black)("L"))color(red)cancel(color(black)("torr")) color(red)cancel(color(black)("K")))^(-1) "mol"^(-1)xx373color(red)cancel(color(black)("K")))="0.003565 mol"

Now that you have moles, divide the mass of diacetyl given in the question by the moles.

$\text{Molar mass diacetyl" = (0.3060"g diacetyl")/(0.003565"mol diacetyl")="85.83 g/mol diacetyl}$ rounded to four significant figures

The molecular formula for diacetyl is ("CH"_3"CO)"_2 or $\text{C"_4"H"_6"O"_2}$ and its known molar mass to three sig figs is $\text{86.09 g/mol}$. https://www.ncbi.nlm.nih.gov/pccompound?term=%22diacetyl%22

"Percent error" = abs(("known value"-"experimental value")/("accepted value"))xx100

$\text{Percent error"=abs((86.09-85.83)/(86.09))xx100="0.3020%}$

May 26, 2017

$85.9 \text{g"/"mol}$

#### Explanation:

What we can do here is calculate the density of the diacetyl, and use that to directly calculate the molar mass. We will use the equation

$M = \frac{\mathrm{dR} T}{P}$

where $M$ is the molar mass of the substance,
$d$ is its density, in $\text{g"/"L}$,
$R$ is the universal gas constant, equal to $0.08206 \left(\text{L"-"atm")/("mol"-"K}\right)$,
$T$ is the absolute temperature (in $\text{K}$), and
$P$ is the pressure of the gas (in $\text{atm}$)

Where is this equation derived from? Read the steps below if you would like to know, otherwise, skip to the next step.

Well, let's recall our ideal-gas equation, and rearrange it to solve for units similar to that of density, $\text{mol"/"L}$, which is $\frac{n}{V}$:

$P V = n R T$

$P = \frac{n R T}{V}$

$\frac{P}{R T} = \frac{n}{V}$

Now, let's multiply both sides of the equation by $M$, the molar mass with units $\text{g"/"mol}$:

$\frac{P M}{R T} = \frac{n M}{V}$

If we list the right side of the equation in terms of units, we have

cancel("mol")/"L" xx "g"/cancel("mol") = "g"/"L"

Which is the units for density. Thus, the value $\frac{n M}{V}$ is the density of the gas, and if we plug this back into our equation:

$\frac{P M}{R T} = \frac{n M}{V} = d$

Thus, $d = \frac{M P}{R T}$, and rearranging to solve for the molar mass yields our original equation, $M = \frac{\mathrm{dR} T}{P}$.

The density of the diacetyl is

d = (0.3060"g")/(0.111 "L") = 2.76 "g"/"L"

The temperature, in Kelvin, is

${100}^{o} C + 273 = 373 \text{K}$

and the pressure, in atmospheres, is

747 cancel("torr")((1 "atm")/(760 cancel("torr"))) = 0.983 "atm"

Finally, plugging in all our known variables, we have

M = ((2.76 "g"/cancel("L"))(0.08206 (cancel("L")-cancel("atm"))/("mol"-cancel("K")))(373 cancel("K")))/(0.983 cancel("atm")) = color(red)(85.9 "g"/"mol"

To check this, the molecular formula of diacetyl is ${\left(\text{CH"_3"CO}\right)}_{2}$, and from this the molar mass is found to be $86.1 \text{g"/"mol}$, which measures up well with our result.


text:
# This question's going to sound really stupid

Manchot
This question's going to sound really stupid, but here goes: what letter is this supposed to be? I just came across it in a book of mine, but for the life of me, I can't tell whether it's a scripted R, n, or even pi. If I had to guess, I'd say that it's an n, simply because it looks somewhat like a lowercase n. However, if it is a scripted lowercase letter, then why is it the size of the uppercase letters? It's really bothering me, because when I'm reading, I'm not sure what to call it.

zoobyshoe
I can't tell.

Mentor
If you could show it in context we might be able to tell what it is.

Staff Emeritus
Gold Member
It looks like a script pi to me...

zoobyshoe
Its sum fansy ritin', aint it?

pattylou
I vote pi.

Manchot
Ok, the mystery letter is in Terrell Hill's "An Introduction to Statistical Thermodynamics," and refers to the number of systems in an "ensemble" of systems. (That's another reason why I would lean towards n.)

Gold Member
Thats the Penguin Constant.

Since penguins are lazy, it is simply "1", no units.

Manchot
You know, Pengwuino, our user names are very closely related. Look up the word "Manchot" in a French-English dictionary

Gold Member
haha, the Manchot constant :D

Damn, google even has a translator... why don't we all just run our lives off google.

Knavish
Definitely an n.

zoobyshoe
It's a hieroglyph from the wreckage at Roswell.

Manchot
Are you basing that on its looks or on the context?

zoobyshoe
Manchot said:
Are you basing that on its looks or on the context?
No, that's the information that was just beamed into my head from the mothership.

Gold Member
it's either an n or an r. if it's alphanumeric, of course

Smurf
looks like a pi to me.

Gold Member
Last edited:
zoobyshoe
I think I saw that symbol chiseled in a piece of granite in the New Hampshire woods by a 10th century group of Irish monks who crossed the Atlantic in a skin boat.

Smurf
zoobyshoe said:
I think I saw that symbol chiseled in a piece of granite in the New Hampshire woods by a 10th century group of Irish monks who crossed the Atlantic in a skin boat.
Ah.. we've discov... WAIT A MINUTE! There were no monks in new hampshire in the 10th century. You're making this UP!

zoobyshoe
Smurf said:
You're making this UP!
It's somewhat embellished, yes, but it is basically true: there were monks in Ireland at the time, and there was granite in new Hampshire.

Manchot
I think I've figured it out. It's the Fraktur N, which as it turns out, is implemented in TeX. See for yourself:

$$\mathfrak{N}$$

Gold Member
I KNEW IT! it wasn't $$\pi$$

zoobyshoe
Manchot said:
I think I've figured it out. It's the Fraktur N, which as it turns out, is implemented in TeX. See for yourself:

$$\mathfrak{N}$$
That looks very close, yes.

Gold Member
Elementary, my dear Watson!


text:
# Noise-equivalent power

A measure of the sensitivity of a photodetector or detector system.

Noise-equivalent power (NEP) is a measure of the sensitivity of a photodetector or detector system. It is defined as the signal power that gives a signal-to-noise ratio of one in a one hertz output bandwidth.[1] An output bandwidth of one hertz is equivalent to half a second of integration time.[2] The units of NEP are watts per square root hertz. The NEP is equal to the noise spectral density (expressed in units of A / H z {\displaystyle \mathrm {A} /{\sqrt {\mathrm {Hz} }}} {\displaystyle \mathrm {A} /{\sqrt {\mathrm {Hz} }}} or V / H z {\displaystyle \mathrm {V} /{\sqrt {\mathrm {Hz} }}} {\displaystyle \mathrm {V} /{\sqrt {\mathrm {Hz} }}}) divided by the responsivity (expressed in units of A / W {\displaystyle \mathrm {A} /\mathrm {W} } {\displaystyle \mathrm {A} /\mathrm {W} } or V / W {\displaystyle \mathrm {V} /\mathrm {W} } {\displaystyle \mathrm {V} /\mathrm {W} }, respectively).

A smaller NEP corresponds to a more sensitive detector. For example, a detector with an NEP of 10 − 12 W / H z {\displaystyle 10^{-12}\mathrm {W} /{\sqrt {\mathrm {Hz} }}} {\displaystyle 10^{-12}\mathrm {W} /{\sqrt {\mathrm {Hz} }}} can detect a signal power of one picowatt with a signal-to-noise ratio (SNR) of one after one half second of averaging. The SNR improves as the square root of the averaging time, and hence the SNR in this example can be improved by a factor of 10 by averaging 100-times longer, i.e. for 50 seconds.

If the NEP refers to the signal power absorbed in the detector, it is known as the electrical NEP. If instead it refers to the signal power incident on the detector system, it is called the optical NEP. The optical NEP is equal to the electrical NEP divided by the optical coupling efficiency of the detector system.

acronymn
• NEP
source
Adapted from content published on wikipedia.org


text:
What's new

# P2.T5.412. Exotic options: forward start, compound and chooser

#### Nicole Seaman

##### Director of FRM Operations
Staff member
Subscriber
AIM: Identify and describe the characteristics and pay-off structure of the following exotic options: forward start, compound, and chooser

Questions:

412.1. The price of a vanilla (non-exotic) at-the-money European call option, today, with a one year maturity is $15.05; if we extend the maturity to two years, the price of the option is$22.58. Now consider a forward start at-the-money European call option, on the same underlying stock, that will start in one year (T1 = 1.0 year) and mature one year later, two years from today (T2 = T1 + 1.0 year = 2.0 years). The continuous dividend yield on the underlying stock is 5.0% per annum, and the riskfree rate is 3.0% per annum; both are expressed with continuous compounding. Which is nearest to today's price of the forward start option?

a. $13.89 b.$14.32
c. $14.61 d.$21.48

412.2. Consider the four main types of compound options:

I. call on a call,
II. call on a put,
III. put on a call,
IV. put on a put

With respect to the value of the compound option as a function of the underlying asset price, which of these compound option's value is (are) a DECREASING function of the underlying asset price?

a. None, the compound values are all (each) an increasing function of asset price
b. IV. only (put on a put)
c. II. and III. (call on a put; put on a call)
d. III. and IV. (put on a call; put on a put)

412.3. Consider a chooser option where the underlying is Microsoft's stock (ticker: MSFT). The options underlying the chooser are both European and have the same strike price (i.e., simple chooser) of $35.00. The choose date is six months (T1 = 0.5 years) and the maturity of the options is one year (T2 = T1 + six months = 1.0 year). The riskfree rate is 3.0% per annum with continuous compounding. A long position in this chooser option is most similar to which of the following trading strategies, and how does the initial cost compare to the similar strategy? a. Long straddle but chooser is cheaper b. Short straddle but chooser is more expensive c. Long calendar spread with similar cost d. Long Butterfly spread but chooser cheaper Answers here: #### ivojekle ##### New Member Probably I don't see something, but I really don't understand 412.1. Why is the value of the European option with maturity 2 years different than the option which starts in one year and mature one year later. Both options have the same maturity date (two years from today) and we value them on the same date. I would undesrtand if options were American, but if they are European seem to be fundamentaly the same. Thanks for answer Ivo #### Alex_1 ##### Active Member Hi, as I read the text of the question: the two options don't have the same maturities: for one T = 1, for the other T = 2 ("(T2 = T1 + 1.0 year = 2.0 years")? So they have different time values and so different overall values, if I am not mistaken. BR, Alex #### David Harper CFA FRM ##### David Harper CFA FRM Staff member Subscriber Hi @ivojekle I agree with @Alex_1 but there is even another difference (there are two difference). First, consider the "standard" two-year ATM call option with price of$22.58. Let's say that is based on current stock price of \$100.00 (my examples are generally based on actual inputs, but I don't have these assumptions handy). This is an ATM call such that T = 2.0, S = 100, and K = 100. Not only does the one-year forward start have a maturity of one-year but, as of today (T0), the strike price is unknown. The forward start will be struck at the money in one year, so while the two-year option has a strike of 100, the expected strike of price of the one-year forward is higher.

Additional evidence is provided if we simply assume no dividend on the stock. As the price of a forward start = c*exp(qT), where q = 0, as Hull shows, the price of the forward = c. In the above question, if we eliminate the dividend yield, then the price of the one-year forward is 15.05 (equal to the price of the current one-year call option). This one year forward will expire in two years, on the same maturity date as the current two-year option, but the price is considerably less than 22.58. I hope that helps,

#### ivojekle

##### New Member
Thanks both,

now I understand - strike is not fixed - it it ATM.

Ivo


text:
Level Curve Configurations and Conformal Equivalence of Meromorphic Functions

Level Curve Configurations and Conformal Equivalence of Meromorphic Functions Let $$f=B_1/B_2$$ f = B 1 / B 2 be a ratio of finite Blaschke products having no critical points on $$\partial \mathbb {D}$$ ∂ D . Then $$f$$ f has finitely many critical level curves (level curves containing critical points of $$f$$ f ) in the disk, and the non-critical level curves interpolate smoothly between the critical level curves. Thus, to understand the geometry of all the level curves of $$f$$ f , one needs only understand the configuration of the finitely many critical level curves of $$f$$ f . In this paper, we show that in fact such a function $$f$$ f is determined not just geometrically but conformally by the configuration of its critical level curves. That is, if $$f_1$$ f 1 and $$f_2$$ f 2 have the same configuration of critical level curves, then there is a conformal map $$\phi$$ ϕ such that $$f_1\equiv f_2\circ \phi$$ f 1 ≡ f 2 ∘ ϕ . We then use this to show that every configuration of critical level curves which could come from an analytic function is instantiated by a polynomial. We also include a new proof of a theorem of Bôcher (which is an extension of the Gauss–Lucas theorem to rational functions) using level curves. http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Computational Methods and Function Theory Springer Journals

Level Curve Configurations and Conformal Equivalence of Meromorphic Functions

, Volume 15 (2) – Mar 31, 2015
49 pages

/lp/springer-journals/level-curve-configurations-and-conformal-equivalence-of-meromorphic-QDOJqP8MqS
Publisher
Springer Journals
Subject
Mathematics; Analysis; Computational Mathematics and Numerical Analysis; Functions of a Complex Variable
ISSN
1617-9447
eISSN
2195-3724
DOI
10.1007/s40315-015-0111-5
Publisher site
See Article on Publisher Site

Abstract

Let $$f=B_1/B_2$$ f = B 1 / B 2 be a ratio of finite Blaschke products having no critical points on $$\partial \mathbb {D}$$ ∂ D . Then $$f$$ f has finitely many critical level curves (level curves containing critical points of $$f$$ f ) in the disk, and the non-critical level curves interpolate smoothly between the critical level curves. Thus, to understand the geometry of all the level curves of $$f$$ f , one needs only understand the configuration of the finitely many critical level curves of $$f$$ f . In this paper, we show that in fact such a function $$f$$ f is determined not just geometrically but conformally by the configuration of its critical level curves. That is, if $$f_1$$ f 1 and $$f_2$$ f 2 have the same configuration of critical level curves, then there is a conformal map $$\phi$$ ϕ such that $$f_1\equiv f_2\circ \phi$$ f 1 ≡ f 2 ∘ ϕ . We then use this to show that every configuration of critical level curves which could come from an analytic function is instantiated by a polynomial. We also include a new proof of a theorem of Bôcher (which is an extension of the Gauss–Lucas theorem to rational functions) using level curves.

Journal

Computational Methods and Function TheorySpringer Journals

Published: Mar 31, 2015

References

Access the full text.


text:
Copied to
clipboard

## G = (C2×C4).Dic6order 192 = 26·3

### 9th non-split extension by C2×C4 of Dic6 acting via Dic6/C6=C22

Series: Derived Chief Lower central Upper central

 Derived series C1 — C22×C6 — (C2×C4).Dic6
 Chief series C1 — C3 — C6 — C2×C6 — C22×C6 — C22×Dic3 — C2×Dic3⋊C4 — (C2×C4).Dic6
 Lower central C3 — C22×C6 — (C2×C4).Dic6
 Upper central C1 — C23 — C2.C42

Generators and relations for (C2×C4).Dic6
G = < a,b,c,d | a2=b4=c12=1, d2=b2c6, cbc-1=ab=ba, ac=ca, ad=da, dbd-1=b-1, dcd-1=b2c-1 >

Subgroups: 336 in 134 conjugacy classes, 57 normal (51 characteristic)
C1, C2, C3, C4, C22, C6, C2×C4, C2×C4, C23, Dic3, C12, C2×C6, C4⋊C4, C22×C4, C22×C4, C2×Dic3, C2×Dic3, C2×C12, C2×C12, C22×C6, C2.C42, C2.C42, C2×C4⋊C4, Dic3⋊C4, C4⋊Dic3, C22×Dic3, C22×C12, C23.83C23, C6.C42, C3×C2.C42, C2×Dic3⋊C4, C2×C4⋊Dic3, (C2×C4).Dic6
Quotients: C1, C2, C22, S3, D4, Q8, C23, D6, C2×D4, C2×Q8, C4○D4, Dic6, C22×S3, C22⋊Q8, C22.D4, C4.4D4, C42.C2, C422C2, C2×Dic6, C4○D12, S3×D4, D42S3, Q83S3, C23.83C23, C12.6Q8, Dic3.D4, C23.8D6, C23.11D6, C4.Dic6, D6.D4, C4⋊C4⋊S3, (C2×C4).Dic6

Smallest permutation representation of (C2×C4).Dic6
Regular action on 192 points
Generators in S192
(1 155)(2 156)(3 145)(4 146)(5 147)(6 148)(7 149)(8 150)(9 151)(10 152)(11 153)(12 154)(13 186)(14 187)(15 188)(16 189)(17 190)(18 191)(19 192)(20 181)(21 182)(22 183)(23 184)(24 185)(25 44)(26 45)(27 46)(28 47)(29 48)(30 37)(31 38)(32 39)(33 40)(34 41)(35 42)(36 43)(49 68)(50 69)(51 70)(52 71)(53 72)(54 61)(55 62)(56 63)(57 64)(58 65)(59 66)(60 67)(73 91)(74 92)(75 93)(76 94)(77 95)(78 96)(79 85)(80 86)(81 87)(82 88)(83 89)(84 90)(97 114)(98 115)(99 116)(100 117)(101 118)(102 119)(103 120)(104 109)(105 110)(106 111)(107 112)(108 113)(121 140)(122 141)(123 142)(124 143)(125 144)(126 133)(127 134)(128 135)(129 136)(130 137)(131 138)(132 139)(157 177)(158 178)(159 179)(160 180)(161 169)(162 170)(163 171)(164 172)(165 173)(166 174)(167 175)(168 176)
(1 97 83 27)(2 115 84 47)(3 99 73 29)(4 117 74 37)(5 101 75 31)(6 119 76 39)(7 103 77 33)(8 109 78 41)(9 105 79 35)(10 111 80 43)(11 107 81 25)(12 113 82 45)(13 53 164 137)(14 61 165 131)(15 55 166 139)(16 63 167 121)(17 57 168 141)(18 65 157 123)(19 59 158 143)(20 67 159 125)(21 49 160 133)(22 69 161 127)(23 51 162 135)(24 71 163 129)(26 154 108 88)(28 156 98 90)(30 146 100 92)(32 148 102 94)(34 150 104 96)(36 152 106 86)(38 147 118 93)(40 149 120 95)(42 151 110 85)(44 153 112 87)(46 155 114 89)(48 145 116 91)(50 169 134 183)(52 171 136 185)(54 173 138 187)(56 175 140 189)(58 177 142 191)(60 179 144 181)(62 174 132 188)(64 176 122 190)(66 178 124 192)(68 180 126 182)(70 170 128 184)(72 172 130 186)
(1 2 3 4 5 6 7 8 9 10 11 12)(13 14 15 16 17 18 19 20 21 22 23 24)(25 26 27 28 29 30 31 32 33 34 35 36)(37 38 39 40 41 42 43 44 45 46 47 48)(49 50 51 52 53 54 55 56 57 58 59 60)(61 62 63 64 65 66 67 68 69 70 71 72)(73 74 75 76 77 78 79 80 81 82 83 84)(85 86 87 88 89 90 91 92 93 94 95 96)(97 98 99 100 101 102 103 104 105 106 107 108)(109 110 111 112 113 114 115 116 117 118 119 120)(121 122 123 124 125 126 127 128 129 130 131 132)(133 134 135 136 137 138 139 140 141 142 143 144)(145 146 147 148 149 150 151 152 153 154 155 156)(157 158 159 160 161 162 163 164 165 166 167 168)(169 170 171 172 173 174 175 176 177 178 179 180)(181 182 183 184 185 186 187 188 189 190 191 192)
(1 181 77 173)(2 178 78 186)(3 191 79 171)(4 176 80 184)(5 189 81 169)(6 174 82 182)(7 187 83 179)(8 172 84 192)(9 185 73 177)(10 170 74 190)(11 183 75 175)(12 180 76 188)(13 156 158 96)(14 89 159 149)(15 154 160 94)(16 87 161 147)(17 152 162 92)(18 85 163 145)(19 150 164 90)(20 95 165 155)(21 148 166 88)(22 93 167 153)(23 146 168 86)(24 91 157 151)(25 50 101 140)(26 133 102 55)(27 60 103 138)(28 143 104 53)(29 58 105 136)(30 141 106 51)(31 56 107 134)(32 139 108 49)(33 54 97 144)(34 137 98 59)(35 52 99 142)(36 135 100 57)(37 122 111 70)(38 63 112 127)(39 132 113 68)(40 61 114 125)(41 130 115 66)(42 71 116 123)(43 128 117 64)(44 69 118 121)(45 126 119 62)(46 67 120 131)(47 124 109 72)(48 65 110 129)

G:=sub<Sym(192)| (1,155)(2,156)(3,145)(4,146)(5,147)(6,148)(7,149)(8,150)(9,151)(10,152)(11,153)(12,154)(13,186)(14,187)(15,188)(16,189)(17,190)(18,191)(19,192)(20,181)(21,182)(22,183)(23,184)(24,185)(25,44)(26,45)(27,46)(28,47)(29,48)(30,37)(31,38)(32,39)(33,40)(34,41)(35,42)(36,43)(49,68)(50,69)(51,70)(52,71)(53,72)(54,61)(55,62)(56,63)(57,64)(58,65)(59,66)(60,67)(73,91)(74,92)(75,93)(76,94)(77,95)(78,96)(79,85)(80,86)(81,87)(82,88)(83,89)(84,90)(97,114)(98,115)(99,116)(100,117)(101,118)(102,119)(103,120)(104,109)(105,110)(106,111)(107,112)(108,113)(121,140)(122,141)(123,142)(124,143)(125,144)(126,133)(127,134)(128,135)(129,136)(130,137)(131,138)(132,139)(157,177)(158,178)(159,179)(160,180)(161,169)(162,170)(163,171)(164,172)(165,173)(166,174)(167,175)(168,176), (1,97,83,27)(2,115,84,47)(3,99,73,29)(4,117,74,37)(5,101,75,31)(6,119,76,39)(7,103,77,33)(8,109,78,41)(9,105,79,35)(10,111,80,43)(11,107,81,25)(12,113,82,45)(13,53,164,137)(14,61,165,131)(15,55,166,139)(16,63,167,121)(17,57,168,141)(18,65,157,123)(19,59,158,143)(20,67,159,125)(21,49,160,133)(22,69,161,127)(23,51,162,135)(24,71,163,129)(26,154,108,88)(28,156,98,90)(30,146,100,92)(32,148,102,94)(34,150,104,96)(36,152,106,86)(38,147,118,93)(40,149,120,95)(42,151,110,85)(44,153,112,87)(46,155,114,89)(48,145,116,91)(50,169,134,183)(52,171,136,185)(54,173,138,187)(56,175,140,189)(58,177,142,191)(60,179,144,181)(62,174,132,188)(64,176,122,190)(66,178,124,192)(68,180,126,182)(70,170,128,184)(72,172,130,186), (1,2,3,4,5,6,7,8,9,10,11,12)(13,14,15,16,17,18,19,20,21,22,23,24)(25,26,27,28,29,30,31,32,33,34,35,36)(37,38,39,40,41,42,43,44,45,46,47,48)(49,50,51,52,53,54,55,56,57,58,59,60)(61,62,63,64,65,66,67,68,69,70,71,72)(73,74,75,76,77,78,79,80,81,82,83,84)(85,86,87,88,89,90,91,92,93,94,95,96)(97,98,99,100,101,102,103,104,105,106,107,108)(109,110,111,112,113,114,115,116,117,118,119,120)(121,122,123,124,125,126,127,128,129,130,131,132)(133,134,135,136,137,138,139,140,141,142,143,144)(145,146,147,148,149,150,151,152,153,154,155,156)(157,158,159,160,161,162,163,164,165,166,167,168)(169,170,171,172,173,174,175,176,177,178,179,180)(181,182,183,184,185,186,187,188,189,190,191,192), (1,181,77,173)(2,178,78,186)(3,191,79,171)(4,176,80,184)(5,189,81,169)(6,174,82,182)(7,187,83,179)(8,172,84,192)(9,185,73,177)(10,170,74,190)(11,183,75,175)(12,180,76,188)(13,156,158,96)(14,89,159,149)(15,154,160,94)(16,87,161,147)(17,152,162,92)(18,85,163,145)(19,150,164,90)(20,95,165,155)(21,148,166,88)(22,93,167,153)(23,146,168,86)(24,91,157,151)(25,50,101,140)(26,133,102,55)(27,60,103,138)(28,143,104,53)(29,58,105,136)(30,141,106,51)(31,56,107,134)(32,139,108,49)(33,54,97,144)(34,137,98,59)(35,52,99,142)(36,135,100,57)(37,122,111,70)(38,63,112,127)(39,132,113,68)(40,61,114,125)(41,130,115,66)(42,71,116,123)(43,128,117,64)(44,69,118,121)(45,126,119,62)(46,67,120,131)(47,124,109,72)(48,65,110,129)>;

G:=Group( (1,155)(2,156)(3,145)(4,146)(5,147)(6,148)(7,149)(8,150)(9,151)(10,152)(11,153)(12,154)(13,186)(14,187)(15,188)(16,189)(17,190)(18,191)(19,192)(20,181)(21,182)(22,183)(23,184)(24,185)(25,44)(26,45)(27,46)(28,47)(29,48)(30,37)(31,38)(32,39)(33,40)(34,41)(35,42)(36,43)(49,68)(50,69)(51,70)(52,71)(53,72)(54,61)(55,62)(56,63)(57,64)(58,65)(59,66)(60,67)(73,91)(74,92)(75,93)(76,94)(77,95)(78,96)(79,85)(80,86)(81,87)(82,88)(83,89)(84,90)(97,114)(98,115)(99,116)(100,117)(101,118)(102,119)(103,120)(104,109)(105,110)(106,111)(107,112)(108,113)(121,140)(122,141)(123,142)(124,143)(125,144)(126,133)(127,134)(128,135)(129,136)(130,137)(131,138)(132,139)(157,177)(158,178)(159,179)(160,180)(161,169)(162,170)(163,171)(164,172)(165,173)(166,174)(167,175)(168,176), (1,97,83,27)(2,115,84,47)(3,99,73,29)(4,117,74,37)(5,101,75,31)(6,119,76,39)(7,103,77,33)(8,109,78,41)(9,105,79,35)(10,111,80,43)(11,107,81,25)(12,113,82,45)(13,53,164,137)(14,61,165,131)(15,55,166,139)(16,63,167,121)(17,57,168,141)(18,65,157,123)(19,59,158,143)(20,67,159,125)(21,49,160,133)(22,69,161,127)(23,51,162,135)(24,71,163,129)(26,154,108,88)(28,156,98,90)(30,146,100,92)(32,148,102,94)(34,150,104,96)(36,152,106,86)(38,147,118,93)(40,149,120,95)(42,151,110,85)(44,153,112,87)(46,155,114,89)(48,145,116,91)(50,169,134,183)(52,171,136,185)(54,173,138,187)(56,175,140,189)(58,177,142,191)(60,179,144,181)(62,174,132,188)(64,176,122,190)(66,178,124,192)(68,180,126,182)(70,170,128,184)(72,172,130,186), (1,2,3,4,5,6,7,8,9,10,11,12)(13,14,15,16,17,18,19,20,21,22,23,24)(25,26,27,28,29,30,31,32,33,34,35,36)(37,38,39,40,41,42,43,44,45,46,47,48)(49,50,51,52,53,54,55,56,57,58,59,60)(61,62,63,64,65,66,67,68,69,70,71,72)(73,74,75,76,77,78,79,80,81,82,83,84)(85,86,87,88,89,90,91,92,93,94,95,96)(97,98,99,100,101,102,103,104,105,106,107,108)(109,110,111,112,113,114,115,116,117,118,119,120)(121,122,123,124,125,126,127,128,129,130,131,132)(133,134,135,136,137,138,139,140,141,142,143,144)(145,146,147,148,149,150,151,152,153,154,155,156)(157,158,159,160,161,162,163,164,165,166,167,168)(169,170,171,172,173,174,175,176,177,178,179,180)(181,182,183,184,185,186,187,188,189,190,191,192), (1,181,77,173)(2,178,78,186)(3,191,79,171)(4,176,80,184)(5,189,81,169)(6,174,82,182)(7,187,83,179)(8,172,84,192)(9,185,73,177)(10,170,74,190)(11,183,75,175)(12,180,76,188)(13,156,158,96)(14,89,159,149)(15,154,160,94)(16,87,161,147)(17,152,162,92)(18,85,163,145)(19,150,164,90)(20,95,165,155)(21,148,166,88)(22,93,167,153)(23,146,168,86)(24,91,157,151)(25,50,101,140)(26,133,102,55)(27,60,103,138)(28,143,104,53)(29,58,105,136)(30,141,106,51)(31,56,107,134)(32,139,108,49)(33,54,97,144)(34,137,98,59)(35,52,99,142)(36,135,100,57)(37,122,111,70)(38,63,112,127)(39,132,113,68)(40,61,114,125)(41,130,115,66)(42,71,116,123)(43,128,117,64)(44,69,118,121)(45,126,119,62)(46,67,120,131)(47,124,109,72)(48,65,110,129) );

G=PermutationGroup([[(1,155),(2,156),(3,145),(4,146),(5,147),(6,148),(7,149),(8,150),(9,151),(10,152),(11,153),(12,154),(13,186),(14,187),(15,188),(16,189),(17,190),(18,191),(19,192),(20,181),(21,182),(22,183),(23,184),(24,185),(25,44),(26,45),(27,46),(28,47),(29,48),(30,37),(31,38),(32,39),(33,40),(34,41),(35,42),(36,43),(49,68),(50,69),(51,70),(52,71),(53,72),(54,61),(55,62),(56,63),(57,64),(58,65),(59,66),(60,67),(73,91),(74,92),(75,93),(76,94),(77,95),(78,96),(79,85),(80,86),(81,87),(82,88),(83,89),(84,90),(97,114),(98,115),(99,116),(100,117),(101,118),(102,119),(103,120),(104,109),(105,110),(106,111),(107,112),(108,113),(121,140),(122,141),(123,142),(124,143),(125,144),(126,133),(127,134),(128,135),(129,136),(130,137),(131,138),(132,139),(157,177),(158,178),(159,179),(160,180),(161,169),(162,170),(163,171),(164,172),(165,173),(166,174),(167,175),(168,176)], [(1,97,83,27),(2,115,84,47),(3,99,73,29),(4,117,74,37),(5,101,75,31),(6,119,76,39),(7,103,77,33),(8,109,78,41),(9,105,79,35),(10,111,80,43),(11,107,81,25),(12,113,82,45),(13,53,164,137),(14,61,165,131),(15,55,166,139),(16,63,167,121),(17,57,168,141),(18,65,157,123),(19,59,158,143),(20,67,159,125),(21,49,160,133),(22,69,161,127),(23,51,162,135),(24,71,163,129),(26,154,108,88),(28,156,98,90),(30,146,100,92),(32,148,102,94),(34,150,104,96),(36,152,106,86),(38,147,118,93),(40,149,120,95),(42,151,110,85),(44,153,112,87),(46,155,114,89),(48,145,116,91),(50,169,134,183),(52,171,136,185),(54,173,138,187),(56,175,140,189),(58,177,142,191),(60,179,144,181),(62,174,132,188),(64,176,122,190),(66,178,124,192),(68,180,126,182),(70,170,128,184),(72,172,130,186)], [(1,2,3,4,5,6,7,8,9,10,11,12),(13,14,15,16,17,18,19,20,21,22,23,24),(25,26,27,28,29,30,31,32,33,34,35,36),(37,38,39,40,41,42,43,44,45,46,47,48),(49,50,51,52,53,54,55,56,57,58,59,60),(61,62,63,64,65,66,67,68,69,70,71,72),(73,74,75,76,77,78,79,80,81,82,83,84),(85,86,87,88,89,90,91,92,93,94,95,96),(97,98,99,100,101,102,103,104,105,106,107,108),(109,110,111,112,113,114,115,116,117,118,119,120),(121,122,123,124,125,126,127,128,129,130,131,132),(133,134,135,136,137,138,139,140,141,142,143,144),(145,146,147,148,149,150,151,152,153,154,155,156),(157,158,159,160,161,162,163,164,165,166,167,168),(169,170,171,172,173,174,175,176,177,178,179,180),(181,182,183,184,185,186,187,188,189,190,191,192)], [(1,181,77,173),(2,178,78,186),(3,191,79,171),(4,176,80,184),(5,189,81,169),(6,174,82,182),(7,187,83,179),(8,172,84,192),(9,185,73,177),(10,170,74,190),(11,183,75,175),(12,180,76,188),(13,156,158,96),(14,89,159,149),(15,154,160,94),(16,87,161,147),(17,152,162,92),(18,85,163,145),(19,150,164,90),(20,95,165,155),(21,148,166,88),(22,93,167,153),(23,146,168,86),(24,91,157,151),(25,50,101,140),(26,133,102,55),(27,60,103,138),(28,143,104,53),(29,58,105,136),(30,141,106,51),(31,56,107,134),(32,139,108,49),(33,54,97,144),(34,137,98,59),(35,52,99,142),(36,135,100,57),(37,122,111,70),(38,63,112,127),(39,132,113,68),(40,61,114,125),(41,130,115,66),(42,71,116,123),(43,128,117,64),(44,69,118,121),(45,126,119,62),(46,67,120,131),(47,124,109,72),(48,65,110,129)]])

42 conjugacy classes

 class 1 2A ··· 2G 3 4A ··· 4F 4G ··· 4N 6A ··· 6G 12A ··· 12L order 1 2 ··· 2 3 4 ··· 4 4 ··· 4 6 ··· 6 12 ··· 12 size 1 1 ··· 1 2 4 ··· 4 12 ··· 12 2 ··· 2 4 ··· 4

42 irreducible representations

 dim 1 1 1 1 1 2 2 2 2 2 2 2 4 4 4 type + + + + + + + - + - + - + image C1 C2 C2 C2 C2 S3 D4 Q8 D6 C4○D4 Dic6 C4○D12 S3×D4 D4⋊2S3 Q8⋊3S3 kernel (C2×C4).Dic6 C6.C42 C3×C2.C42 C2×Dic3⋊C4 C2×C4⋊Dic3 C2.C42 C2×Dic3 C2×C12 C22×C4 C2×C6 C2×C4 C22 C22 C22 C22 # reps 1 4 1 1 1 1 2 2 3 10 4 8 1 2 1

Matrix representation of (C2×C4).Dic6 in GL6(𝔽13)

 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 12 0 0 0 0 0 0 12
,
 5 0 0 0 0 0 0 8 0 0 0 0 0 0 5 0 0 0 0 0 0 8 0 0 0 0 0 0 0 8 0 0 0 0 8 0
,
 6 0 0 0 0 0 0 2 0 0 0 0 0 0 4 0 0 0 0 0 0 3 0 0 0 0 0 0 5 0 0 0 0 0 0 8
,
 0 2 0 0 0 0 7 0 0 0 0 0 0 0 0 1 0 0 0 0 12 0 0 0 0 0 0 0 1 0 0 0 0 0 0 12

G:=sub<GL(6,GF(13))| [1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,12,0,0,0,0,0,0,12],[5,0,0,0,0,0,0,8,0,0,0,0,0,0,5,0,0,0,0,0,0,8,0,0,0,0,0,0,0,8,0,0,0,0,8,0],[6,0,0,0,0,0,0,2,0,0,0,0,0,0,4,0,0,0,0,0,0,3,0,0,0,0,0,0,5,0,0,0,0,0,0,8],[0,7,0,0,0,0,2,0,0,0,0,0,0,0,0,12,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,12] >;

(C2×C4).Dic6 in GAP, Magma, Sage, TeX

(C_2\times C_4).{\rm Dic}_6
% in TeX

G:=Group("(C2xC4).Dic6");
// GroupNames label

G:=SmallGroup(192,219);
// by ID

G=gap.SmallGroup(192,219);
# by ID

G:=PCGroup([7,-2,-2,-2,-2,-2,-2,-3,112,253,64,254,387,268,6278]);
// Polycyclic

G:=Group<a,b,c,d|a^2=b^4=c^12=1,d^2=b^2*c^6,c*b*c^-1=a*b=b*a,a*c=c*a,a*d=d*a,d*b*d^-1=b^-1,d*c*d^-1=b^2*c^-1>;
// generators/relations

׿
×
𝔽


text:
Skip to main content

# The PreTeXt Guide

## SectionD.4XML Copy Editor

Michael Doob reports on 2017-02-03 that XML Copy Editor 1  works well, in particular on Windows. This is an open source program, for Windows and a variety of popular Linux distributions, that supports both DTD and RELAX-NG schemas. It is less of a general programmer's editor and more like dedicated tools for working strictly with XML documents.
xml-copy-editor.sourceforge.net/


text:
# Dell Inspiron 5370 — review and Linux notes

Feb. 24, 2018

I finally decided to replace my almost-a-decade-old laptop with a Dell Inspiron 5370. I’ll be using this post to keep running notes of my impressions of the machine and the issues that come up when running Linux on it.

## Specifications

The laptop has a 8th-generation quad-core i5-8250u processor, 8 GB RAM, 256 GB SSD and a full-HD IPS screen. There is a fingerprint sensor and a Type-C port that supports the DisplayPort standard.

## Linux hardware support

I installed Debian Stable on the system but then updated it to Testing (currently Buster) with a 4.14 kernel.

The Wi-Fi module is an Atheros QCA9377 that requires non-free firmware (provided by the package firmware-atheros) to be installed. Once this is done Wi-Fi works.

I’ve not tried setting up the fingerprint sensor.

Suspend to RAM and hibernate work, but once in ten times or so I’ve had the Wi-Fi crash on resume, requiring a reboot.

Connecting an external display over the USB-C port (using an Amazon Basics USB-C to VGA adapter) works out of the box.

Everying else works perfectly.

## General appearance

The laptop is light and sleek, designed in the general metallic ultraportable style. The outer shell is aluminium but the inner surfaces are plastic.

The keyboard is a backlit, chiclet-style, keyboard which is comfortable to type on. However, you cannot rest your hands on the laptop for long while typing since the front edge is sharp enough to bite uncomfortably into your wrists if you do so.

The touchpad has a roughened surface. It is multitouch enabled. At least on Linux, while one and two-finger actions work perfectly, three- and four-finger gestures are sometimes recognized and sometimes not.

Both the keyboard and the touchpad have a little bit of mechanical give that you would not find on, say, a Macbook.

## Display

The display is sharp and has good viewing angles.

It is a matte display. Which has its good and bad parts. Reflections are not a problem at all. A light fixture right opposite my table which would bother me no end with my old laptop does not throw any visible reflection on this machine’s display.

But perhaps because of the anti-reflective treatment the contrast is low even at maximum brightness. Also, the color balance is towards the warm side. Being used to reflective bluish displays, whites on this screen look somewhat muddy to me. I’m sure part of this is a matter of habit. But I wish Dell had made the display brighter.

## Benchmarks

Thanks to AMD’s Ryzen scare, Intel gives us a quad-core CPU with hyperthreading in the i5-8250U. But I was worried whether the performance would be limited by thermal issues. Turns out that the actual performance is not bad at all.

Even though the base frequency of the processor is 1.6 GHz, when running a parallel program that uses 8 OpenMP threads to enumerate knight’s tours on a chessboard, the CPU frequency initally jumped up to its Turbo Boost level of 3.4 GHz, fell after a few seconds to around 2.5 GHz but thereafter did not fall any further while running the process over ten minutes. The CPU temperatures levelled off at around 60 °C on a day when ambient temperature was around 25 °C. The fan spun up but the noise was not uncomfortable.

I ran the benchmarks bundled with Intel’s Math Kernel Library. For the High Performance Linpack benchmark which measures floating-point performance we get around 100 GFLOPS/s (for double precision, using four threads) while for the High Performance Conjugate Gradient benchmark which measures both floating-point performance and memory bandwidth we get around 3 GFLOP/s.

When running the Linpack benchmark the sustained processor frequency was 2.2 GHz.

The STREAM memory benchmark gives a sustained bandwidth of around 12 GB/s when runnning four threads. This is quite lower than the numbers of around 20 GB/s I have seen for the Dell XPS 13 and Acer Swift 3 which use the same processor. This is possibly because the memory on those machines is in a dual-channel configuration while the Inspiron 5370 in the configuration I bought has a single 8 GB memory module.

Here are the results of running Geekbench on my machine.

To contrast, here are the results from a XPS 13 9360 which has only marginally better scores on the single-core benchmarks (XPS: 4264, Inspiron: 4243) but does noticeably better on the multi-core benchmark (XPS: 14868, Inspiron: 13584) very likely due to the higher memory bandwidth.

## SSD

The SSD is a Hynix SC311. Casual measurement with hdparam and dd gives read speeds of around 460 MB/s and write speeds of 400 MB/s.

Apart from faster booting, there are two places where I have already found the SSD making a big differnce.

One is typessetting documents with LaTeX. For documents of a couple of pages typesetting is practically instantaneous. This takes away a big friction from my workday.

The other is situations where some program uses up all physical RAM, goes into swap and the system locks up thrashing. With Linux and a HDD I could never recover from this situation and would have to reboot. With SSD I had the pleasant experience of taking a long play break with my daughter and coming back to find my task done and my machine usable again.

## Battery life

The battery is rated at 32WHr. At maximum brightness with a few browser tabs open the power draw is around 6W. Turning the brightness to half reduces this by 1W. Installing TLP reduces it by a further 1W to around 4W.

At the other end, running my compute-intensive eight-threaded program without TLP uses around 21W. TLP limits this to around 16W.

Consistent with the above numbers I got a battery time of around 4 hours on my usual mix of work with the screen at maximum brightness and TLP not installed.

I finally choose to uninstall TLP. Even with TLP I would not be able to take the machine to work without carrying a charger. And four hours is more than sufficient to cover my commute. So it seemed safer to not have something like TLP which touches setting all across the system.

## Linux setup tips

### Secure boot

Currently the Debian installer cannot run under Secure Boot. Disable it in the BIOS before beginning installation.

### Wi-Fi

firmware-atheros needs to be installed for the Wi-Fi to work.

### Swap and limiting runaway memory use

The Debian installer’s automatic partitioning creates a swap as large as RAM to allow suspend to disk.

The downside is that a runaway process can grow to 16 GB of memory use and lock up the system because of swapping before it is killed by the OS. I have chosen to protect against this by limiting the address space that any single user process can use to 8 GB. To do this, edit the file /etc/systemd/user.conf to uncomment the line with DefaultLimitAS and set it to

DefaultLimitAS=8G:infinity

Here the 8G is the ‘soft limit’ on address space that any process will have as a default and infinity is the ‘hard limit’ to which processes can raise the bound. This way if there is a process which actually needs a larger address space, it can be accomodated by temporarily raising the limit by, say, the ulimit command in Bash.

### HiDPI

With the display running at its native resolution fonts are too small. By default GNOME allows the screen to be scaled only in integer multiples and scaling by 2 leaves too little space on this screen. Recently GNOME has added experimental support for fractional screen scaling but when I tried it the fonts were fuzzy in many applications including Emacs. For now I have settled for the following compromise. I’ve installed gnome-tweaks and used it to set font scaling to 1.7. In Firefox configuration (available by vising about:config in the URL bar) I’ve set layout.css.devPixelsPerPx to 1.5. This gives reasonably sized fonts in most places, though icons still remain small.

gnome-tweaks can also be used to turn on tap-to-click on the touchpad.
The xinput driver used for the touchpad by default does not give a right click, mapping all single-finger clicks to the primary mouse button. Instead, two-finger clicks are mapped to right-clicks and three-finger clicks are mapped to middle-clicks. It may be possible to change that, but I found the current setting fine.