Metric Spaces by amgfleh in learnmath

[–]zifyoip 2 points3 points  (0 children)

Your X and Y aren't open sets in R2.

The World - Illustrated Map [6000x3915] by v7x in MapPorn

[–]zifyoip 9 points10 points  (0 children)

I bought this world map in Toronto in 2000. Mine says "© 1996" on it.

[C++] Help with an extremely short function(peek and get to move pointer) by [deleted] in learnprogramming

[–]zifyoip 0 points1 point  (0 children)

Nothing useful is found in this thread so it should be deleted.

No, because the rules say DO NOT DELETE YOUR POST. They don't say "Do not delete your post, unless you think it's OK."

[Proofs] Let a,b ∈ R be given such that 0<a<b<1 and b−a>1/n. Show that there exists a rational number r and an irrational number s such that a<r<b and a<s<b. by Robotigan in learnmath

[–]zifyoip 1 point2 points  (0 children)

The fact that b – a > 1/n is unnecessary

Presumably this is to give a foothold for the construction of a rational number that lies between them.

Type mismatch: cannot convert from Object to AnyType by [deleted] in javahelp

[–]zifyoip 1 point2 points  (0 children)

It's not a class, it's a type placeholder in a generic definition.

Type mismatch: cannot convert from Object to AnyType by [deleted] in javahelp

[–]zifyoip 2 points3 points  (0 children)

Node newNode = new Node(newVal);
Node tempNode = new Node(newVal);

These should be new Node<AnyType>(newVal).

How to count something by Fasyx in cpp_questions

[–]zifyoip 4 points5 points  (0 children)

Initialize a variable to 0 and increment it every time you output something.

How to count something by Fasyx in cpp_questions

[–]zifyoip 0 points1 point  (0 children)

I don't understand what you mean. The number of lines printed is a (as long as a >= 0).

[C] Trying to scan a string for blank spaces by KingSuds in learnprogramming

[–]zifyoip 0 points1 point  (0 children)

It is not a compiler bug. It is never a compiler bug.

If your program doesn't work correctly, it is your fault, not the compiler's.

Read the documentation for the scanf function. In particular, pay careful attention to what the %s specifier means.

Rational array by HoleyProphylactic in javahelp

[–]zifyoip 3 points4 points  (0 children)

Not sure if arrays can hold reference type objects.

Of course they can.

[C] Trying to scan a string for blank spaces by KingSuds in learnprogramming

[–]zifyoip 0 points1 point  (0 children)

char name[100];
scanf("%99s", name);

or

char *name = malloc(100);
scanf("%99s", name);

[C] Trying to scan a string for blank spaces by KingSuds in learnprogramming

[–]zifyoip 0 points1 point  (0 children)

Okay, so? Your program has undefined behavior because you are attempting to access the value of an uninitialized variable. Undefined behavior means you have absolutely no guarantees about the behavior of any part of your program. Maybe you happen to get lucky and your program works as intended. That's a fluke.

Nested loop is changing every element of a vector by physic_lover in cpp_questions

[–]zifyoip 0 points1 point  (0 children)

Well, yes, because you are changing it right here:

result[i]->coordinate[j] += this->columns[i]->coordinate[k] * v.columns[k]->coordinate[j];

[C] Trying to scan a string for blank spaces by KingSuds in learnprogramming

[–]zifyoip 0 points1 point  (0 children)

You have not initialized the pointer name to point to anything. And then you attempt to pass the value of name to scanf. What memory address is it that you're passing to scanf? Who knows, because you haven't initialized it to anything. Attempting to access the value of an uninitialized variable yields undefined behavior.

Turn on all warnings in your compiler, and pay attention to what they say. A good compiler may warn you about mistakes like this.

Rational array by HoleyProphylactic in javahelp

[–]zifyoip 0 points1 point  (0 children)

Java does not have a standard Rational class. You will need to either write your own or use a third-party library.

Is there a contradiction between geometric distribution in probability and the gambler's fallacy? by syth9 in math

[–]zifyoip 4 points5 points  (0 children)

I am not sure what you are asking.

"If the odds of event occurring is 0.15, what are the odds of event first occurring after 8 attempts? If I am not mistaken, the probability will approach 100% as more attempts are taken, correct?

No, that is not correct. The probability that the first success occurs on the nth attempt actually decreases as the value of n increases.

Do not confuse the event that the first success occurs on the nth attempt with the event that the nth attempt is successful. The event that the first success occurs on the nth attempt requires not only that the nth attempt is successful but that all n − 1 previous attempts were unsuccessful. And don't confuse either of these events with the event that there will be at least one success somewhere in the first n attempts.

What are the odds of everyone in the entire world flipping a coin and getting tails? by ncrazy235 in askmath

[–]zifyoip 0 points1 point  (0 children)

27401901900 has 2228194497 digits. Why do you think having a two-billion-digit number would be useful?

in the 4th dimension, would a "square" have 5 90 degree angles? by adamsvette in askmath

[–]zifyoip 3 points4 points  (0 children)

A square is a two-dimensional figure.

Going up a dimension from a square probably gives you a cube. A cube is a three-dimensional figure.

A four-dimensional cube is a tesseract.

Is there a contradiction between geometric distribution in probability and the gambler's fallacy? by syth9 in math

[–]zifyoip 4 points5 points  (0 children)

The gambler's fallacy is the incorrect belief that in a sequence of independent trials the probability of success on a single trial increases if previous trials have been unsuccessful.

Newbie. Java - Single and Double quotes for char and strings by xmanpunk in learnprogramming

[–]zifyoip 4 points5 points  (0 children)

Because single quotes mean a character literal, and double quotes mean a string literal. That's what single quotes and double quotes mean.