• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:58
CET 04:58
KST 12:58
  • 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] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy6ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Weekly Cups (March 16-22): herO doubles, Cure surprises0Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool42Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12
StarCraft 2
General
Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2) Weekly Cups (March 16-22): herO doubles, Cure surprises Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Potential Updates Coming to the SC2 CN Server
Tourneys
World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
ASL21 General Discussion Soulkey's decision to leave C9 BGH Auto Balance -> http://bghmmr.eu/ JaeDong's form before ASL [ASL21] Ro24 Preview Pt1: New Chaos
Tourneys
[ASL21] Ro24 Group A ASL Season 21 LIVESTREAM with English Commentary [Megathread] Daily Proleagues [BSL22] Open Qualifiers & Ladder Tours
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
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
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
U4GM Tips Counter Enemy Gadgets Fast in Black Ops rsvsr How to Keep Reward Chains Rolling in Monopol u4gm What to Do First in MLB The Show 26 Spring
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2809 users

Math puzzle #1

Blogs > LastPrime
Post a Reply
LastPrime
Profile Blog Joined May 2010
United States109 Posts
September 09 2010 22:16 GMT
#1
Several schools participated in a tennis tourney. Each player played every player from different school than his/her own. The total number of girls participating differed from the total number of boys by at most 1. Also, the total number of same sex matches differed from the total number of opposite sex matches by at most 1. What is the maximum number of schools that could have sent an odd number of players?

BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
September 09 2010 22:32 GMT
#2
Infinite, if we can control the variables to our liking.

School 1: sends x boys, x+1 girls.
School 2: sends x+1 boys, x girls.

No problem.

Add School 3: sends x boys, x+1 girls.

This would actually break the rule, because the girl plays 2 more boys than girls.

This is fixed by adding School 4: sends x+1 boys, x girls.

If we're out of schools, then just make School 3 send an even number of girls and boys.

In short, an even number of schools can send an odd number of players. The maximum even number is.... .... ....
Compilers are like boyfriends, you miss a period and they go crazy on you.
LastPrime
Profile Blog Joined May 2010
United States109 Posts
September 09 2010 22:47 GMT
#3
Ok, based on what you said, let's take for example the following:

School #--Boy--Girl
1-----------1------2
2-----------2------1
3-----------1------2
4-----------2------1

Same sex matches: 1(2+1+2)+2(1+1+2)+1(1+2+2)+2(1+2+1))/2 + 1(2+1+2)+2(1+1+2)+1(1+2+2)+2(1+2+1))/2. That's 26.

Opposite sex matches: 1(1+2+1)+2(2+2+1)+1(2+1+1)+2(2+1+2)
That's 28.

In fact if you do this out algebraically you get that # of same sex matches in this scenario is 12x^2+12x+2, while the # of opposite sex matches is 12x^2+12x+4.

TanGeng
Profile Blog Joined January 2009
Sanya12364 Posts
Last Edited: 2010-09-09 23:20:42
September 09 2010 23:06 GMT
#4
If School n has even number of players then
Bn (boys) = Gn (girls)

If School n had odd number of players then
Bn = Gn +/- 1
and
Gn-Bn = -1, 0, 1 (three possibilities)

we also have
Bt = sum(Bn) over all n
Gt = sum(Gn) over all n

total difference in same sex vs opposite sex matches is (double counted)
DIFFt = sum( Bn(Bt - Bn) + Gn(Gt - Gn) - Bn(Gt - Gn) - Gn(Bt - Bn) ) over all n
DIFFt = sum( (Gn-Bn) (Gt-Gn -Bt + Bn) ) over all n
DIFFt = sum( (Gn-Bn) ((Gt - Bt) - (Gn - Bn))) over all n
Gt - Bt = sum (Gn - Bn) over all n

DIFFt = sum ((Gn-Bn) ^ 2) - (sum(Gn-Bn))^2 over all n

now Gn - Bn has range -1, 0, 1
and when Gn - Bn the summation term reduces to 0.
Only interesting points are when Gn - Bn is not equal to zero or when school has odd number players
let's call this count Z.

Since (Gn-Bn)^2 = 1 for all interesting points

sum ((Gn-Bn) ^ 2) = Z

