Subscription

Books
Shop
About

Wednesday, October 16, 2013

Course within a course

Because it's time I did something new, because I am/was worried that my programming "skills" from the late 90s need updating. Because...
I finally did it. I'm finally using Coursera! I had worried about the video format (my internet plan allows only a few gigabytes of data monthly, so I don't use a lot of video online; then also the speeds could be frustrating, in the tens of kB/sec often, but on good days in the hundreds.)

The thing to do is to start anyway, and I have started, and I am impressed with Coursera so far.

The impetus for this experiment with online learning was my sizable teaching load.  I have some large classes with about 100 students and had to split them into two or three groups to get any chance of doing a good job.  For now, it's not understood in my country that you can teach a course in sections, so if there are 500 1st year students who need to take Physics, you fit them in an auditorium for Physics 101, you should by no means create 5 or 10 groups of Physics 101.  They say it's because of cost, but I think it's because of inertia/habit. 
Doll within a doll: Matryoshka dolls

Anyhow, I needed to get more time away from stressful, low-yield teaching tasks that don't scale well, and still get the students to learn more through fun, interactive methods. So I recommended two Coursera courses as a required part of my "Internet and Web Applications Technology" course this semester. They are: "Internet History, Technology, and Security" which is shaping up to be really exciting, and "Introduction to Programming for Musicians and Digital Artists" which I hope will take the perceived dryness out of programming and be cool enough to get the whole class programming.

Because there is a Certificate of sorts from Coursera for doing the work to a reasonable level, I can give course credit for it: about 30% of course credit for taking these two easy courses.

Using the MOOCs is an amazing teaching solution for many reasons.
First, Charles Severance and team know a bit more internet history than I do, so why not let them do the job?
Second, it's not so easy to cheat/copy in these courses, compared with homework I assign. I mean, it takes almost as much effort to copy as to do the work. And anyhow, they will experience significant pushback against their attempts to plagiarize.  Note, my kids are not bad people, it's just that copying seems to be part of national culture.
Third, I can spend class time doing other things (including taking my own online courses and theirs)
Fourth, they can interact with a global classroom; ask and answer questions, assure themselves that they're learning at a world standard, etc.
It costs a bit to get internet, but hey, if I can afford it, so can they; they can definitely watch in groups to cut the cost.

Besides Coursera, I've also used Khan Academy, with good results. At my present school, most of my engineering students somehow arrive in the third year with poor basic math skills. So I start off each course by assigning a massive precalculus/calculus assignment (functions, trigonometry, complex numbers, derivatives) in Khan.  I would like to assign integral calculus as well, but it seems the problem sets stop at derivatives for now.

One good thing about Khan is that it's very hard to cheat with the randomized questions, so they find they might as well do the work.  I think Coursera might have randomized questions too - not sure - but they should consider that.    Also, the coach/instructor can monitor all their work in the backend of the site and - yippee - assign course credit, since for many students, course credit is the main thing that would cause them to do the work.
Whatever happened to just learning for fun? ? 

It's a busy month, but I'll be back later with more analyses of games, and more on prime numbers.  

Friday, September 27, 2013

Chuzzle Puzzle Guzzle

Chuzzle is an addictive little game I found on my cellphone.  You move rows and columns of these dollfaces around to match them by colour so they explode and disappear.
   
It is a rather daft game, with one exception - the Mindbender mode. With Mindbender, you have to arrange the chuzzles into a pre-specified pattern.  It's a nice challenge, so I did all the 100 available patterns.
Having figured out how to replace/substitute colours and all, maybe I'll be able to do a Rubik's cube someday.
Magic Cube - you know how to solve this?
For now, I guess flat / two-dimensional puzzles are enough of a challenge.  Like this picture puzzle, which to me is easy once you've numbered the tiles.
Click to download and play FREE
I'll be back soon with more on primes.

Saturday, August 3, 2013

The difference between two (consecutive) prime numbers

Recall that
The Continuous derivative method of finding a formula for the estimated difference between two prime numbers
Applying the Product Rule for differentiating functions, P'(n) , the derivative of Prime(n),
is ~= α(n.1/n + 1.log n) = α( 1 + log n )
Yes, the derivative is usually for continuous functions, while Prime[n] is discrete, but approximating this way is OK because it's useful. 
What the derivative means is: let Δ be a reasonably small value, then P(n+Δ) ~= P(n) + Δ.P'(n)
This implies that if we want P(n+1), we may put Δ=1 above and the (n+1)th prime number is approximately P(n) + P'(n), i.e. just add α( 1 + log n )  to the nth prime number.
Got it?
The (n+1)th prime number, note α around 1.1
What is this useful for? 
We've already seen that we may estimate the prime numbers with so-so results using the formula for the nth prime.
But we may sometimes get closer approximations when we seek a prime number, the (n+1)th prime for instance, using the difference formula and prior knowledge of the nth prime.   

