Summer programming: a little PERL

Tutoring over the summer?  Why not.  During the holidays, this tutor won’t necessarily work you too hard….

 
Back in March (see here and here), I opened the topic of programming with the language PERL. Today I’ll “start at the beginning.”

If you want to actually experiment with PERL, the question is, “Are you on Linux, Mac, or Windows?”

If you’re running Linux, you can run PERL programs right now. I know so, because I use Linux – specifically, Ubuntu.

If you’re running a Mac, I’m told that once again, PERL is native to your system, so you can run PERL programs already. However, the last time I used a MAC was the AppleIIcx in 1988; therefore, I don’t speak from experience.

If you’re using Windows, you’ll likely have to download a PERL compiler. Don’t worry; it’s free and I’ve done it before. There are several good bundles you can find on the internet. Some people like ActiveState, some people like Strawberry PERL…I’ve used both.

Going forward, your only other need is a text editor, which is a program that produces files in “plain text.” Document files are not plain text; a typical word processing program will not produce plain text unless specially ordered to (if that’s even possible).

If you’re running Linux, there are many plain text editors to choose from – including, under Ubuntu, one called “text editor”. Under Windows, there’s “Notepad”, which I’ve used faithfully for many years. I think you’ll find it under Accessories.

Once again: I don’t have a Mac. However, I’m sure it contains a text editor that’s easy to find, since Macs are good for stuff like that.

For today, we’ll leave it there. I’ll continue next time with writing a couple of lines of code in the text editor, then hopefully getting it to run:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , ,

Math: Simplifying a radical (aka root) expression

For this math tutor, the end-of-semester rush is about to end. Tutoring for exam prep, you tend to return to those “messy” problems students would rather avoid….

Radical expressions are among the most difficult topics in high school math. Let’s explore an example:

√(x)7(5√(x)9)

Most people would be uncomfortable about this question. It’s really not that hard, as long as you know the exponent law

a√xb=x^(b/a)

where a, if not written, is meant to be 2.

We rewrite the expression as follows:

√(x)7(5√(x)9)=x^(7/2)x^(9/5)

The law for multiplying expressions with the same base is to add the exponents. To add these fractional exponents, we need to get a common denominator as follows:

7/2 + 9/5 = 35/10 + 18/10 = 53/10

Therefore, we have

√(x)7(5√(x)9)=x^(7/2)x^(9/5)=x^(53/10)

To simplify, we reverse the exponent law for mutliplication:

x^(53/10)=x^(50/10)*x^(3/10)=x^5*x^(3/10)

Reversing the radical-to-exponent law, we arrive at

x^5*x^(3/10)=x^5(10√(x)^3)

The answer might seem surprising. In fact, for many, this process might need still further illumination. In future posts, I’ll revisit some of the ideas used in this one. Cheers:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , ,

Math: decimals for single digits over 11

For this math tutor, the busy exam season is winding down.  Now tutoring shifts to summer maintenance, adults in night courses, and general interest….

We all know that 6/11 is a decimal. Being a fraction of two integers, it must either repeat or terminate.

It’s actually the denominator (the bottom number) that determines whether the decimal will repeat or terminate. A fraction in lowest terms will terminate if the denominator’s factors are also factors of 10. (I’ll talk more about this in upcoming posts.) 11, of course, has only the factors 1 and 11. Since 11 is not a factor of 10, no reduced fraction with denominator 11 will terminate. Instead, each such fraction must repeat.

If you try 6/11 on a calculator (by entering 6÷11), you’ll get 0.54545454….

Entering 8/11 gives 0.72727272….

Entering 4/11 yields 0.36363636….

It seems that the repeating pair of digits always sum to 9. If you try 10/11, you’ll get 0.909090…..

Clearly, the lead digit is always one less than the numerator (the top number of the fraction). At the same time, the lead digit and the second one add to nine. Therefore, we can predict the decimal for a single digit over eleven, as follows:

Example: Predict the decimal for 2/11.

Solution: We know that the first digit of the decimal will be one less than 2, which will be 1. We know that the first digit, plus the second, will add to 9. Therefore, the second digit must be 8. Our prediction is that
2/11=0.181818…

Checking with the calculator, we see the prediction is correct:)

With this method, you needn’t wonder about the decimal for a single digit over 11. I’ll be talking more about fractions and decimals in posts this summer. Hopefully, we can look forward to some relaxing time together. Cheers.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , ,

English: paradox vs oxymoron

