Jump to content
Welcome to the new Forums! And please bear with us... ×
N-Europe

Do my Penguin for me


Atomic Boo

Recommended Posts

  • Replies 862
  • Created
  • Last Reply

Top Posters In This Topic

Guest Stefkov

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest Stefkov
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

1-up Mushroom

Support N-Europe!

Get rid of advertisements and help cover hosting costs on N-Europe

Become a member!


×
×
  • Create New...