Jump to content
N-Europe

Recommended Posts

Posted

Chips, cheese and chicken meat for me with ketchup and self added worcester sauce :p although the cheese is sliiightly dodgy. Oh well. I'm currently doing first order linear diffeqs. Not too hard. I have quantum theory coming up though which will be a bitch (I didn't do A Level physics...)

  • Replies 862
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Is anyone any good with atmel avr?? Preferably the Atmega16 Microprocessor........ (I'm most likely spitting in the wind with this one.)

Guest Stefkov
Posted

ugh...Pascal's Triangle. I hope I dont have to learn each of the numbers. Or even the formula we're gonna learn tommorow to work out the patterns.

Posted
ugh...Pascal's Triangle. I hope I dont have to learn each of the numbers. Or even the formula we're gonna learn tommorow to work out the patterns.

You can work it out easily.

 

Just imagine the number one. Then you work out the two numbers beneath it by adding the two numbers directly above each number, using zero for when there is no number. Then you just do that all the way down the triangle, getting:

 

_______1

______1 1

_____1 2 1

____1 3 3 1

___1 4 6 4 1

_1 5 10 10 5 1

1 6 15 20 15 6 1

 

etc.

 

Alternatively, just use the nCr button on your calculator, which uses the formula for you.

Guest Stefkov
Posted
You can work it out easily.

 

Just imagine the number one. Then you work out the two numbers beneath it by adding the two numbers directly above each number, using zero for when there is no number. Then you just do that all the way down the triangle, getting:

 

_______1

______1 1

_____1 2 1

____1 3 3 1

___1 4 6 4 1

_1 5 10 10 5 1

1 6 15 20 15 6 1

 

etc.

 

Alternatively, just use the nCr button on your calculator, which uses the formula for you.

I had noticed that when we went through it. The website I had checked some stuff on had an equation with an !. I actually cant wait to find out what that means.

Posted
I had noticed that when we went through it. The website I had checked some stuff on had an equation with an !. I actually cant wait to find out what that means.

 

Factorial, 3! = 3x2x1 = 6.

Posted
I had noticed that when we went through it. The website I had checked some stuff on had an equation with an !. I actually cant wait to find out what that means.

Factorial, which is all the numbers up to that number inclusive multiplied together.

 

eg. 5! = 5 x 4 x 3 x 2 x 1

Posted

Does anybody have a clue how a computer figures out how to guess a Mastermind code? I'm stuck on designing an algorithm...

Posted
Does anybody have a clue how a computer figures out how to guess a Mastermind code? I'm stuck on designing an algorithm...

Surely it makes random guesses, then stores away what is right and wrong. I suppose it could also make a systematic series of guesses.

Posted
Surely it makes random guesses, then stores away what is right and wrong. I suppose it could also make a systematic series of guesses.

True, I've figured it out halfway, but I'm stuck on the part where it calculates what is right and wrong from the result it gets. I also have to be easy on memory as the algorithm serves as a design for a machine that can guess Mastermind codes, so I can't just save all 1296 possible codes and check them off.

Posted
True, I've figured it out halfway, but I'm stuck on the part where it calculates what is right and wrong from the result it gets. I also have to be easy on memory as the algorithm serves as a design for a machine that can guess Mastermind codes, so I can't just save all 1296 possible codes and check them off.

No, you shouldn't make it do that. It should guess all red, then all blue etc. until it knows how many of each colour there are, until it knows all five. Additionally, it should remember when it gets things in the right place.

Posted
It should guess all red, then all blue etc. until it knows how many of each colour there are, until it knows all five.
That makes it a tad slow. It should be able to solve all codes in nine turns (less is better though), and there are six colours, so you waste a lot of turns guessing colours.

 

Additionally, it should remember when it gets things in the right place.
That's one of the major problems. When a colour is placed correctly, it doesn't know where that colour is, it just knows one of the four was correct in the last code.
Posted
How would you show how the ASCII code for b ($62) can be converted to that for B ($42) using a bit mask?

I don't study computer science (yet) so don't shoot me on this one. If you OR them with each other, don't you get the mask you need to AND b or B to get the other?

Posted

hmm, the mastermind one is tricky:

start off my getting it to ask (where number = colour):

1, 2, 3, 4

6, 1, 2, 3

5, 6, 1, 2

4, 5, 6, 1

3, 4, 5, 6

2, 3, 4, 5

 

from that i can usually (apling a bit of logical thinking), reduce the number massively. (hit = red or white)

(16 total hits, and it tells you it uses 4 different numbers)

(12 hits and it tell you it uses 3 numbers)

(8 hits and it uses only 2 numbers)

(4 and it only uses one number)

using whether the hits per line goes up or down shows which numbers are being used.

position of the reds shows possible values, position of whites shows which aren't possible.

Should be able to eliminate the combination from this i think. basically you get it down to very few possible ones left. using a couple of logical thinking steps. if you run these though, to make sure they all give the same hit as whats given (might be able to knock a few more here).

normally im only left with two. these are easy to elimintate with on more.

using this method you should be able to solve it in7 or less. (its how i'd do it anyway)

 

EDIT, i just made this up right now, tested it 5 or 6 numbers. seems a decentish method theres prolly better. solved it in 7 goes every time, and can do it fairly quickly using a pen and paper.

Posted
hmm, the mastermind one is tricky:

start off my getting it to ask (where number = colour):

1, 2, 3, 4

6, 1, 2, 3

5, 6, 1, 2

4, 5, 6, 1

3, 4, 5, 6

2, 3, 4, 5

 

from that i can usually (apling a bit of logical thinking), reduce the number massively. (hit = red or white)

(16 total hits, and it tells you it uses 4 different numbers)

(12 hits and it tell you it uses 3 numbers)

(8 hits and it uses only 2 numbers)

(4 and it only uses one number)

using whether the hits per line goes up or down shows which numbers are being used.

position of the reds shows possible values, position of whites shows which aren't possible.

Should be able to eliminate the combination from this i think. basically you get it down to very few possible ones left. using a couple of logical thinking steps. if you run these though, to make sure they all give the same hit as whats given (might be able to knock a few more here).

normally im only left with two, or 4. these are easy to elimintate with on more.

using this method you should be able to solve it in7 or less. (its how i'd do it anyway)

 

EDIT, i just made this up right now, tested it 5 or 6 numbers. seems a decentish method theres prolly better

Thanks for the trouble Ginger_Chris, but it's hard to put that human logic into computer code. I'll try my best though :smile:

Posted
I don't study computer science (yet) so don't shoot me on this one. If you OR them with each other, don't you get the mask you need to AND b or B to get the other?

 

That sounds right so you are going to get some major loving if you post in the forum love thread.

Posted

Hey all. Little algebra problem :angry:

 

I'm doing simultaneous equations and have these two questions remaining:

 

x+y= 3

xy = 2

 

and

 

x-y = 3

xy+10x+y= 150

 

Any idea on how I actually work these out? Thanks :smile:

Posted
Hey all. Little algebra problem :angry:

 

I'm doing simultaneous equations and have these two questions remaining:

 

x+y= 3

xy = 2

 

and

 

x-y = 3

xy+10x+y= 150

 

Any idea on how I actually work these out? Thanks :smile:

First one:

 

x + y = 3

xy = 2

 

y = 2/x (rearrange second equation)

 

x + (2/x) = 3 (substitute into first)

 

((x^2)/x) + (2/x) = 3 (multiply top and bottom of first fraction by x)

 

(x^2) + 2 = 3x (multiply through by x)

 

Solve this quadratic for x, substitute the value you get back into one of the original equations for y.

 

Second one:

 

x - y = 3

xy + 10x + y = 150

 

y = x - 3 (rearrange first equation)

 

x(x - 3) + 10x + (x - 3) = 150 (substitute into second equation)

 

Solve this quadratic for x, substitute the value you get back into one of the original equations for y.

Posted

Right does anyone know where I can find the "electronic specific heat parameter" of tin?

 

Its a really random parameter to do the transition to superconductivity. Google, yahoo, msn, and ask have all failed me. I don't necessarily need a value, a place to find it l do. I have access to every book ever printed, so it should be in one of them somewhere. I just need to know which one.

 

Oh and a decent approximation of the persistent currents (current density) in superconducting lead would also be useful. Just so I can compare it to my measured value.

 

Cheers


×
×
  • Create New...