Tutoring English 12, both these terms come up.  As an academic who loves ideas, the tutor offers his explanation of each.

Paradox and oxymoron are literary devices.  Identifying them can be worth marks on the English 12 government exam.  So, what are they?

A paradox is a statement that poses two contradictory facts, yet somehow it’s all true. An example might be

He’s a very outgoing recluse.

If someone is outgoing, why would they live like a recluse?  Yet, so many people meet that description:  they love conversing with people, but rarely go out into the world. Glenn Gould, the famous Canadian pianist, was known to be so.

Another example:

She’s so late, she’s early.

Anyone who’s ridden buses that come an hour apart, but missed one, knows this situation.

An oxymoron is a seemingly opposite description that still makes sense.  An example:

Touching the ice, he felt the burning cold in his hands.

Anyone who’s had a really cold hand knows that it can feel like it’s burning.  The body has a weak distinction between the two sensations in such a case, so that one can resemble the other.

One more oxymoron:

The proposal was met with deafening silence.

“Deafening” means “loud”, of course; yet, silence can be just as numbing as loud noise in some cases.

To wrap up:  a paradox is a seemingly contradictory statement that somehow is still true. An oxymoron is a description that seems impossible because the adjective contradicts the essence of the noun – yet, intuitively, the description rings true.

Whichever impossibility you face or witness, might it be described as a paradox or with an oxymoron?  We all struggle daily with facts that seem incredible:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , ,

Math: a difficult factoring problem

Heading towards exams, tutoring returns to factoring and other challenging topics. The math tutor shows how to solve a factoring problem that, at high school level, might be difficult.

Suppose you are faced with the following problem:

Solve -6x5+46x3+72x=0

This problem, when broken into the right steps, is not too hard. However, the steps are numerous.

Step 1:

Like most problems you encounter that contain x2 or higher, you must factor. At the beginning of every factoring process comes the question: Is there a common factor? (For a crash course in common factoring, look here.)

We realize that, in our case, there indeed is a common factor: -2x. (As I mention in my post about common factoring, whenever the lead term is negative, you should factor the negative out.)

After the common factor is taken out front, we arrive at

-6x5+46x3+72x=-2x(3x4-23x2-36)=0

Step 2:

We are now faced with how to factor the “inside”: 3x4-23x2-36. Of course, the common factor has already been removed. Since the lead coefficient is a 3, rather than a 1, we must use complex trinomial factoring:

i) Examining 3x4-23x2-36, we multiply 3(-36) to get -108.

ii) We need to find two numbers that multiply to -108, but add to -23 (the middle term). We start writing down pairs of numbers that multiply to make 108.

1 108
2 54
3 36
4 27
6 18
9 12
12 9

Once your number pairs reverse to earlier combinations, you won’t get anything new.

iii) Among the numbers we’ve tabulated above, we must find the pair that, if one is negative, can also add to make -23 (the second term in 3x4-23x2-36). We notice the pair to be 4 and 27, if we make 27 negative. Once again: one of the pair has to be negative, since, as mentioned above, the pair must actually multiply to -108.

iv) We rewrite 3x4-23x2-36 with its middle term shown as the sum of 4 and -27:

3x4-23x2-36=3x4+4x2-27x2-36

v) We separate the rewritten expression into two pairs, then common factor each pair:

(3x4+4x2)+(-27x2-36)=x2(3x2+4)-9(3x2+4)

vi) The repeating factor (3x2+4) indicates we are successful. Now, we reorganize our factored expression into two brackets:

x2(3x2+4)-9(3x2+4)=(x2-9)(3x2+4)

Step 3: We rewrite our original equation in factored form:

-6x5+46x3+72x=-2x(x2-9)(3x2+4)

We now notice the term (x2-9). Being a difference of squares, it can be factored to (x+3)(x-3). Finally, we arrive at

-2x(x+3)(x-3)(3x2+4)=0

Step 4: We need to solve the equation: we need to report the values of x that will make the left side equal to 0. We use the following reasoning:

If several values multiply to make zero, one of them must already be zero.

Therefore,

-2x(x+3)(x-3)(3x2+4)=0

implies that either -2x=0, or (x+3)=0, or (x-3)=0, or (3x2+4)=0. One by one, we consider each possibility:

If -2x=0, then x=0. Therefore, x=0 is one solution.

If (x+3)=0, then x=-3. Therefore, x=-3 is a solution.