DIFFt = Z - (sum(Gn-Bn))^2 with Z values of either 1 or -1

if DIFFt needs to be +/- 1 then Z must be +/- of a perfect square, and Z must match the perfect square in evenness or oddness. That means Z has to be the perfect square itself.

edit: oops I forgot the double counting part, so Z is a perfect square or +/- 2.


example of with 4 odds (2^2)
0 1
0 1
0 1
1 0

3 same sex matches 3 cross sex matches

example with 6 odds (2^2 + 2)
0 1
0 1
0 1
1 0
0 1
1 0

7 same sex matches 8 cross sex matches
Moderator我们是个踏实的赞助商模式俱乐部
Steve496
Profile Joined July 2009
United States60 Posts
Last Edited: 2010-09-09 23:10:22
September 09 2010 23:09 GMT
#5
3.

Let the number of boys sent by each school by b_1, b_2, ... b_n, the number of girls sent by each be g_1, g_2, ... g_n, and the total number of each gender be B and G (respectively).

We know (B-G)^2 = 0 or 1.

Each of b_1 boys plays B-b_1 same-sex games, and G-g1 opposite-sex ones; the girls do this in reverse. Adding this for all schools, we find that the boys play (B^2 - (b_1^2+...+b_n^2))/2 same-sex games, girls the same thing with gs, and there are BG-(b_1*g_1+...+b_n*g_n) opposite sex games, and the difference between those is +/- 1. Rearranging, we get
(B-G)^2-(b_1-g_1)^2-(b_2-g_2)^2-...-(b_n-g_n)^2 = +/- 2. So, 0 or 1, minus a lot of terms that can't be negative, equals +/- 2. Hence, "most" of those terms must have b_k=g_k and thus an even number of students; at most 3 of them can be nonzero, giving us 1 -1 -1 -1 = -2. This is achieved, for instance, when there are three schools, each sending 1 student, 2 of which are boys and one of which is a girl; total students are 2 vs 1, and there is one same-sex and 2 opposite-sex games.
BottleAbuser
Profile Blog Joined December 2007
Korea (South)1888 Posts
September 09 2010 23:10 GMT
#6
Okay. A simpler way of looking at it:

Each school sends 1 boy or 1 girl. Then, we can construct a table like this:

         boy girl
school 1: 0 1
2: 1 0
3: 0 1
4: 1 0
5: 0 1
...

