Well, everyone of us probably heard in high school (or earlier) that the photon has it’s own momentum.
And I think that more then a half of us kept wondering then about it. Namely, without deep knowledge of Physics, such statements like “light have no rest mass”, or “light is an electromagnetic wave, but it has a momentum” can be confusing, and as Richard Feynman once said - it’s an awful feeling :)

Here I want to explain shortly the mechanism of passing the momentum by a photon through classic physics.

//www.monos.leidenuniv.nl/smo/index.html?basics/light.htm

Firstly, light is an electromagnetic wave which as the names says is composed from magnetic and electric field. Those two fields are perpendicular to each other and to the direction in which the wave propagates. What makes them propagate? Here my answer can be given only by those two equations:

\nabla \times \bf{E} = - \frac{\partial \bf{B}}{ \partial t}

\nabla \times \bf{B} = - \mu_0 \epsilon_0 \frac{\partial \bf{E}}{ \partial t}

Those equations mean that whenever there exists a circulation of electric field there should be created a changeable magnetic field and vice versa.

Using Maxwell equations and some mathematics we can derive the following equation \bf{B} = - \bf{e_{r'}} \times \bf{E} /c wchich gives us the direct relationship between the electric and the magnetic field!

Now lets assume that an electric field is vertically positioned in space and the magnetic field horizontally. What happens when an electromagnetic wave passes an electron? The electric field of the electromagnetic wave makes it swing back and forth in the vertical direction what leads the electron to create a new electromagnetic wave in every perpendicular direction to it’s movement. That’s *exactly how the reflection of the light works!

Hold on, but what does the magnetic field of the electromagnetic wave to the electron? Well, I suppose that everyone remember the famous Lorentz Force \bf{F}= q\bf{v} \times \bf{F} .The Lorentz force keeps affecting the electron only when it’s in movement, and it is when the electric field affects it. Both fields work then together, but in what direction affects the Lorentz force? In the direction of light propagation. Though when light go over an charged object, which starts to move in the reaction of the affecting field, then a pushing force happens in the direction in which light propagates!

That forced is called the pressure of radiation now, we’ll derive the amount of that pressure. The force equals of course F=qvB , but because everything moves, the \overline{F} is an average of force F . Moreover \overline{B}=\overline{E}/c and the speed \overline{v} is also taken an avarage, so we have \overline{F}=q\overline{vE}/c … but wait a minute! \overline{qE} = \overline{F'} and \overline{F'v}= \frac{dW}{dt} and now we can write p=\overline{F}dt= \frac{dW}{c}. What’s more, from school we know that light keeps with itself energy W=hv=\hbar \omega This leads us to the ultimate result p=W/c=\hbar \omega /c = \hbar k where k is known as wave wavenumber.

Even though we finished, there’s a tousend more things to explore, for example we can find out that W=\hbar \omega and \bf{p} = \hbar \bf{k} create a four-vector like the energy and the momentum in special relativity, but it’s a whole new topic… ;)

I hope you enjoied  my article, feel free to ask if anything’s unclear. I will try to help you as much as I can.



It’s really inspiring :)


Here I’m posting the source code written in Python for the Google Code Jam Practice Problems.
The tasks is available after logging at google - in: http://code.google.com/codejam/contest/ in Practice Problems link.

I don’t consider this code to be optimal or the quickest, so I’m open for your suggestions and remarks, what could have been done better


from math import pow
print "enter the filename: "
pliczek = str(raw_input())

pierwsza=1
f=open(pliczek, 'r' )
g=open("result " + pliczek, 'w' )