If (x-3)=0, then x=3. Therefore, x=3 is a solution.

Since, in the real numbers, x2 cannot be negative, (3x2+4) cannot be equal to zero. It yields no solutions.

Our solutions to the seemingly endless problem -6x5+46x3+72x=0 are, finally, x=0, x=3, and x=-3.

You wouldn’t see many problems this difficult on a high school exam; you might encounter one. Good luck with it!

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , , ,

English: preposition at the end of a sentence?

Tutoring English, you can’t avoid this issue forever.  The English tutor weighs in.

In old times, there was a rule against finishing a sentence with a preposition. Thus,

“Who(m) did you say that to?”

was gauche.  Was it wrong, or just in poor taste?  I don’t recall; I’m too young to have felt the rule full force.  Growing up in the 70s and 80s, I can’t remember its enforcement at school.  However, I did hear it mentioned among adults.  Many of the adults I grew up around were academic.

I haven’t heard of the rule for decades now; still, I’m conscious when I break it.  The obvious question is, “If you care about the rule, then why do you break it?”

The reason I do break the rule is that

“To whom did you say that?”

is unexpected.  When you talk in an unexpected way, people more likely miss your meaning.  To talk to people effectively, you must “speak the same language.”  If they end their sentences with prepositions, you might do well to follow.

Written communication differs from spoken; just the fact that it’s written makes it potentially more formal.  In print, people are more willing to tolerate different phrasings from what they, themselves, would use. Therefore, to uphold the rule of not finishing a sentence with a preposition, is more agreeably done in writing.

There still lurk, in university corridors, plush parlours, and brown studies, people who would be mortified to finish a sentence with a preposition.  In their circles, so be it.  That attention to detail – that belief that something has to be perfect in order to be acceptable – has brought tremendous success to England.  It’s ultimately why so many of us speak English today – even if those defenders of the language believe we do so quite badly:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with:

Space exploration: How (why) is Pluto not a planet?

In my tutoring sessions, space exploration is rarely discussed.  As a tutor, as well as a person, I’ve wondered why Pluto is “no longer” a planet.

When one of my kids came home from grade 3 science, telling me Pluto is not a planet, I was surprised.  I’d heard murmurings in that direction, but thought they’d peter out.  Although not altogether certain of Pluto’s solar year, I knew it was over two hundred Earth years.  How could a “planet” whose orbit takes over two hundred years to complete, cease to be a planet during my 44 years?

I guess Pluto’s actual designation changed in 2006, although it had been debated since 1977.  What forced a decision was the discovery of Eris (January 2005), another orbiting body in our solar system.  Eris is heavier than Pluto, but further away from the sun.  Being heavier, it should be a planet as well, if Pluto is.  Yet, its remoteness (it averages roughly twice as far from the sun as Pluto), combined with its small size (although heavier than Pluto, its size is about the same), convinced most scientists to reject it as a planet.  Therefore, Pluto, being even lighter, ceased to be a planet as well.  That’s probably a simplified explanation of the reasoning, but I’d say it’s substantially correct.

Both Pluto and Eris are now “dwarf planets.”  Interestingly, they’re not the only two.  This research has yielded a few surprises, which I’ll share in upcoming posts.

I’m not entirely sure I agree with Pluto’s new designation. In that regard, I’m not alone.  As a kid from the ’70s, I was told there were nine planets, Pluto being one.  In your own quiet moments, gazing up at the night sky, may you find peace with this issue, whichever inclination you assume:)

Wikipedia was a source for this article: here, and here.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , ,

Essay writing: the thesis statement

When you tutor high school English, essay writing is a key topic.  Therefore, the thesis statement is often a focus during English tutoring.

Let’s imagine you write an essay about why camping is great.  (I don’t happen to like camping, but you don’t have to believe in a topic to write a successful essay about it.) You begin with an introductory paragraph that contains a few reflections about camping. From most people’s point of view, the last sentence of the introductory paragraph should be the thesis statement.

Let’s imagine now you’ve finished the essay, your excitement about camping having propelled you through the body paragraphs and conclusion.  You look back.  Here’s what you see:

body paragraph 1:

One great benefit of camping is meeting new people at the campsite.  Since often you’re camped in neighboring spaces…..

body paragraph 2:

Another great feature of camping is being out in the fresh air.  Anyone from the city will quickly notice…..

body paragraph 3:

Yet another great dimension of camping is the family time uninterrupted by work, scheduled activities, or TV shows.  Families often find camping brings them closer….

