# ReubenESTD

Members

41

96 Neutral

• Rank
Member
1. ## Functions and Variables (C++)

[quote name='ArthY303' timestamp='1311253197' post='4838421'] Hello, [code] void timestepfoward(){ otherfactors(); cout << "\n\nIt is currently year " << currentyear << " and the population is " << initpop << ".\n"; cout << "How many years would you like to skip? "; cin >> t; population(); currentyear = t+currentyear; cout << "\nIt is now year " << currentyear << " and the population is now " << newpopulation << ".\n"; newpopulation=initpop; // shouldn't this line be: initpop = newpopulation; ? mysociety(); } [/code] [/quote] Actually that did fix it xD

3. ## Functions and Variables (C++)

Ok so first of all I assign initpop to 1000 (otherwise the formula wouldn't work (if it were 0)) then after population() has run the newpopulation should be assigned to the initpop (initial population) so that the formula will work every time it is called. [code]unsigned int initpop=1000; //holds the population at the start of each period. unsigned int newpopulation;[/code]
4. ## Functions and Variables (C++)

[code]void mysociety(){ cout << "Here is the current state of your society: \n\n"; //display current statistics cout << "The current population of your society is " << initpop << " humanoids." << endl; //user action cout << "\nEnter '1' if you would like to skip a number of years, '2' if you would like \nfurther information about your society or any other number if you would like to make changes to your society: "; int skiporchange; cin >> skiporchange; if(skiporchange == 1)timestepforward(); else if(skiporchange == 2)aboutyoursociety(); else changes();}[/code] When I press '1' the timestepforward function is called. Its code is as follows: [code]void timestepfoward(){ otherfactors(); cout << "\n\nIt is currently year " << currentyear << " and the population is " << initpop << ".\n"; cout << "How many years would you like to skip? "; cin >> t; population(); currentyear = t+currentyear; cout << "\nIt is now year " << currentyear << " and the population is now " << newpopulation << ".\n"; newpopulation=initpop; mysociety(); } void population(){ popgrowth=(births-deaths)/initpop+1; newpopulation = initpop*exp( (births-deaths)/initpop * t ); }[/code] My problem is that when I call the first function after doing a time step forward, (mysociety()), the global variable for initpop has not updated! Why is this?
5. ## Gödelization - help needed.

[quote name='luca-deltodesco' timestamp='1306759889' post='4817483'] I've not heard of [color="#1C2837"][size="2"]G[font="arial, sans-serif"][size="2"][i]ö[/i][/size][/font]delization, but that just looks to be the prime factorisation of an integer for which it is quite easy to prove that a) it exists, and b) that it is unique.[/size][/color] [color="#1C2837"] [/color] [color="#1C2837"][size="2"]An intuitive proof for existance would be: let N be a number, either N is prime or it is not prime. If it is not prime then there must exist a prime P and a possibly non-prime M (otherwise N would be prime).[/size][/color] [color="#1C2837"][size="2"]In the same way, repeat with M instead, and eventually you either get a prime number, or 1. from which it is easy to construct a formal inductive proof.[/size][/color] [color="#1C2837"] [/color] [color="#1C2837"][size="2"]Proof of uniqueness is a little bit harder, a sketch proof would be: Let N be the smallest integer expressible as the product of two minimal; non-identical sets of primes s1,s2..sn q1,q1...qm[/size][/color] [color="#1C2837"][size="2"]as N is the smallest such number, then s1, and s2...sn, must have unique factorisations as they are smaller than N.[/size][/color] [color="#1C2837"][size="2"]p1 then, must either divide s1, or s2...sn (or both, not important) and as all are prime, si = qj for some i,j. By removing si,qj from the two non-equal factorisations we get two smaller, equal numbers. as they are smaller than N, by assumption they have unique factorisations and so the two factorisations cannot be different.[/size][/color] [/quote] [quote name='quasar3d' timestamp='1306787930' post='4817652'] You probably know (and as luca-deltadesco explained) that any integer can be factored into a unique prime factorization, and G[font="sans-serif"][size="2"]ö[/size][/font]delization is a trick that uses this fact to encode a whole sequence of numbers into a single integer by taking the product of the first prime raised to the power of the first element of your sequence, the second prime raised to the power of the second element, and so on. This gives you a single integer that encodes your whole sequence. for example, the sequence of the first 4 squares (1,4,9,16) can be encoded as 2^1 * 3^4 * 5^9 * 7^16 = 10515106938037816406250 [/quote] Thanks both of you I understand perfectly now, big numbers though! I think I was just a little put off by all that complex-looking formula.
6. ## Gödelization - help needed.

Formula: [code] n x?i x?1 x?2 x?n ? p = p p ... p i=1 i 1 2 n[/code] [size="2"][i]Where: n = the nth number in a sequence x = a number in the sequence p = a prime number[/i][/size] G[font="arial, sans-serif"][size="2"][i]ö[/i][/size][/font]delization (as far as I understand) states that if you pick any natural number (x) then there is exactly one sequence of prime numbers (p) whose product (of (n) prime numbers) = x. If there are (n) numbers in the sequence, let every number be denoted by (x?1 x?2 ... x?n). [b]I am having trouble fully grasping this and I think it would help if someone could give me an example calculation using this formula. [/b][b] [/b]
7. ## Can anyone explain to me the theory behind this Isometric calculation?

[url="http://lmgtfy.com/?q=math+formula+and+its+theory+behind+it"]Try this?[/url]
8. ## Tiny maths question.

Okay so user has 10 points that he / she is allowed to distribute between three factors: a, b and c. As such, the user may choose to put 10 in a but none in b or c (or any other combination). I need an efficient sum of some sort, that will differentiate all possible combinations, due to the sum resulting in different values. Thanks in advance
9. ## Thesis In Physics

I am currently researching chaos and evolutionary computation, which i find very interesting. If you do too check out [url="http://www.amazon.co.uk/Computational-Beauty-Nature-Explorations-Adaptation/dp/0262561271/ref=sr_1_13?s=books&ie=UTF8&qid=1305133925&sr=1-13"]this book[/url].
10. ## Travel at a fraction of light speed. Subjective time question.

[quote name='owl' timestamp='1304985682' post='4808774'] To keep the calculations simple, say that a traveler had a spaceship that could instantly accelerate to 1/2 of light speed (without killing him) and he started a journey to a point in space 10 light years away to finally instantly decelerate at the moment of arrival. How many time would it pass from the point point of view of the traveler inside the spaceship? Intuitive thinking may make one think it'd be 20 years but I know relativistic speeds don't work that way. What would be the equations to calculate that "t"? [/quote] Correct me if I'm wrong, but I'm pretty sure that for the the guy in the spaceship it would be twenty years. However, see [url="http://www.youtube.com/watch?v=HHRK6ojWdtU&feature=related"]this[/url] video for a simple explanation of time dilation. Skip to about 6:40 to avoid the junk. Hope this helps! Also a book called 'The Elegant Universe' explains this and many other related issues very well.
11. ## Need SFML 2 binaries (xxx.a and xxx.dll's)

[quote name='monchito' timestamp='1304939336' post='4808480'] Hi I'm using Code::Blocks 10.05 & MinGW I need the compiled SMFL 2 library. Can anyone post it somewhere to get it? Really, I tried to Cmake it without success. Followed some tutorials from internet and get a group of folders 'CMakeFiles', an empty 'lib' folder , a 'src" and subfolders 'SFML'( Audio, Graphics,Main,Network,System,Window,CMakeFiles) each with more subfolders and cmake files. How can I get the libxxxxx.a and the XXXXX.dll's Thanks in advance [/quote] Just type it into youtube with the word 'tutorial' thrown in. Or you could try interpreting the steps for SDL stated on [url="http://lazyfoo.net/SDL_tutorials/lesson01/index.php"]this[/url] website.
12. ## Idea for game

The best option for you is to take a course at uni in English literature or business ( depending on which you prefer) and work as a designer/marketeer at a game development company, then work your way into a design position at a company.