for data in f:
    if (pierwsza==1):
        pierwsza=0
        ile = 1
    else:
        data = data.split(' ' )
        base0 = len(str(data[1]))
        base1 = len(str(data[2].strip()))
        dlugosc = len(str(data[0]))

        liczba = 0
        for i in str(data[0]):
            liczba += data[1].index(i) * pow(base0,dlugosc - 1)
            dlugosc-=1
        liczba = int(liczba)

        nowaliczba = ""
        while liczba>0:
            nowaliczba = str(data[2].strip())[liczba%base1] + nowaliczba
            liczba = liczba/base1

        g.write('Case #'+str(ile) + ': '+nowaliczba + '\n' )
        ile+=1
f.close()
g.close()

by the way, I noticed some little bug in WordPress - it’s changing “‘)” to a smiley even when it’s written as a source code


The angle which arms contain chords or tangents of a circle is the half of the sum (if the verticle of the angle lies inside the circle or on it) or difference (if the verticle lies outside) of middle angles based on the curves, which set this angle.

The proof can be illustrated by following pictures which consider all the possibilities.


This post is password protected. To view it please enter your password below:



Today I’ve released pyAsk 2 in beta 4 (I’ve quickly found some bugs in previous betas). The software was created with an intention to bring educational software to mobile phones and it was written using only a mobile phone (n95 8gb) with external keyboard (SU-8W) during bus rides to school :).

PyAsk is now an open source app written in Python for s60 which asks you from predefinied words and allows you to create ones and own dicts on the way to school or university.

In the second version I’ve added:

  • sis installer
  • ‘both-side-asking’
  • option to add many synonyms added my commas (like: sysnonym1, synonym2,… synonymN)
  • small improvements as the number of synonyms (x) and the number of current question (#x/y) in the query window

Here the project’s homesite: http://code.google.com/p/pyask/

Here are a few screenshots:

ow, I almost forgot I’d like to thank everybody which helped in pyAsk development or beta testing, and exclusivly there are: Łukasz Jezusek, Ecik & Alfred Niewiem who helped :)


n95 8gb
So you want to code on your phone, huh?
indispensable tools which you’ll need depend on what phone you have.
Here I will show you what do you need to install if you have a s60v3 nokia phone with at least 64mb of RAM, like N95, N95 8GB or E90.  If you don’t know how to code in Python -look here for PHP tutorial - look here

Hardware:

  • s60v3 phone with at least 64mb of RAM (that amount of ram is needed to run PAMP)
  • SU-8W keyboard (without it you’ll run out of thumbs)

Software for developing Python apps:

Software for developing PHP apps:

Known Issues on PAMP:

  • I wasn’t able to connect any mysql database with PAMP, so probably the only thing that’s left is to save all data in normal files.
  • Zend Framework doesn’t seem to work on PAMP.

Some apps written in Python:


offtop:
Sometimes I think to myself that I don’t really need a laptop as long as I don’t do much graphic.
Nokia N95 8GB have enourmous possibilities and I wouldn’t change it for e90, since SU-8W is a lot more comfortable keyboard.


spiral10.png

I’ve found an interesting analogy between going to sleep and developing relationships between man and woman.

  • During the evening hours you feel sleepy.
    When you get mature, you feel a need to find a partner
  • Moreover in case of some circumstances we may want to sleep during the day, but it’s rather rare.
    It’s rare for children to become involved with somebody.
  • On the other hand extremely tired people can sleep during standing
    Lonely people on the end often give up quality choices.
  • Sometimes we eat something or drink that does not let us sleep, for example coffee.
    Sometimes people practice things that temporarily satisfy their needs for relationships, like masturbation or viewing pornography, watching films.
  • While having insomnia people turn around in their beds, searching for a cold place, but whenever their find it, it turns warm and they still can’t sleep
    People dominated by media promoting perfection often find people boring and whenever their find one, they feel disappointed with his flaws and lack of perfection.
  • Very often when when we think to much about how much we want to fall asleep we can’t actually do it.
    When we are trying to hard in seeking for a partner we often encounter failures.
  • If we are wearing on us to much closes it’s rather difficult to fell asleep in opposite of wearing a pyjama or sleeping naked.
    When we are being reserved or withdrawn we encounter problems in finding a partner