We can then easily see that each player plays every other student in the event, which necessarily means one more opposite-sex match than same-sex match (the students don't play themselves). Adding students to schools doesn't help, because that just serves to increase the discrepancy.

It looks like two schools can send an odd number of students.
Compilers are like boyfriends, you miss a period and they go crazy on you.
rasnj
Profile Joined May 2010
United States1959 Posts
Last Edited: 2010-09-09 23:13:10
September 09 2010 23:12 GMT
#7
EDIT: See Steve496 posted essentially the same solution as me.

Dunno if this kind of thing deserves a spoiler tag, but better be safe:
+ Show Spoiler +

The answer is 3.

Let us number the schools 1,2,...,n.

Let bi denote the number of boys send from school i.
Let gi denote the number of girls send from school i.
Let B denote the total number of boys and let G denote the total number of girls.
Let ki = bi - gi.

For an arbitrary boy from school i he has to play against (B-bi) boys, and (G-gi) girls (similar formulas hold for girls). Thus school i participate in precisely
SSMi = bi(B-bi) + gi(G-gi)
Same-sex matches and
OSMi = gi(B-bi)+bi(G-gi)
Opposite-sex matches.
Every same-sex match is counted in exactly two SSMi (once for each school sending a participant), and similarily for opposite-sex matches. Thus the total number of same-sex matches is:
SSM=(SSM1 + SSM2 + .... + SSMn)/2
The total number of opposite-sex matches is:
OSM = (OSM1 + OSM2 + ....+ OSMn)/2
We have,
SSMi - OSMi = (bi-gi)(B-G) - (bi-gi)^2
Which gives us:
2(SSM-OSM) = (B-G)^2 - (b1-g1)^2 - (b2-g2)^2 - ... - (bn-gn)^2
= k1^2 + k2^2 + k3^2 + ....+kn^2
We assumed SSM-OSM and B-G are both in the set {-1,0,1} so
(B-G)^2 - 2(SSM-OSM) = k1^2 + k2^2 + k3^2 + ....+kn^2
can only take on the values -3,-2,-1,0,1,2,-3. In particular at most three of the values k1, k2, ..., kn are non-zero. Since we haven't imposed an order on the schools we may order them such that k4,...,kn are 0. Then schools k4,...,kn sends an equal number of boys and girls and therefore an even number of players (2bi = 2gi for school i, where i > 3). We have now shown that at most 3 schools can send an odd number of players. To see that this can be achieved we can just let there be 3 schools and let them send:
School 1: 1 boy, 0 girls.
School 2: 1 boy, 0 girls.
School 3: 0 boys, 1 girl.
Then there is 1 same-sex match (between school 1 and 2), and 2 opposite sex matches (1 vs 3 and 2 vs 3).
LastPrime
Profile Blog Joined May 2010
United States109 Posts
September 09 2010 23:19 GMT
#8
On September 10 2010 08:09 Steve496 wrote:
3.

Let the number of boys sent by each school by b_1, b_2, ... b_n, the number of girls sent by each be g_1, g_2, ... g_n, and the total number of each gender be B and G (respectively).

We know (B-G)^2 = 0 or 1.

Each of b_1 boys plays B-b_1 same-sex games, and G-g1 opposite-sex ones; the girls do this in reverse. Adding this for all schools, we find that the boys play (B^2 - (b_1^2+...+b_n^2))/2 same-sex games, girls the same thing with gs, and there are BG-(b_1*g_1+...+b_n*g_n) opposite sex games, and the difference between those is +/- 1. Rearranging, we get
(B-G)^2-(b_1-g_1)^2-(b_2-g_2)^2-...-(b_n-g_n)^2 = +/- 2. So, 0 or 1, minus a lot of terms that can't be negative, equals +/- 2. Hence, "most" of those terms must have b_k=g_k and thus an even number of students; at most 3 of them can be nonzero, giving us 1 -1 -1 -1 = -2. This is achieved, for instance, when there are three schools, each sending 1 student, 2 of which are boys and one of which is a girl; total students are 2 vs 1, and there is one same-sex and 2 opposite-sex games.


We have a winner.
Please log in or register to reply.
Live Events Refresh
Next event in 6h 2m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft500
PiGStarcraft280
RuFF_SC2 208
Nina 192
mcanning 34
-ZergGirl 18
StarCraft: Brood War
GuemChi 6087
ggaemo 96
Noble 36
NaDa 28
Bale 15
Icarus 5
Dota 2
monkeys_forever905
febbydoto39
League of Legends
JimRising 789
Counter-Strike
Coldzera 1562
taco 706
Stewie2K603
Super Smash Bros
hungrybox265
Other Games
summit1g9396
C9.Mang0435
Maynarde113
Trikslyr47
UpATreeSC35
JuggernautJason8
deth6
Organizations
Other Games
gamesdonequick1338
Dota 2
PGL Dota 2 - Main Stream84
Other Games
BasetradeTV2
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 65
• Diggity2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1050
• Rush334
Upcoming Events
Sparkling Tuna Cup
6h 2m
Afreeca Starleague
6h 2m
Soulkey vs Ample
JyJ vs sSak
Replay Cast
1d 5h
Afreeca Starleague
1d 6h
hero vs YSC
Larva vs Shine
Kung Fu Cup
1d 7h
Replay Cast
1d 20h
KCM Race Survival
2 days
The PondCast
2 days
WardiTV Team League
2 days
Replay Cast
2 days
[ Show More ]
WardiTV Team League
3 days
RSL Revival
4 days
Cure vs Zoun
herO vs Rogue
WardiTV Team League
4 days
Platinum Heroes Events
4 days
BSL
4 days
RSL Revival
5 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
5 days
BSL
5 days
Replay Cast
6 days
Afreeca Starleague
6 days
Light vs Calm
Royal vs Mind
Wardi Open
6 days
Monday Night Weeklies
6 days
Liquipedia Results

Completed

Proleague 2026-03-23
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
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.