People can wonder why problem solving is not enough to get things changed, so I like finding real world examples which are FAMOUS to help get perspective. So, for instance the US Postal service is having well publicized difficulties.
And it turns out I actually first put out a post trying to help them three years ago back in August 2010.
My original idea talked about scanning a letter at the post office but the concept boils down to print on demand for an electronically sent document.
And here we are three years later and it's worth talking about some more. And three years isn't a long time in the world of ideas. Typical time frame, remarkably enough, is 20 years in the old world. Don't believe me? Then read then the Wikipedia article about sliced bread.
I'm thinking things can get a bit faster today, though the problem isn't just getting the idea out there. People can get stuck in their ways. So the real problem is shifting them out of their comfort zone, into recognition that the suggested change is a better way to go.
Now then, with the new idea, if you print out a letter at a regional center closest to where the letter is supposed to go, you shorten the distance a physical thing is carried, allowing cyberspace to help out by transmitting the information.
So the idea would be to let you deliver a physical letter through cyberspace by having print on demand local to the delivery location removing the need to transport a physical letter all over the place when you just wish the information in a PHYSICAL letter to be delivered, so for instance it gets a postmark.
Notice that also is another way to possibly do next day delivery for people and businesses who don't care if someone else prints and stuffs their letter into an envelope for them!
Print on demand has been around for a while, and I'm guessing there is machine envelop stuffing available.
And the post office could charge a premium for the service which could let people pay bills overnight, using their debit cards of course, to have a postal money order stuffed into there too! Or you could send money to a relative quickly, and I don't know what the post office can or cannot do, or whom they can or cannot compete with, but that is for the US Congress to work out.
But regardless, imagine mailing a physical letter to someone you need to contact, by the next day, by emailing it to the post office which will print it out, stuff it into an envelope and deliver it?
Or postcards! What if the post office printed out post cards on demand instead of shipping them around the globe?
Do I believe this will be possible some day? Yes. For all I know there are post offices in other countries already doing it.
Would I like to have it now? YES! I'd love to be able to send a physical letter, with that wonderful thing called a postmark, by emailing the post office or using some online form, and paying for it all online.
I actually trust the US Post Office. It is one of the most trustworthy government institutions.
I think a lot of other people trust the US Post Office as well, and feel SAFER with it than with using other sources, and also, yup, again, get that often critical POSTMARK.
New ideas can seem weird to people at first. But so did sliced bread. Someday I think people will puzzle that there was ever a time in an advanced, technologically savvy country that the post office didn't allow people to electronically send in letters to be physically printed out and delivered!
They'll wonder how such a simple idea could have taken so much to be implemented.
James Harris
Blog ran by me, James Harris. And I like to write. Where ideas rule. Mystery matters. Control must have its limits.
Translate
Wednesday, August 28, 2013
Print on demand and the post office
Labels:
business,
out of the box,
problem solving
Friday, August 02, 2013
Why talk math here?
With several posts now focusing on math results, some might wonder why I'm doing it on this blog, and I wonder as well! And I figure things out at times by typing up a post, as I like to think out loud, so here is a post where I try to explain it.
Best way is to put up a math result which isn't mine, and is ancient so I can talk around it, and what it means to me. I've posted about it before, so the information is already been put up, and I'll repeat to explain more about my motivations.
The equation in focus is x2 - Dy2 = 1, in rationals, which means you have fractions, so to program a solution to it that I'm about to give you need to use doubles.
Turns out you can solve it parametrically, which just means you only need to change one variable:
x = (D + t2)/(D - t2)
and
y = -2t/(D - t2)
So if you have a value for D, then you just shift t, and that gives you x and y.
Cool. Makes solving the thing with fractions--not integers--nice and easy.
And if that all seems strange, like why would you want to solve it parametrically with fractions, well notice that with D = -1, the first equation is the circle: x2 + y2 = 1
And, yeah, people have reasons to solve for circles, right? So what does D do? Well it shifts things around between ellipses, which includes the circle, and hyperbolas. So with it negative, you have ellipses, while with it positive, you have hyperbolas, and D=0 is worthless, as that just gives x=1 or -1, so we don't care about it.
That result has been known to humanity for over 340 years, which I say because Pierre Fermat, who is a famous math dude, knew about it, and he has been dead since 1665. And I noted the above when I posted about it before, so why bother mentioning again now?
Because I never heard of that solution for x and y, until I had re-discovered it myself, got all excited, ready to run off and BRAG, and found out it had been known for centuries. But I had to dig!!!
So why isn't it a standard result, routinely taught? The circle paramaterization IS routinely taught, and is, again, when D=-1, and you have:
x = (1 - t2)/(1 + t2) and y = 2t/(1 + t2)
And you can go look that up to verify, but the earlier result? Wasn't so easy for me to look up and find it, and I think it's a cool result and wish I'd had it years ago when I played around with programming things like drawing circles, and other things.
People who write computer programs appreciate parametric solutions as you can focus just on what matters, and here, the focus is on D, and you don't have to play with square roots, or all kinds of others things, and yes there are parametric solutions for ellipses or hyperbolas, but here is ONE for both of them!
Efficiency. I like efficiency.
And why isn't this thing regularly taught?
Well I have theories, and my best guess is most modern mathematicians don't care about practical. And to them it's a useless little thing, which they don't think is worth discussing!
But I like practical. I don't care if mathematicians like talking about something or not. I like to DO things with math, as I'm a practical guy who codes for a purpose.
When I write a computer program I want it to DO something. I really don't care if some academic somewhere thinks that a tool I'm using is exciting to him or not.
So I talk about it because it's interesting to me, and I think it's a cool tool.
Which is why I include math results that I think are cool tools. They have a purpose. You can DO things with them, like count primes. And they're simple! I love simple.
James Harris
Best way is to put up a math result which isn't mine, and is ancient so I can talk around it, and what it means to me. I've posted about it before, so the information is already been put up, and I'll repeat to explain more about my motivations.
The equation in focus is x2 - Dy2 = 1, in rationals, which means you have fractions, so to program a solution to it that I'm about to give you need to use doubles.
Turns out you can solve it parametrically, which just means you only need to change one variable:
x = (D + t2)/(D - t2)
and
y = -2t/(D - t2)
So if you have a value for D, then you just shift t, and that gives you x and y.
Cool. Makes solving the thing with fractions--not integers--nice and easy.
And if that all seems strange, like why would you want to solve it parametrically with fractions, well notice that with D = -1, the first equation is the circle: x2 + y2 = 1
And, yeah, people have reasons to solve for circles, right? So what does D do? Well it shifts things around between ellipses, which includes the circle, and hyperbolas. So with it negative, you have ellipses, while with it positive, you have hyperbolas, and D=0 is worthless, as that just gives x=1 or -1, so we don't care about it.
That result has been known to humanity for over 340 years, which I say because Pierre Fermat, who is a famous math dude, knew about it, and he has been dead since 1665. And I noted the above when I posted about it before, so why bother mentioning again now?
Because I never heard of that solution for x and y, until I had re-discovered it myself, got all excited, ready to run off and BRAG, and found out it had been known for centuries. But I had to dig!!!
So why isn't it a standard result, routinely taught? The circle paramaterization IS routinely taught, and is, again, when D=-1, and you have:
x = (1 - t2)/(1 + t2) and y = 2t/(1 + t2)
And you can go look that up to verify, but the earlier result? Wasn't so easy for me to look up and find it, and I think it's a cool result and wish I'd had it years ago when I played around with programming things like drawing circles, and other things.
People who write computer programs appreciate parametric solutions as you can focus just on what matters, and here, the focus is on D, and you don't have to play with square roots, or all kinds of others things, and yes there are parametric solutions for ellipses or hyperbolas, but here is ONE for both of them!
Efficiency. I like efficiency.
And why isn't this thing regularly taught?
Well I have theories, and my best guess is most modern mathematicians don't care about practical. And to them it's a useless little thing, which they don't think is worth discussing!
But I like practical. I don't care if mathematicians like talking about something or not. I like to DO things with math, as I'm a practical guy who codes for a purpose.
When I write a computer program I want it to DO something. I really don't care if some academic somewhere thinks that a tool I'm using is exciting to him or not.
So I talk about it because it's interesting to me, and I think it's a cool tool.
Which is why I include math results that I think are cool tools. They have a purpose. You can DO things with them, like count primes. And they're simple! I love simple.
James Harris
Labels:
behind the scenes,
number theory
Friday, July 26, 2013
Power of simpler math
I found one of the best mathematical results in human history which is a simpler way to reduce things called binary quadratic Diophantine equations. That is, equations that look like this general case:
c1x2 + c2xy + c3y2 = c4 + c5x + c6y
where x and y are the unknowns to be figured out. A simple example of such an equation is:
x2 + 2xy + 3y2 = 4 + 5x + 6y
where I've simply used, c1 = 1, c2 = 2, c3 = 3, c4 = 4, c5 = 5, c6 = 6.
With my simple example above I can reduce to a simpler form using my own research to get:
(-4(x+y) + 10)2 + 2s2 = 166
Now you can solve for x+y and s, and it's easier to find that s = 9 works, and x+y = 2 or 3, and x = 4, y = -2 is a solution. To see me work through in more detail, click here.
Now you may say, so what? Well, turns out we can immediately use this thing to get a simple result previously unknown before I discovered it, which is one of the greatest math finds of all time, and we're going to use it for some simple math trivia and approximate the square root of 2 with it.
And I start with a simple equation:
u2 + Dv2 = F.
And with my general method to reduce binary quadratic Diophantine equation we can find that:
(u-Dv)2 + D(u+v)2 = F(D+1)
And I'm now going to let D = -2, F = 1, since we're going after the square root of 2, and to make the equation look like a more familiar one I'm going to shift variables with: u=x, v=y, so my original is now:
x2 - 2y2 = 1
And now I can crank through my result to get:
(x+2y)2 - 2(x+y)2 = -1
And it's iterative! So I can do it again and again:
(3x+4y)2 - 2(2x + 3y)2 = 1
Next is:
(7x + 10y)2 - 2(5x + 7y)2 = -1
And iterating one more time:
(17x + 24y)2 - 2(12x + 17y)2 = 1
And the more astute of you may have noticed that x = 1, y = 0 is a solution to the original equation, so guess what? We've solved the original equation as well with JUST my research result. Using that on the last:
(17)2 - 2(12)2 = 1
And we can still iterate, but let's do it now with just the numbers.
So now for another iteration: x = 17, y = 12,
so: (3(17)+4(12))2 - 2(2(17) + 3(12))2 = -1
Which is: (99)2 - 2(70)2 = -1
And that gives the slightly more impressive approximation of 99/70 is about: 1.4142
And if you're bored you can just keep going! Where now x=99 and y=70. And it works out to infinity with ever more precise approximations to sqrt(2).
Next one is: x=577, y=408, and 577/408 is approximately 1.41421.
Why do these solutions approximate the positive square root of 2?
Because x2 - 2y2 = 1, is:
(x2 - 1)/y2 = 2, and you can just take the square root of both sides now:
sqrt(x2 - 1)/y = sqrt(2), so the trick then is that approximately x/y = sqrt(2).
And x2 - 2y2 = 1 was used over a thousand years ago, and one of its uses was, yup, approximating square roots, and I wonder if I'd have been cheered if I showed some of the ancients my simple result above?
I've used my result with much bigger things though.
James Harris
c1x2 + c2xy + c3y2 = c4 + c5x + c6y
where x and y are the unknowns to be figured out. A simple example of such an equation is:
x2 + 2xy + 3y2 = 4 + 5x + 6y
where I've simply used, c1 = 1, c2 = 2, c3 = 3, c4 = 4, c5 = 5, c6 = 6.
With my simple example above I can reduce to a simpler form using my own research to get:
(-4(x+y) + 10)2 + 2s2 = 166
Now you can solve for x+y and s, and it's easier to find that s = 9 works, and x+y = 2 or 3, and x = 4, y = -2 is a solution. To see me work through in more detail, click here.
Now you may say, so what? Well, turns out we can immediately use this thing to get a simple result previously unknown before I discovered it, which is one of the greatest math finds of all time, and we're going to use it for some simple math trivia and approximate the square root of 2 with it.
And I start with a simple equation:
u2 + Dv2 = F.
And with my general method to reduce binary quadratic Diophantine equation we can find that:
(u-Dv)2 + D(u+v)2 = F(D+1)
And I'm now going to let D = -2, F = 1, since we're going after the square root of 2, and to make the equation look like a more familiar one I'm going to shift variables with: u=x, v=y, so my original is now:
x2 - 2y2 = 1
And now I can crank through my result to get:
(x+2y)2 - 2(x+y)2 = -1
And it's iterative! So I can do it again and again:
(3x+4y)2 - 2(2x + 3y)2 = 1
Next is:
(7x + 10y)2 - 2(5x + 7y)2 = -1
And iterating one more time:
(17x + 24y)2 - 2(12x + 17y)2 = 1
And the more astute of you may have noticed that x = 1, y = 0 is a solution to the original equation, so guess what? We've solved the original equation as well with JUST my research result. Using that on the last:
(17)2 - 2(12)2 = 1
And we can still iterate, but let's do it now with just the numbers.
So now for another iteration: x = 17, y = 12,
so: (3(17)+4(12))2 - 2(2(17) + 3(12))2 = -1
Which is: (99)2 - 2(70)2 = -1
And that gives the slightly more impressive approximation of 99/70 is about: 1.4142
And if you're bored you can just keep going! Where now x=99 and y=70. And it works out to infinity with ever more precise approximations to sqrt(2).
Next one is: x=577, y=408, and 577/408 is approximately 1.41421.
Why do these solutions approximate the positive square root of 2?
Because x2 - 2y2 = 1, is:
(x2 - 1)/y2 = 2, and you can just take the square root of both sides now:
sqrt(x2 - 1)/y = sqrt(2), so the trick then is that approximately x/y = sqrt(2).
And x2 - 2y2 = 1 was used over a thousand years ago, and one of its uses was, yup, approximating square roots, and I wonder if I'd have been cheered if I showed some of the ancients my simple result above?
I've used my result with much bigger things though.
James Harris
Labels:
number theory
Tuesday, July 02, 2013
Class Viewer troubleshooting advice
Update July 3 2014: There was a change to how javadocs are accessed in Java 8. The latest version of Class Viewer dated July 3, 2014 addresses this change with backward compatibility for earlier versions. If you are not getting javadocs to the method please upgrade to this latest version.
-----------------------
A great thing about writing applications in Java is how well they can move around the world, across platforms. And for the most part my Class Viewer application can be used on any platform with Java, but it does do some things that are platform dependent like call your web browser.
Configuring for your system is all in ClassViewerConfig.xml which is where the app goes to see how to do such things. And I just edit it with a text editor.
If you run into problems with my Class Viewer, my guess is you likely need to make a change there.
For the browser and text editor everything is conveniently at the top with the BrowserLoc and Editor sections.
C:\\Program Files\\Mozilla Firefox\\firefox.exe
C:\\Program Files\\gedit\\bin\\gedit.exe
Yes
+
Which is what I have as default for systems with Microsoft's Windows.
And if what's there doesn't work then change it to something that does.
If you have a different browser you just change BrowserLoc, and same for your text editor.
If what you try doesn't work the app will put up an error message telling you what it tried.
I ran into a problem recently out of the blue where Windows wanted quotes before it would call gedit, and I have no clue why and don't care. I just added the quotes and it worked. So I had:
"C:\\Program Files\\gedit\\bin\\gedit.exe" The default for Linux users is:
firefox
gedit
Yes
+
Where it's simpler, and thus easier to change to your own preferences.
But I'm just helping people with those operating systems use Class Viewer while anyone who can run Java just needs to put in what will run on theirs.
Most troubleshooting issues I've found go back to what is in your ClassViewerConfig.xml, or your classpath.
As usual with Java make sure you have the classpath you need to get to programs you want.
You can check your classpath in Class Viewer to know where it is looking.
Any others having problems not covered here? If so, please comment, and I'll try to address any other issues.
James Harris
Updated: Changed packagedirectory.xml to ClassViewerConfig.xml--June 28 2014 __JSH
-----------------------
A great thing about writing applications in Java is how well they can move around the world, across platforms. And for the most part my Class Viewer application can be used on any platform with Java, but it does do some things that are platform dependent like call your web browser.
Configuring for your system is all in ClassViewerConfig.xml which is where the app goes to see how to do such things. And I just edit it with a text editor.
If you run into problems with my Class Viewer, my guess is you likely need to make a change there.
For the browser and text editor everything is conveniently at the top with the BrowserLoc and Editor sections.
Which is what I have as default for systems with Microsoft's Windows.
And if what's there doesn't work then change it to something that does.
If you have a different browser you just change BrowserLoc, and same for your text editor.
If what you try doesn't work the app will put up an error message telling you what it tried.
I ran into a problem recently out of the blue where Windows wanted quotes before it would call gedit, and I have no clue why and don't care. I just added the quotes and it worked. So I had:
Where it's simpler, and thus easier to change to your own preferences.
But I'm just helping people with those operating systems use Class Viewer while anyone who can run Java just needs to put in what will run on theirs.
Most troubleshooting issues I've found go back to what is in your ClassViewerConfig.xml, or your classpath.
As usual with Java make sure you have the classpath you need to get to programs you want.
You can check your classpath in Class Viewer to know where it is looking.
Any others having problems not covered here? If so, please comment, and I'll try to address any other issues.
James Harris
Updated: Changed packagedirectory.xml to ClassViewerConfig.xml--June 28 2014 __JSH
Labels:
project
Saturday, June 29, 2013
Diophantine modular solution
So I have math results that I've had for YEARS and it has occurred to me that maybe some of them might be of interest on this blog. And here's one where I found something so simple it puzzles me if it's not known already.
Consider x2 - Dy2 = F with all integers. Turns out I found there is a very easy way to solve for x and y modularly.
Given x2 - Dy2 = F where all variables are non-zero integers, with a non-zero integer N for which a residue m exists where m2 = D mod N, and with r, any residue modulo N for which Fr-1 mod N exists then:
2x = r + Fr-1 mod N
and
2my = r - Fr-1 mod N
It is EASY to derive so you may see if you can figure it out. Or you can see it derived here.
That result gives solutions to x2 - Dy2 = F mod N.
This thing is so simple I find it hard to believe it's a new discovery. So I'm emphasizing that and also still looking for it elsewhere. I think it's simple and cool though, even if it's just another re-discovery.
I do wonder if you could use it with, say, factoring, but haven't noticed anything about which I'm sure. And I think part of me just kind of just wants it to be important, you know?
But then again, I don't know if you could do much with it either. So it's just this thing I have and wonder about once in a while.
James Harris
Consider x2 - Dy2 = F with all integers. Turns out I found there is a very easy way to solve for x and y modularly.
Given x2 - Dy2 = F where all variables are non-zero integers, with a non-zero integer N for which a residue m exists where m2 = D mod N, and with r, any residue modulo N for which Fr-1 mod N exists then:
2x = r + Fr-1 mod N
and
2my = r - Fr-1 mod N
It is EASY to derive so you may see if you can figure it out. Or you can see it derived here.
That result gives solutions to x2 - Dy2 = F mod N.
This thing is so simple I find it hard to believe it's a new discovery. So I'm emphasizing that and also still looking for it elsewhere. I think it's simple and cool though, even if it's just another re-discovery.
I do wonder if you could use it with, say, factoring, but haven't noticed anything about which I'm sure. And I think part of me just kind of just wants it to be important, you know?
But then again, I don't know if you could do much with it either. So it's just this thing I have and wonder about once in a while.
James Harris
Labels:
number theory
Subscribe to:
Posts (Atom)