As you can see there are many similarities in those two things…
So can I conclude, that human should be polygamous, since he sleeps hundreds of times in his life? Or should they be treated as constant attempts for eternal dream?


Problem: If you’ll eliminate every second person from the circle of n people going clockwise, which one stays alive? (As first the second person dies)

Aswer: if n=2^{n}+l then the person with number 2l +1 stays alive. Equivalently it’s a one-bit-shift-left of number n written binary

I will not write here the whole solution, thus it can be found in a great book “Concrete Mathematics. A foundation for Computer Science”


Here you can find my own simple theme for Google Talk.

Gtalk

Description:

It’s a new theme with working emoticons on Gtalk, just have to remember to do a space before a emoticon.

Instalation:

1. Extract the archieve to your X:\Documents and Settings\user\Local Settings\Application Data\Google\Google Talk\themes\system\chat\ directory, where X is your system drive letter and user is your username

2. Set theme in Gtalk settings: Settings-> Appearance ->ClassicPictureWithEmoticons and hit OK

Download: http://www.speedyshare.com/482785919.html


Prove that for every natural number n \geq there exists n different natural numbers such as sum of any two is divisable by their diffrence.

Proof:
Because number a+b is divisable by a - b , we can write a+b \equiv 0 \mod{a-b} and of course a-b \equiv 0 \mod{a-b}. Adding those two together:
a+b + a - b = 2a \equiv a - b \equiv \ 0 \mod{a-b} \Leftrightarrow 2a \equiv 0 \mod{a-b}

Induction:
1. Sequence 1,2 works
2. Assume that sequence x_{1}, x_{2}, ..., x_{n} works, then the number 2x_{1}x_{2}...x_{n} is divisable by the difference of any two numbers from the sequence
3. Let p=x_{1}x_{2}...x_{n}, then a sequence, including n+1 numbers:
p, p + x_{1}, p + x_{2}, ..., p + x_{n}
‘Works’.


View on Rybnik

13Feb08

Blogged using KABLOG


A few days ago I were stuck with one exercise which I can’t pushed off :] Meanwhile when I forgotten about it, friend of mine, Ecik, did it. It’s below with his solution.

Prove the following:

 x^3 + y^3 + z^3 =3xyz

if x+y+z=0

Solution:

x^3+y^3+z^3=(x+y) \cdot (x^2-xy+y^2)+z^3= \newline =-z \cdot (x^2-xy+y^2) + z^3=xyz-z \cdot (x^2+y^2-z^2) = \newline = xyz - z \cdot (x^2+y^2-(x+y)^2) = xyz - z \cdot (x^2+y^2-x^2-2xy-y^2) \newline = xyz +2xyz=3xyz

I’m open on any suggestions or other solutions of yours.

If you’d like to see Ecik’s blog, here it is http://braindarkside.wordpress.com/


Reading some of the Lev Kourliandtchik books, I’ve found, kindy tricky observation how to write extreamly simple, this giant
\sqrt{2+\sqrt{2 + \ldots + \sqrt{2} }}
with n number of square roots.
It’s easy to dubunk that 2 + 2 \cos{2x} = 4\cos^2{x}
and using that equality we have
\sqrt{2+\sqrt{2 + \ldots + \sqrt{2} }} = \newline = \sqrt{2 + \ldots + \sqrt{2 + 2 \cos{\frac{\pi}{4}} } } = \newline  = \sqrt{2 + \ldots + \sqrt{2 + 2 \cos{\frac{\pi}{8}} } } = \newline \ldots \newline = \sqrt{2+2\cos{\frac{\pi}{2^n} }  } = 2\cos{\frac{\pi}{2^{n+1}}}
cool, huh? :)