Examples:
If we know the 99th prime number to be 523, what is the 100th prime?
Add 1.2(1+log99) to 523 , to get 523+6.714 ~= 530.
Oh well, this is not a prime number and it's still pretty far from the 100th prime (541), but the formula works better sometimes,
e.g. the 101st prime, given the 100th prime is 541 is
estimated to be 541+1.2(1+ln100) = 541 + 6.726 ~= 547.7
and in actual fact is 547

The finite/discrete derivation of the formula for the estimated difference between two consecutive primes
This yields similar/close results to the continuous derivative steps above:
P[n+1] - P[n] ~= α.(n+1).log(n+1) - α.n.logn
 = α [ n.log(n+1) + log(n+1) - n.log(n) ] 
 = α [ log ( (n+1)^n ) - log (n^n) + log (n+1) ] 
=  α [ log ( {(n+1) / n}^n . (n+1) ) ]
= α [ log {(1 + 1/n)^n .(n+1)} ] 
and at this point, you need the fact that (1+ 1/n)^n is approximately e, which has log 1, for reasonably large n.  For example (1+1/5)^5 is about 2.5, while 1.01^100 is about 2.7.  Anyway, moving on...
so P[n+1] - P[n] ~= α.log(e.(n+1)) = α.[1+log(n+1)] 

What should be done about the difference between the continuous and the discrete formulae?
Ignore the fact that the difference has 1+log(n+1) here, but 1+log(n) in the first derivation.
We might have even chosen to use the derivative at n+1/2Δ instead of at n as we did, and got the difference P[n+1] - P[n] ~= α.[1+log(n+ 1/2)]   
Anyway, when n>>1, log(n) is very close to log(n+1) in the sense that it's much smaller than 1 and much smaller than n: how to see this is another short exercise in using the derivative :) i.e. the derivative of log(n) is 1/n which is << 1 << n

Answers to two previous questions
 1. How does one know that there is no largest PRIME number?  Because when we think we've found the biggest, here is an estimate for the next one...add 1+log(n+1) to it. 
2. How do you know if α > 1?  Sorry I thought I knew, but I don't (yet.) 

Thursday, August 1, 2013

The nth prime number

What is the relationship between Prime[n] and n?  Prime[n] by the way is a "function" in Mathematica that gives the nth prime number.
For me, the story of finding it did not start with that specific question, it started with play.
I was playing with the tutorial on my Mathematica installation (v7), it had a plot of Prime[n] against n, say for n from 1 to 100.  So of course you extend that say 1 to 10000, wow cool, and extend it again till the program stalls.
The next time you try this, you notice the graph of Prime[n] against n which is many points really close together bears a striking resemblance to...log(n) or something.  So you plot Prime[n] against n.log(n) and sure enough, well it's a little stochastic looking but it sort of stays within a small constant range 1.1 - 1.2.  More precisely, for small n, Prime[n] ~= 1.2 n log(n)...and for the largest n I could compute, Prime[n] ~= 1.1 n log(n), or if you let α vary a little around 1.15, Prime[n] = α . n log (n)

Why won't I just show you the plots?  Well, I've been procrastinating forever writing this post, and just minutes ago found that my Mathematica license expired.  Dang!  I thought the license was forever to be honest :) Fingers crossed it'll be renewed soon.

Cool question: I wonder if there is a limit to what α can be.  It seems to decrease gently from 1.2 for n in the 10-1000 range, to 1.1 for n much larger.  But for n a lot larger than that, is α ever going to go below 1?  Is there a guarantee that the "slope" of the graph Prime[n] against n.log(n) , averagely speaking, stays above 1 even for n very large?  I'll say yes for now, that the asymptote of that slope or ratio is 1 and I have "proof", but I want to know what you think.

In summary,
Clearly useful for estimating the nth prime number
Note: The log used in this law is the natural logarithm (so called ln) not the base 10 logarithm (often denoted log)

Meanwhile, we can use the knowledge we already have, say to compute the 100th prime number as Prime[100] ~= 1.2 * 100 ln 100
~= 1.2 * 100 * 4.60517018599 
= 552.620422319 , so the 100th prime number is around 552 or 553?  
If we instead used α = 1.1 we would get the estimate Prime[100]=506.568720459
Nifty tool: I just typed "what is log 100" in google search box, and a calculator appeared.  Just remember to use ln not log.  
In reality, the 100th prime number is 541, not 553, not 507, but still, not too bad?  

Blog Archive

My Other Blogs

About Me

Followers