Square roots of randomness.

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Square roots of randomness.

Post by piranha »

Whats the Square Root of P?

How do you interpret it? There are different ways, different answers.

I think that it's D. Can you figure out why?

-JL and yes I'm bored.
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Square roots of randomness.

Post by Combuster »

piranha wrote:and yes I'm bored.
I thought you had homework to do (at least you had 10 mins ago) :twisted:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

I thought you had homework to do (at least you had 10 mins ago)
I do. But It's typing stuff up on the computer (like 15 pages :evil: :cry: :shock: ](*,) #-o )

But it's not due for a while so I don't have to do all of it at once.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

D=sqrt(P);
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

P 16th character in alphabet D = 4th.
Could you at least try to make something that takes longer then 10 seconds to find out. :wink:
Author of COBOS
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

I got that as well. Took me 9 seconds. ;)
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

os64dev wrote:P 16th character in alphabet D = 4th.
Could you at least try to make something that takes longer then 10 seconds to find out. :wink:
NEH! OK, smart one, I came up with that at 3:00 AM the night before I posted it. My brain was dying.

And, if your so smart, figure this out:

The Rules: Place any operand you want in the underscores, only +, -, * and / take up a space. Any other operand doesn't.
You must make the 3 numbers equal 6. And you can't modify the six.

1__1__1 = 6

2__2__2 = 6

3__3__3 = 6

4__4__4 = 6

5__5__5 = 6

6__6__6 = 6

7__7__7 = 6

8__8__8 = 6

9__9__9 = 6

It took me 15 min. I got them all except the first (I first did it in 7th grade).

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

1__1__1 = 6

2 + 2 + 2 = 6

3 * 3 - 3 = 6

4 + 4 - sqrt(4) = 6

5 + 5 / 5 = 6

6 + 6 - 6 = 6

7 - 7 / 7 = 6

8__8__8 = 6

sqrt(9) * sqrt(9) - sqrt(9) = 6

Two to go...
Last edited by Candy on Sun Oct 21, 2007 10:03 am, edited 1 time in total.
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

using the following java app:

Code: Select all

public class Main {

	public static int			NUM			= 8;

	public static final int	OP_DIVIDE	= 2;
	public static final int	OP_MINUS		= 3;
	public static final int	OP_PLUS		= 0;
	public static final int	OP_TIMES		= 1;

	public static double doOp(final double d, final int Op) {

		switch (Op) {
			case OP_PLUS:
				return d + NUM;
			case OP_DIVIDE:
				return d / NUM;
			case OP_MINUS:
				return d - NUM;
			case OP_TIMES:
				return d * NUM;
			default:
				return 0;
		}
	}

	public static String getOp(final int Op) {

		switch (Op) {
			case OP_PLUS:
				return "+";
			case OP_DIVIDE:
				return "/";
			case OP_MINUS:
				return "-";
			case OP_TIMES:
				return "*";
			default:
				return " ";
		}
	}

	public static void main(final String[] args) {

		for (int i = 1; i < 10; i++)
			solve(i);
	}

	public static void solve(final int Num) {

		double temp = 0;
		NUM = Num;
		for (int x = 0; x < 4; x++)

			for (int y = 0; y < 4; y++) {
				temp = doOp(0, OP_PLUS);

				temp = doOp(temp, x);
				temp = doOp(temp, y);
				if (temp == 6)
					System.out.println(NUM + getOp(y) + NUM + getOp(x) + NUM + "="
							+ temp);
			}

	}
}

I got :

Code: Select all

2+2+2=6.0
2+2*2=6.0
3-3*3=6.0
5+5/5=6.0
6-6+6=6.0
6/6*6=6.0
6*6/6=6.0
6+6-6=6.0
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

What's wrong with this ((1+1+1)!)


Edit: for people who don't know, the ! operator is the same as 1*2*3*...n
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

Can you assume that log is by default 2log? If so,

(1 + 1 + 1)! = 6 -> as said just before
log(8) * log(8) - log(8) = 6
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

I don't know about logs, but I came up with:

cbrt(8)+cbrt(8)+cbrt(8) = 6

and yes, it's (1+1+1)! = 6.
Well done, B.E.

This was shown to me by my uncle in Germany. And I didn't get the first one without help, because I was in 7th grade at the time and didn't know about the ! operator.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Post Reply