For \alpha + \beta + \gamma = \pi , we do have
\tan{\alpha} + \tan{\beta} + \tan{\gamma}= \tan{\alpha} \cdot \tan{\beta} \cdot \tan{\gamma}
\tan{\frac{\alpha}{2}} \cdot \tan{\frac{\beta}{2}} + \tan{\frac{\beta}{2}} \cdot \tan{\frac{\gamma}{2}} + \tan{\frac{\gamma}{2}} \cdot \tan{\frac{\alpha}{2}} = 1


Suppose that we have a grounded sphere made from a conductor and an electron far from the sphere. Let the radius of the sphere be r and the beginning speed of the electron be v orientated on the line in distance of 2r from the center of the sphere. The smallest distance between electron and the center of the sphere is \frac{3}{2}r

Calculate v supposing to have everything else.

Continue reading ‘Image Method in Physics’


Reading R. Resnick - D. Haliday thermodynamics, I’ve found something well known me although it’s making me wonder every single time when I think about it. It’s the derivation of the thermodynamics law p V^{\kappa} = const that goes like this:
From first law of thermodynamics \Delta Q = \Delta U + \Delta W , but in the adiabatic process we have \Delta Q = 0 and instead of \Delta W we put p\Delta V

And this is the moment that I do not understand! Why, to hell do we put p\Delta V instead of p\Delta V + \Delta pV if both of the variables DO CHANGE in time?! Even if it’s in diffrential, it should be that second one.

If someone knows the reasons why it goes like that, please comment this post and explain it to me.

Futher we get 0 = c_v n \Delta T + p \Delta V because \Delta U = c_v n \Delta T , and from it \Delta T = - \frac{p \Delta V}{n c_v}
On the other hand from the perfect gas equatation pV = nRT brought to the diffrental form we get \Delta T = \frac{p \Delta V + V \delta p}{nR} After comparing those two expressions for \Delta T , remembering that C_p - C_v = R and \kappa = \frac{c_p}{c_v} and some simple algebraic transformation, we recieve \frac{dp}{p} + \kappa \cdot \frac{dV}{V} = 0
Integrating gives us finnaly \ln{p} + \kappa \cdot \ln{V} = const , hence pV^{\kappa} = const

Continue reading ‘Law of the adiabatic process and more…’


The solutions can be found here http://www.om.edu.pl/zadania/om/om59_1r.pdf

My solution for task number 9 is here: Solution for number 9


Lets calculate more compilated sum
S_n = \sum_{\substack{0 \leq k \leq n}}k2^k
further, S_n + (n+1)2^{n+1} = \sum_{\substack{0 \leq k \leq n}}(k+1)2^{k+1} the last one equals to \sum_{\substack{0 \leq k \leq n}}k2^{k+1} +\sum_{\substack{0 \leq k  \leq n}}2^{k+1} and now the first of the sums is equal to 2S_n however the second one is easy, cause its a geometric sequence equal to \frac{2-2^{n+2}}{1-2} = 2^{n+2} - 2 under the law from previous post. Now we have S_n + (n+1)2^{n+1} = 2S_n + 2^{n+2}-2 , in the result of elementary algebraic transformation we recieve S_n = (n-1)2^{n+1} + 2

It’s easy to notice that we could put everything in the place of 2, so let there be x. Then \sum_{k=0}^{n}kx^k = \frac{x-(n+1)x^{n+1}+nx^{n+2} }{(1-x)^2}

And now we have quite general law :)


Asume that we want to calculate
S_n = \sum_{\substack{0 \leq k \leq n}}ax^k
Of course, S_n +ax^{n+1} = ax^0 + \sum_{\substack{0 \leq k \leq n}}ax^{k+1}
But the sum on the right side is equal to x \sum_{\substack{0 \leq k \leq n}}ax^k = xS_n Therefore S_n + ax^{n+1} = a + xS_n and so, S_n = \sum_{\substack{0 \leq k \leq n}}ax^k = \frac{a-ax^{n+1}}{1-x}