Now, you look at your introductory paragraph:

introductory paragraph:

Commonly, people love camping.  It is a staple of summer vacations.  Taking afternoon walks along forest paths, roasting hot dogs, and looking up at the starry sky from around the fire are cherished memories of any camper.  Not only must such memories be passed down, but in fact everyone should have them, even if they don’t grow up with a camping tradition.  Usually, people who are skeptical about camping turn out to love it.

With that introductory paragraph, followed by the body paragraphs referred to earlier, the essay will be a “fail”.  Why?  Simple:  it doesn’t have a thesis statement.  An essay that lacks a thesis statement, or else fails to prove its thesis, will get a failing grade.

Since the essay lacks a thesis statement, let’s give it one.  We’ll add a thesis statement at the end of the introduction, as follows:

introductory paragraph with thesis statement added:

Commonly, people love camping.  It is a staple of summer vacations.  Taking afternoon walks along forest paths, roasting hot dogs, and looking up at the starry sky from around the fire are cherished memories of any camper.  Not only must such memories be passed down, but in fact everyone should have them, even if they don’t grow up with a camping tradition.  Usually,people who are skeptical about camping turn out to love it.  There are three great benefits of camping:  meeting new people, being out in the fresh air, and spending time together as a family.

Now, having a thesis statement that mentions the topics in its three body paragraphs, the essay has jumped from a “fail” to a “B” (or thereabouts).   Of course, it needs a conclusion, which will recap the intro and restate the thesis.  Usually, the conclusion is shorter than the introduction.  With a little polish, moving up from “B” to “A” is not too difficult.

The way to fail an essay is to lack a thesis statement or else fail to prove it.  The way to write a B-range essay is to include, in the introductory paragraph, an obvious thesis statement that connects with the body paragraphs that follow.  The way to go from “B” to “A” is with polish.

I’ll have much more to say about essay writing in upcoming posts.  The weekend promises to be sunny and fine; some people are talking about going camping.  Not me:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: ,

Arc length: the proportion method

Tutoring math 12, you cover arc length.  The math tutor describes a method students from a generation ago might appreciate.

Arc length is distance along the circumference of a circle.  Following a 360° angle, you of course travel the entire circumference, which is 2πr, r being the radius.

What is you’re traveling less the 360°?  How can you calculate the corresponding arc length?

Example:  Calculate the arc length of a 110° angle on a circle of diameter 15 cm.

Solution: First, realize that half the diameter is the radius. Therefore, the radius of this circle is 7.5cm.

Next, set up the following proportion:

110/360=x/(2π7.5)

Next, we invoke the old “cross multiplication” trick described here. It yields

360x=110(2π7.5)

Dividing both sides by 360, we get

x=110(2π7.5)/360=14.4cm

Apparently the arc length, if we only traverse 110°, is 14.4cm. Given that the arc length would be 2π(7.5)=47.1cm for the entire circle, our answer makes sense. 110 is just under a third of 360; correspondingly, 14.4cm is just under a third of 47.1cm.

I’ll be covering another method for arc length soon. Cheers:)

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: ,

Math: the pigeonhole principle

Tutoring math, you might see this topic from a university student.  The math tutor offers it as a point of interest.

The pigeonhole principle is used to solve counting problems.  A simple example:

In a ten day stretch, how many days must it rain to guarantee two consecutive days of rain?

The answer is six, and here’s why:

Step 1:  Organize the numbers from 1 to 10 into sets of two consecutive numbers:

{1,2}, {3,4}, {5,6}, {7,8}, {9,10}

Step 2: Imagine each number represents a day.  If we pick only five numbers, we can pick one from each set, potentially avoiding a consecutive pair (we can pick 1,3,5,7, and 9, for instance).  However, when we pick the sixth one, we must return to one of the five pairs from which we’ve already drawn.  Therefore, we must pick the second number of a consecutive pair, guaranteeing two consecutive days of rain.

Looking at the example above from the point of view of the pigeonhole principle, the pigeons are the numbers we pick, while the holes are the sets of consecutive pairs.  If we have six pigeons, but only five holes whence they came, two must come from the same hole.

The pigeonhole principle can be used to solve some surprising problems.  We’ll look at other examples in upcoming posts:)

Source: Grimaldi, Ralph. Discrete and Combinatorial Mathematics.
  Addison-Wesley,1994.

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Tagged with: , ,
Top
%d bloggers like this: