• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:27
CEST 15:27
KST 22:27
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL21] Ro16 Preview Pt1: Fresh Flow5[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy21ByuL: The Forgotten Master of ZvT30
Community News
MaNa leaves Team Liquid13$5,000 WardiTV TLMC tournament - Presented by Monster Energy5GSL CK: More events planned pending crowdfunding7Weekly Cups (May 30-Apr 5): herO, Clem, SHIN win0[BSL22] RO32 Group Stage5
StarCraft 2
General
MaNa leaves Team Liquid Team Liquid Map Contest #22 - Presented by Monster Energy Quebec Clan still alive ? BGE Stara Zagora 2026 cancelled Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament $5,000 WardiTV TLMC tournament - Presented by Monster Energy RSL Revival: Season 5 - Qualifiers and Main Event GSL CK: More events planned pending crowdfunding Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 521 Memorable Boss The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power
Brood War
General
ASL21 General Discussion [ASL21] Ro16 Preview Pt1: Fresh Flow BGH Auto Balance -> http://bghmmr.eu/ JD's Ro24 review The Korean Terminology Thread
Tourneys
[ASL21] Ro16 Group A Escore Tournament StarCraft Season 2 [Megathread] Daily Proleagues [ASL21] Ro24 Group F
Strategy
Any training maps people recommend? Fighting Spirit mining rates Muta micro map competition What's the deal with APM & what's its true value
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Battle Aces/David Kim RTS Megathread General RTS Discussion Thread Starcraft Tabletop Miniature Game
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
Canadian Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread US Politics Mega-thread The China Politics Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
lurker extra damage testi…
StaticNine
How Streamers Inspire Gamers…
TrAiDoS
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2168 users

The Big Programming Thread - Page 848

Forum Index > General Forum
Post a Reply
Prev 1 846 847 848 849 850 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
February 18 2017 22:22 GMT
#16941
On February 19 2017 06:52 tofucake wrote:
Show nested quote +
On February 19 2017 05:30 spinesheath wrote:
Gee why do I keep using quote instead of edit...

It gets even more annoying when you can edit any post...

Trying to excuse future mod abuse eh? :p
TRUEESPORTS || your days as a respected member of team liquid are over
Hanh
Profile Joined June 2016
146 Posts
February 19 2017 00:23 GMT
#16942
On February 19 2017 04:56 Acrofales wrote:
Show nested quote +
On February 18 2017 18:11 Hanh wrote:
Look at the variables.


there exists x, such that for all y

and

for all y, there exists x


They are flipped in the second statement.

For any predicate P(x, y) for which,

If [there is a x for which for all y, P(x, y) is true] then [for all y, there is a x for which P(x, y) is true].

In the first case x cannot depend on y. In the second case it can.






Okay, I see it now. So for starters, and this is more at travis than at you: quantified variables are quantified variables. For all I cared, you could use "cupcake" as your variable name. If the order of your variables are important, make it explicit.

But either way, the claim is still wrong. For the sake of simplicity, I have written it out here:

(1) \exists x \forall y P(x, y)
is stronger than
(2) \forall x \exists y P(y, x)

This is also not true. All we need to do is find a P and a model m such that m \models (1), but m \not\models (2). Right.

Or if you prefer it in your form of implication (2) \rightarrow (1) is false if (1) is false while (2) ist true (which boils down to essentially the same thing, but is less formal.

Here's a simple counter example:

Let X = {a, b} and Y = {a}
R = {(a, a)}

Now:
\forall x \in X \exists y \in Y such that (y, x) \in R

This is false. Counter example: x=b

However:
\exists x \in X \forall y \in Y such that (x, y) \in R
This is true, because it is true for x=a.

Therefore, unless you also make some requirements of the domains of your variables and probably some properties of P, this is definitely not true.

There is an interesting relationship between the two statements. I'm not sure whether your lemma might be true if we restrict x and y to be from the same set. I didn't immediately see a counterexample (but also haven't looked very hard, or tried to construct a proof).

But the sweeping statement you made is still false even when you clarify the switched variables.

+ Show Spoiler +
Thankfully. Would be rather embarrassing for me to be wrong on something like this


It seems to me that you are grasping at straws in order to be right. So, ok - fine you are right.

For the record, the discussion thread that you seemed to have missed was about the order of the quantifiers. Travis didn't see why they matter. In context, the domains of x and y are set, so your counter example doesn't apply. Why can't you admit that you didn't notice that and just move on.

Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
February 19 2017 07:24 GMT
#16943
--- Nuked ---
meatpudding
Profile Joined March 2011
Australia520 Posts
February 19 2017 07:51 GMT
#16944
On February 19 2017 03:50 travis wrote:
Anyone want to tell me what they think of this C code? I feel like it's pretty well written. To the point. Normally I end up making these small exercises way more convoluted than they need to be. (inb4 i find out it's shit)

the specifications are to take the prototype and implement the function. the function takes the source string and copies it to the results string with leading and trailing whitespace removed. it then records how many spaces were removed into number_of_spaces. You return -1 if there was nothing to copy over.

code:

+ Show Spoiler +


int remove_spaces(const char *source, char *result, int *num_spaces_removed) {
int i = 0;
int j = strlen(source) - 1;
int k = 0;
int z = 0;

if(source == NULL || j == -1) {
return -1;
}


while(source[i] {
if(source[i] == ' ') {
i++;
continue;
}
break;
}


while(1) {
if(source[j] == ' ') {
j--;
continue;
}
break;
}

for(k=i; k < (j+1); k++) {
printf("%d %d\n", k, j);
result[z] = source[k];
z++;
}

result[z] = '\0';

*num_spaces_removed = (strlen(source) - strlen(result));


return 0;
}




In the j-- loop there is no checks for j < 0. You could use a for loop like
for (j; j > 0; j--)
just in case the string is all whitespace.

Instead of the k loop, I would look into using memcpy. It's cleaner than having to loop every char, and it's a good exercise for understanding pointers.

Be excellent to each other.
Acrofales
Profile Joined August 2010
Spain18259 Posts
February 19 2017 08:48 GMT
#16945
On February 19 2017 09:23 Hanh wrote:
Show nested quote +
On February 19 2017 04:56 Acrofales wrote:
On February 18 2017 18:11 Hanh wrote:
Look at the variables.


there exists x, such that for all y

and

for all y, there exists x


They are flipped in the second statement.

For any predicate P(x, y) for which,

If [there is a x for which for all y, P(x, y) is true] then [for all y, there is a x for which P(x, y) is true].

In the first case x cannot depend on y. In the second case it can.






Okay, I see it now. So for starters, and this is more at travis than at you: quantified variables are quantified variables. For all I cared, you could use "cupcake" as your variable name. If the order of your variables are important, make it explicit.

But either way, the claim is still wrong. For the sake of simplicity, I have written it out here:

(1) \exists x \forall y P(x, y)
is stronger than
(2) \forall x \exists y P(y, x)

This is also not true. All we need to do is find a P and a model m such that m \models (1), but m \not\models (2). Right.

Or if you prefer it in your form of implication (2) \rightarrow (1) is false if (1) is false while (2) ist true (which boils down to essentially the same thing, but is less formal.

Here's a simple counter example:

Let X = {a, b} and Y = {a}
R = {(a, a)}

Now:
\forall x \in X \exists y \in Y such that (y, x) \in R

This is false. Counter example: x=b

However:
\exists x \in X \forall y \in Y such that (x, y) \in R
This is true, because it is true for x=a.

Therefore, unless you also make some requirements of the domains of your variables and probably some properties of P, this is definitely not true.

There is an interesting relationship between the two statements. I'm not sure whether your lemma might be true if we restrict x and y to be from the same set. I didn't immediately see a counterexample (but also haven't looked very hard, or tried to construct a proof).

But the sweeping statement you made is still false even when you clarify the switched variables.

+ Show Spoiler +
Thankfully. Would be rather embarrassing for me to be wrong on something like this


It seems to me that you are grasping at straws in order to be right. So, ok - fine you are right.

For the record, the discussion thread that you seemed to have missed was about the order of the quantifiers. Travis didn't see why they matter. In context, the domains of x and y are set, so your counter example doesn't apply. Why can't you admit that you didn't notice that and just move on.


Not really, because the context changed when he said "for a predicate P". But even if we look at asymmetric order, they are simply not comparable. I don't know how many different ways I have to say it: flipping the quantifiers is simply saying something different about your world, and unless you impose some very narrow conditions on your world, you cannot ever say that one is stronger than the other.

And even if we go with the original statement, there simply is no stronger relationship between the two predicates (although it took me a while to realize where the error in thought was).

For all x exists y x < y
Exists x for all y y < x

The latter says something about a global maximum, but we have to finagle with the definition of our domain. Either x\in D and y \in D - {x}, or you have a problem: let y=x, and the second predicate is false even if the set has a global maximum.

However, the former says nothing about maxima, it simply says something about seriality (in fact, that is the very definition of seriality). However, seriality of < is particularly not true if there is a maximum in your set. And there isn't much you can do about it, because the same trick we just applied doesn't work:

For all x in D there is a y in D - {x} such that x < y

Counter example let x be the maximum of the set.

So no. Even then, you are simply making two different statements about your sets and your relation. Now if you say that he really meant that the domains are numeric and equal, then the latter statement is always trivially false: if there is a global maximum, pick it as y for your counter example. If there is no global maximum then there simply is no x for which it might ever hold. So it is trivially false. Given that under these strict conditions, the former statement is sometimes true, your latter statement is indeed stronger, but it's trivial, because False is always the strongest statement, but I assumed we weren't talking about trivial cases...

Hanh
Profile Joined June 2016
146 Posts
Last Edited: 2017-02-19 11:15:17
February 19 2017 10:34 GMT
#16946
Once again, there is a context.


the order matters?

I thought I remembered the professor saying the order matters for this, but when I conceptualized it I couldn't see the difference between

there exists x, such that for all y

and

for all y, there exists x


travis didn't put the complete statement, but I'm sure he meant this:

(1) exists x in X, for all y in Y, P(x, y)
(2) for all y in Y, exists x in X, P(x, y)

because he said: "the order matters?"

And I said: (1) => (2)

If you don't agree with that and you think that x and y are unbound then the discussion is moot.
By changing the domain, statements change meaning. It's true for any logical statement with quantifiers. You don't have to go very far to see that.

P: for all x in X, x = 0.
False if X = {0, 1}, True if X = {0}.

Essentially, statements without a domain are meaningless.

Btw, it's a classic question. I could google an answer here:

http://math.stackexchange.com/questions/1064889/the-order-of-mixed-quantifiers


For all x exists y x < y
Exists x for all y y < x

The latter says something about a global maximum, but we have to finagle with the definition of our domain. Either x\in D and y \in D - {x}, or you have a problem: let y=x, and the second predicate is false even if the set has a global maximum.

Well, as you said, you have to change the domain.

IMO, the context made clear that x was bound to X, and y to Y.

then
exists x in R, for all y in R, x < y: means there is a real number lower than every other real number. Which is false.

for all y in R, exists x in R, x < y: every real number has a number lower than it.
which is true.
Hanh
Profile Joined June 2016
146 Posts
Last Edited: 2017-02-19 12:52:04
February 19 2017 11:58 GMT
#16947
On February 19 2017 03:50 travis wrote:
Anyone want to tell me what they think of this C code? I feel like it's pretty well written. To the point. Normally I end up making these small exercises way more convoluted than they need to be. (inb4 i find out it's shit)

the specifications are to take the prototype and implement the function. the function takes the source string and copies it to the results string with leading and trailing whitespace removed. it then records how many spaces were removed into number_of_spaces. You return -1 if there was nothing to copy over.


In addition to what other people have commented before, I think that the prototype of the function isn't a good one. It's not something that you can always control but in case it is your choice, there are a few abnomalities


int remove_spaces(const char *source, char *result, int *num_spaces_removed)


1. What size was result allocated with? Am I going to do a buffer overrun by copying from source? I don't know.
2. Why isn't the length of source passed in? If the caller has it already, this would save a strlen.
3. Why optimize for the empty string case? Is it really important for remove_spaces to handle that?
4. Returning -1 could be unexpected by the caller and result in a bug because the semantics of remove_spaces were overly complex. If the caller wants to check, it could just look at *result == 0

If instead we had,

size_t remove_spaces(const char *source, size_t n, char *result)


Or even better if you allow for SAL annotations (or something similar)


size_t remove_spaces(_In_reads_bytes_(n+1) const char *source, size_t n, _Out_writes_bytes_(n+1) char *result)

Your compiler could check for buffer overreads and overwrites.

Then your code could also get easier.

(Untested, I hope it's not completely wrong).


size_t remove_spaces(_In_reads_bytes_(n+1) const char *source, size_t n, _Out_writes_bytes_(n+1) char *result) {
ssize_t start = 0, end = n - 1;
for (; start < n && source[start] == ' '; start++) ;
for (; end >= start && source[end] == ' '; end--) ;
size_t length = end - start + 1;
strncpy(result, source + start, length);
return length;
}


I'm returning the new length, instead of the number of spaces removed. The new length is more interesting to have because it is a property of the new string. If the caller wants to have the number of spaces removed, he can subtract the new length from the old one.

Acrofales
Profile Joined August 2010
Spain18259 Posts
Last Edited: 2017-02-20 11:50:57
February 20 2017 11:47 GMT
#16948
On February 19 2017 19:34 Hanh wrote:
Once again, there is a context.

Show nested quote +

the order matters?

I thought I remembered the professor saying the order matters for this, but when I conceptualized it I couldn't see the difference between

there exists x, such that for all y

and

for all y, there exists x


travis didn't put the complete statement, but I'm sure he meant this:

(1) exists x in X, for all y in Y, P(x, y)
(2) for all y in Y, exists x in X, P(x, y)

because he said: "the order matters?"

And I said: (1) => (2)

If you don't agree with that and you think that x and y are unbound then the discussion is moot.
By changing the domain, statements change meaning. It's true for any logical statement with quantifiers. You don't have to go very far to see that.

P: for all x in X, x = 0.
False if X = {0, 1}, True if X = {0}.

Essentially, statements without a domain are meaningless.

Btw, it's a classic question. I could google an answer here:

http://math.stackexchange.com/questions/1064889/the-order-of-mixed-quantifiers

Show nested quote +

For all x exists y x < y
Exists x for all y y < x

The latter says something about a global maximum, but we have to finagle with the definition of our domain. Either x\in D and y \in D - {x}, or you have a problem: let y=x, and the second predicate is false even if the set has a global maximum.

Well, as you said, you have to change the domain.

IMO, the context made clear that x was bound to X, and y to Y.

then
exists x in R, for all y in R, x < y: means there is a real number lower than every other real number. Which is false.

for all y in R, exists x in R, x < y: every real number has a number lower than it.
which is true.


I had written a long reply that was going point by point, but I realized that the main issue is that we are simply using different levels of mathematical rigour, which is causing a misunderstanding... in particular to other people who might be interested in reading this (very few by now, I'd assume ).

So lets clarify. As long as x and y are in the same domain the implication holds. In other words:

\exists x \forall y P(x,y) \rightarrow \forall y \exists x P(x,y)

holds as long as x, y \in D (which is an underlying assumption for the stackexchange article if you actually follow the proof). If x, y in different sets (x \in X and y \in Y), then you need restrictions on X and Y (and/or properties of P), and it can no longer be said to hold in the general case.

Given that Travis was talking about x,y in the same subset of R, it holds (there is never a universal maximum that is also greater than itself, and thus it is trivially true).
Manit0u
Profile Blog Joined August 2004
Poland17720 Posts
February 20 2017 13:33 GMT
#16949
So, 3 month at new work now. Starting to feel comfortable with RoR. Then I get thrown into a new project where I have to deal with stuff like this (implementing it in Ruby):

https://github.com/LuaDist/lcms/blob/master/include/icc34.h
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18259 Posts
February 20 2017 13:39 GMT
#16950
On February 20 2017 22:33 Manit0u wrote:
So, 3 month at new work now. Starting to feel comfortable with RoR. Then I get thrown into a new project where I have to deal with stuff like this (implementing it in Ruby):

https://github.com/LuaDist/lcms/blob/master/include/icc34.h

That seems fairly straightforward? Just a bunch of structs getting defined in a header? Did you link the wrong thing? There doesn't seem to be anything particularly complex there, just a load of work. I admit, I didn't read it very carefully, and I know you're just venting here and not asking for help or advice, but can you explain what the problem is that you have to deal with?
Manit0u
Profile Blog Joined August 2004
Poland17720 Posts
February 20 2017 13:45 GMT
#16951
On February 20 2017 22:39 Acrofales wrote:
Show nested quote +
On February 20 2017 22:33 Manit0u wrote:
So, 3 month at new work now. Starting to feel comfortable with RoR. Then I get thrown into a new project where I have to deal with stuff like this (implementing it in Ruby):

https://github.com/LuaDist/lcms/blob/master/include/icc34.h

That seems fairly straightforward? Just a bunch of structs getting defined in a header? Did you link the wrong thing? There doesn't seem to be anything particularly complex there, just a load of work. I admit, I didn't read it very carefully, and I know you're just venting here and not asking for help or advice, but can you explain what the problem is that you have to deal with?


http://www.color.org/icc-book1.PDF

That's just a small part of what I'm dealing with now. Basically, I have to build a system from ground-up. It'll be an application residing on the server cluster, mapping resources to the database, keeping them synced and serving them to other applications that reside on numerous other clusters and process said resources...

It would all be cool and dandy, if not for the fact that the guy leading this project needs it to be done in Rails (3), but he hates Rails so framework conventions are out the window. He also doesn't agree with the current best practices in Ruby so that's out the window too...

I can't even write proper tests because with the current architectural implementation the framework's test suite can't be launched at all (have to run tests on each file manually) etc. etc.

I'm in some deep shit and in addition I have to learn all about printer operation and such, which is boring as hell and will take forever.

Thankfully I have my other project in Rails 5 with best practices enforced all around. It's the one thing that's keeping me sane right now.
Time is precious. Waste it wisely.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2017-02-20 15:56:25
February 20 2017 15:55 GMT
#16952
On February 20 2017 22:45 Manit0u wrote:
It would all be cool and dandy, if not for the fact that the guy leading this project needs it to be done in Rails (3), but he hates Rails so framework conventions are out the window. He also doesn't agree with the current best practices in Ruby so that's out the window too...


How do people handle stuff like this? People who do everything their own way are really hard to work with.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Acrofales
Profile Joined August 2010
Spain18259 Posts
February 20 2017 16:17 GMT
#16953
On February 20 2017 22:45 Manit0u wrote:
Show nested quote +
On February 20 2017 22:39 Acrofales wrote:
On February 20 2017 22:33 Manit0u wrote:
So, 3 month at new work now. Starting to feel comfortable with RoR. Then I get thrown into a new project where I have to deal with stuff like this (implementing it in Ruby):

https://github.com/LuaDist/lcms/blob/master/include/icc34.h

That seems fairly straightforward? Just a bunch of structs getting defined in a header? Did you link the wrong thing? There doesn't seem to be anything particularly complex there, just a load of work. I admit, I didn't read it very carefully, and I know you're just venting here and not asking for help or advice, but can you explain what the problem is that you have to deal with?


http://www.color.org/icc-book1.PDF

That's just a small part of what I'm dealing with now. Basically, I have to build a system from ground-up. It'll be an application residing on the server cluster, mapping resources to the database, keeping them synced and serving them to other applications that reside on numerous other clusters and process said resources...

It would all be cool and dandy, if not for the fact that the guy leading this project needs it to be done in Rails (3), but he hates Rails so framework conventions are out the window. He also doesn't agree with the current best practices in Ruby so that's out the window too...

I can't even write proper tests because with the current architectural implementation the framework's test suite can't be launched at all (have to run tests on each file manually) etc. etc.

I'm in some deep shit and in addition I have to learn all about printer operation and such, which is boring as hell and will take forever.

Thankfully I have my other project in Rails 5 with best practices enforced all around. It's the one thing that's keeping me sane right now.


That book looks mindnumbingly boring. I hope the blurb at the front is written tongue-in-cheek. Or perhaps I am missing something and international color codes are actually fascinating (I guess everything *can* be interesting). Anyway, I guess all I can say is that I sympathize and good luck.

The way I would deal with a job where my boss tells me what to do but also tells me that I can't use any of the tools to do it, is just use the tools anyway, and then when it's done and he asks what I used, I tell him frankly that I used all the tools he told me I wasn't allowed to use.

Of course, this only works if you have the freedom of a boss who doesn't micromanage. If your boss does micromanage your tasks, then I guess you're screwed and have to comply (or quit).
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-02-20 20:15:32
February 20 2017 20:10 GMT
#16954
alright, moving on to more discrete math stuff. I really need help with these problems :/

Yes, this is homework help. No, I am not a sack of shit, I am only asking because I am trying to learn more. No one gets through college by cheating on homework anyways since like 80% of your grades are exams.

First question series is titled "math of interest" and has 7 parts but I will only list a couple of them, and maybe it will give me a better idea on how to do the rest.

+ Show Spoiler +

the domain for the following problems are N. You can have +,-,x,/,= and (for all, there exists, epsilon (what would you call this one, "in" ?) and (and, or, not)

1.) write a formula ONE(x) such that ONE(x) holds iff when x is divided by 4 the remainder is 1:

So my first question is wtf is ONE(x). Is this a function, or is this a formula? It says write a formula. Is an answer literally x=1(mod 4)? But it doesn't say we can use mod so then it wants something like "(x-1)/4 = y where y is in N?"


2.) write a formula PRIME(x) such that PRIME(x) holds iff x is Prime:

so, just throwing out an idea

for all x in N, for all y in n, [(x does not equal y) and (x/y is not in N)



different type of problem here

+ Show Spoiler +

if x is congruent to 2 (mod 7) and y is congruent to 3 (mod 14) then what can you say about xy?

WTF DO THEY WANT. I do not know anything interesting you can say about xy. I expect it has to do with some rule that I don't know. I looked through the text and can't find anything.


last one:

+ Show Spoiler +

show that if n^3 is congruent to 0 (mod 7) then n is congruent to 0 (mod 7):

I do not know how to prove this. I mean it seems obvious this is true to me.. I just have no idea how to prove it :/

spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
February 20 2017 20:17 GMT
#16955
On February 21 2017 05:10 travis wrote:
if x is congruent to 2 (mod 7) and y is congruent to 3 (mod 14) then what can you say about xy?

WTF DO THEY WANT. I do not know anything interesting you can say about xy. I expect it has to do with some rule that I don't know. I looked through the text and can't find anything.

They want the a and b in "xy is congruent to a (mod b)". Now this has been years ago and I have no idea anymore how it works.
If you have a good reason to disagree with the above, please tell me. Thank you.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
February 20 2017 20:32 GMT
#16956
On February 21 2017 05:17 spinesheath wrote:
Show nested quote +
On February 21 2017 05:10 travis wrote:
if x is congruent to 2 (mod 7) and y is congruent to 3 (mod 14) then what can you say about xy?

WTF DO THEY WANT. I do not know anything interesting you can say about xy. I expect it has to do with some rule that I don't know. I looked through the text and can't find anything.

They want the a and b in "xy is congruent to a (mod b)". Now this has been years ago and I have no idea anymore how it works.


kinda just doin some random stuff
I think that "xy is congruent to 6 (mod 7)" might be what they want then?
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
February 20 2017 21:06 GMT
#16957
for my last one, does this work for a proof?

do the contrapositive:

if n is not congruent to 0 (mod 7) then n^3 is not congruent to 0 (mod 7)

then just do the cases where n = 1, n = 2, n = 3, n = 4, n = 5, n = 6
proving that the contrapositive holds true for each of these cases?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
February 20 2017 21:29 GMT
#16958
On February 21 2017 05:32 travis wrote:
Show nested quote +
On February 21 2017 05:17 spinesheath wrote:
On February 21 2017 05:10 travis wrote:
if x is congruent to 2 (mod 7) and y is congruent to 3 (mod 14) then what can you say about xy?

WTF DO THEY WANT. I do not know anything interesting you can say about xy. I expect it has to do with some rule that I don't know. I looked through the text and can't find anything.

They want the a and b in "xy is congruent to a (mod b)". Now this has been years ago and I have no idea anymore how it works.


kinda just doin some random stuff
I think that "xy is congruent to 6 (mod 7)" might be what they want then?


Sure.

x === 2 (mod 7)
y === 3 (mod 14)

7*a = x - 2
x = 7*a + 2
14*b = y - 3
y = 14*b + 3

xy = (7*a + 2)(14*b + 3)
xy = 98ab + 21a + 28b + 6
xy - 6 = 98ab + 21a + 28b
xy - 6 = 7(14ab + 3a + 4b)
xy === 6 (mod 7)
There is no one like you in the universe.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
February 20 2017 21:42 GMT
#16959
On February 21 2017 06:29 Blisse wrote:

xy - 6 = 7(14ab + 3a + 4b)
xy === 6 (mod 7)


I think I understand what you did here, but I think it would be helpful if you could explain it to me
Manit0u
Profile Blog Joined August 2004
Poland17720 Posts
February 20 2017 22:26 GMT
#16960
On February 21 2017 00:55 Blitzkrieg0 wrote:
Show nested quote +
On February 20 2017 22:45 Manit0u wrote:
It would all be cool and dandy, if not for the fact that the guy leading this project needs it to be done in Rails (3), but he hates Rails so framework conventions are out the window. He also doesn't agree with the current best practices in Ruby so that's out the window too...


How do people handle stuff like this? People who do everything their own way are really hard to work with.


I really don't know. This guy has 6 years of experience more than me (in some really big projects too) so I'm not really in a position to dispute his methods. Why is he using Notepad++ and insists on using tabs instead of spaces is beyond me though...
Time is precious. Waste it wisely.
Prev 1 846 847 848 849 850 1032 Next
Please log in or register to reply.
Live Events Refresh
Wardi Open
11:00
#82
WardiTV679
OGKoka 365
Rex107
Liquipedia
Afreeca Starleague
10:00
Ro16 Group A
Soma vs YSC
Sharp vs sSak
Afreeca ASL 12767
StarCastTV_EN344
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 365
Lowko301
ProTech138
Rex 107
Codebar 20
StarCraft: Brood War
Sea 24274
Calm 15079
Bisu 7769
Jaedong 3062
Horang2 1897
BeSt 1044
EffOrt 848
Mini 650
Stork 559
firebathero 530
[ Show more ]
Light 438
Zeus 363
Pusan 358
actioN 339
ZerO 228
Soulkey 220
Hyun 164
Larva 148
Mind 88
Rush 72
Killer 70
Barracks 51
ToSsGirL 50
yabsab 36
zelot 25
Nal_rA 19
soO 18
Terrorterran 18
Movie 17
Hm[arnc] 16
Shinee 16
[sc1f]eonzerg 15
GoRush 14
Bale 12
Sacsri 12
Noble 12
IntoTheRainbow 12
scan(afreeca) 11
SilentControl 9
Icarus 8
Dota 2
qojqva1064
syndereN42
febbydoto11
Counter-Strike
olofmeister3194
fl0m2176
x6flipin414
byalli385
markeloff86
Other Games
singsing1733
B2W.Neo1047
hiko676
crisheroes298
Pyrionflax151
Liquid`LucifroN98
Liquid`VortiX88
QueenE78
Mew2King49
KnowMe47
RotterdaM29
Organizations
Other Games
BasetradeTV778
Counter-Strike
PGL302
StarCraft: Brood War
UltimateBattle 302
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 56
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis2899
• TFBlade1533
• Stunt580
Upcoming Events
Monday Night Weeklies
2h 33m
OSC
10h 33m
Afreeca Starleague
20h 33m
Snow vs PianO
hero vs Rain
WardiTV Map Contest Tou…
20h 33m
GSL
22h 33m
PiGosaur Cup
1d 10h
CranKy Ducklings
1d 19h
Kung Fu Cup
1d 22h
Replay Cast
2 days
The PondCast
2 days
[ Show More ]
WardiTV Map Contest Tou…
2 days
Replay Cast
3 days
Escore
3 days
WardiTV Map Contest Tou…
3 days
Korean StarCraft League
4 days
CranKy Ducklings
4 days
WardiTV Map Contest Tou…
4 days
IPSL
5 days
WolFix vs nOmaD
dxtr13 vs Razz
BSL
5 days
Sparkling Tuna Cup
5 days
WardiTV Map Contest Tou…
5 days
Ladder Legends
6 days
BSL
6 days
IPSL
6 days
JDConan vs TBD
Aegong vs rasowy
Replay Cast
6 days
Replay Cast
6 days
Wardi Open
6 days
Afreeca Starleague
6 days
Bisu vs Ample
Jaedong vs Flash
Liquipedia Results

Completed

Escore Tournament S2: W2
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
StarCraft2 Community Team League 2026 Spring
Nations Cup 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W3
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
RSL Revival: Season 5
WardiTV TLMC #16
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.