BAT BIEN VA NDA BAT BIEN TRONG CAC BAI TOAN TRO CHOl
3. Cac loai bai toan hai ngifcfi chtfi binh dang
Chung ta xet loai bai toan tro chcfi vdi hai ngufdi chdi binh dang vdi cac gia thiet sau day:
• Tro chcfi gom hai dau thu A va B, luan phien nhau, moi ngu^di di mot nUdc. Quy tac thiTc hien cac nu'dc di cua hai ngufdi chdi (c6 the trijf niTdc dau tien) la hoan toan giong nhau.
• Hai dau thu deu chdi rat gioi, nghia la c6 kha nang tinh triTdc mpi nirdc di. Gia thiet chdi gioi nham tranh cac tru'dng hdp
"an may", i\ic la cac tru'dng hdp do doi phiTdng hd henh ma di lac ntfdc. Dieu nay tu'dng du'dng vdi gia thiet ca hai dau thu deu CO the tinh triTdc moi niTdc di (vdi loai tro chdi hSiu han) hoac ca hai dau thu deu biet each di tot nhat.
• Dau thu nao den lifdt minh khong the di du^dc niJa thi chiu thua va van chdi ket thiic.
• Khong CO the hoa, sau hffu han niTdc di se xdc dinh diTdc ai thang, ai thua.
Bat bie'n va nita bat Men trong cac bai todn tro chai 53 Trong cac bai toan tro chdi, luon luon ton tai hai loai vi tri: vi tri thdng va v i tri thua. V i tri thdng du'dc dinh nghia la cac vi tri ma tai do neu ngifdi chdi thifc hien chien thuat toi tfu thi se danh chien thang, v i tri thua la v i tri ma tai do ngu'di chdi cho dii thiTc hien cac nifdc di nhU the' nao thi van thua. Hai loai v i tri nay c6 dac diem sau:
• V i tri ket thuc luon la v i tri thdng.
• Tit moi v i tri thua, luon c6 it nhat mot each difa den v i tri thdng.
• TH m6i v i tri thdng, luon difa den vi tri thua.
Mot doi thu se thang khi ho bat dau n\idc di d v i tri thdng va ke't
thuc nifdc di d v i tri thua. , Khac vdi bai toan vdi mot ngu'di chdi, thi trong bai toan tro chdi
vdi hai ngiTdi chdi, bat bien va nu'a bat bien dUdc tao ra va duy tri d m6i v i tri thua. Cac vi tri thua se c6 chung nhau mot tinh chat T, ngu'di chien thang se la ngifdi duy tri diTdc tinh chat T sau moi nu'dc di cua minh. Tinh chat T chinh la bat bien trong bai toan tro chdi.
De nghien cuTu tinh bat bien trong cac bai toan tro chdi, ta se x6t mot Idp cac bai toan tro chdi phd bien la bai toan boc bi.
Bai toan 6. Tren ban c6 2013 vien hi. Ava B idn lucft boc bi theo nguyen tdc sau: mdi idn duac phep boc tif mot den nam vien bi. A la ngudi boc bi trudc, ai boc duac vien bi cuoi cCing Id ngUdi chien thdng. Hoi ai se Id ngUdi c6 chien thuat gidnh chien thdng?
Day la bai toan tro chdi kha quen thuoc vdi cAc ban hoc sinh chuyen Toan. Y tufdng chu dao cua bai nay la suT dung modulo.
LoTi giai. Co the nhan thay rang, ngi/di chdi cd the duy tri so bi tr6n ban luon bat bien vdi modulo 6 (tinh chat T). That vay. khi ngirdi chdi tru'dc boc i vien bi, ta cd the boc 6 - i vien bi de duy tri du'dc tinh chat T. Ma v i tri thua cuoi ciing la v i tri cd 0 vien bi tren mat ban, nen cac v i tri thua la cac v i tri cd so bi chia het cho 6, cac v i tri con lai la v i tri thang. V i tri ban dau la v i tri thang (2013 = 3 (mod 6)) nen A se la ngtfdi cd chien thuat thang. •
54 Cdc phuang phdp gidi todn qua cdc ky thi Olympic Bkng cdch thay ddi quy tac boc bi hoSc cdch x6i thSng cupc, ta C O cac bai toan thii v i sau:
B a i toan 7. Tren bdn c6 2013 vien bi. A vd B idn lam boc bi theo nguyen tac sau: moi Idn dugc phep boc tCc mot den ndm vien bi. A la ngUdi boc bi trade, ai boc daac vien bi cuoi cung Id ngadi thua cuoc. Hoi ai se Id ngUdi cd chien thudt gidnh chien thdng?
O bai toan nay, ve quy tac boc bi thi giong het Bai toan 6, diem khac duy nhat la each xet thang cuoc. K h i luat chdi khong thay ddi thi bat bien dUcJc suT dung se khong thay ddi, va khi each xet thang cuoc thay ddi thi chi c6 v i tri thang va v i tri thua thay ddi.
Trong Bai toan 7, bang each lap luan ttfcJng tu* Bai toan 6, cac vi tri thua se la cac v i tri c6 so bi chia cho 6 dU' 1, cac v i tri con lai la v i tri thang. V i tri ban dau la v i tri thang nen A se la ngUdi c6 chien thuat thang.
Bai toan 8. Tren bdn cd n vien bi {n ^ 2). A vd B idn laat boc bi theo nguyen tac sau: tai lucft ddu tien, A dugc phep boc mot so bi Id mot so nguyen duang tuy y nhung khong dugc boc todn bo so bi. Trong cdc lugt boc tiep theo, Avd B khong dugc phep boc vugt qud so bi md A boc trong lugt ddu tien cung nhu khong dugc phep boc 0 vien. Ai boc dugc vien bi cuoi cung Id ngUdi thang cuoc. Hoi vdi cdc gid tri cua n nhu the ndo thi A se la ngUdi cd chien thudt thdng?
Th\Xc ra, Bai toan 8 la mot dang tdng quat cho Bai toan 6.
Lofi giai. Gia S I J T tai liTdt dau tien A hoc k vien bi, khi do trong cac lufdt tiep theo, Ava B daac phep boc tuf 1 den k vien bi. NhU vay, ta se su- dung bat bien cho cac v i tri thua theo modulo A; + 1. Lap luan tUdng tiT Bai toan 6, cac v i tri thua (sau lufcJt boc dau tien) la cac v i tri c6 so bi la boi cua /c + 1, cac v i tri con lai la v i tri thang.
A se thang neu A tim dUdc mot sd nguyen diTdng k sao cho n - A; la boi so cua A; + 1 hay n+1 = 0 (mod k + 1). Nhu" vay, neu n + 1 la hdp so thi A se c6 chien thuat thang, n + 1 la so nguyen
to thi B se cd chien thuat thSng. •
B(ti bien vd niia bd't bien trong cdc bai todn tro chat 55 B a i toan 9. Tren bdn cd 2013 vien bi. A vd B Idn lugt bo'c bi theo nguyen tac sau: Moi idn dugc phep boc so' bi Id lily thiCa dung cua 2 {dugc phep bo'c mot vien bi). A Id ngUdi bo'c bi trade, ai boc dugc vien bi cuoi ciing Id ngUdi chien thang. Hoi ai se Id ngUdi cd chien thudt thdng?
Bai toan nay da c6 quy tac boc bi khac vdi ba bai toan tren.
NhU' vay, bat bien chiing ta su" dung cung nhu" v i tri thang, vi tri thua se thay ddi theo. Vay lam the nao de tim dufdc bat bien thich h0p cho bai toan nay?
Lcfi giai. Chung ta se tien hanh lap bang v i tri thang va thua cua mot ngu'di chdi trong cdc triTdng hdp so bi la so nho.
• K h i tren ban c6 mot vien bi, thi dufdng nhien A se thang vay
" 1 " la v i tri thang.
• K h i tren ban c6 hai vien bi, A van la ngifdi chien thang, "2"
la v i tri thang.
• K h i tren ban c6 ba vien bi, A se thua v i v d i moi each boc bi cua A thi B deu nhan dUdc vien bi cuoi cung nen "3" se la vi tri thua.
• K h i tren ban cd n vien bi, A se thang khi va chi khi " n " la vi tri thang hay A cd the boc di k vien bi sao cho " n - /c" la vi tri thua. Ngufdc lai " n " la v i tri thua.
Bang each thuf trifc tiep v d i cdc tru'dng hdp nho, ta cd bang phan bd cac v i tri thang (W) va v i tri thua (L) nhu" sau:
S d b i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Ke't qua W W L W W L W W L W W L W W L
Tij" bang tren ta cd the diT doan rang, bat bien d cac v i tri thua la so bi la boi cua 3. Va nhif vay, trong bai toan nay, A se la ngifdi thua cuoc, v i "2013" la mot vi tri thua. That vay, ta se chu-ng minh ngudi chdi B se luon cd the duy t n so bi con lai luon la boi cua 3.
E)en lu'dt bdc cua A, so bi tren ban se luon la boi cua 3, va khi A boc 2*^ vien bi, so bi con lai chac chan khong la boi cua 3 (vi tri
56 Cdc phuang phdp gidi todn qua cdc ky thi Olympic thang). Den lUcft bo'c cua so b i tren ban se khong la bpi cua 3, vay B CO the bo'c di mot hoac hai vien bi de difa so bi ve la boi
cua 3 (vi tri thua). • B a i toan 10. Tren ban cd 2013 vien bi. Avd B idn luat bdc bi theo
nguyen tdc sau: mSi idn dugc phep bdc mot vien, hai vien hodc mot nAa sd bi cd tren ban neu sd bi la sd chdn. A la ngUdi bdc bi trUdc, ai bdc duac vien bi cudi cilng la ngudi chien thang. Hoi ai se Id ngUdi cd chien thudt gidnh chien thdng?
Lcfi gial. Bang viec khao sat vdi cac trtfdng hdp so bi nho, ta c6 bang phan bo' cac v i tri thang (W) va v i tri thua (L) nhuf sau:
So bi 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Ke't qua W W L W W W L W W L W W L W W
Tiif bang tren ta c6 the du" doan rang, khi so bi Idn hdn 3, bat bie'n 6 cac v i tri thua la so bi chia cho 3 du" 1. Va nhu" vay, trong bai toan nay, A se la ngiTdi thang cuoc, v i "2013" la v i tri thang. That vay, ta se chiJng minh A se luon c6 the duy tri so bi con lai luon chia cho 3 dU 1. Den lifdt boc cua A, so bi tren ban se luon la boi cua 3 hoac chia 3 diT 2, va khi do A c6 the boc mot hoac hai vien de dam bao so bi con lai chia cho 3 du" 1 (vi tri thua).
Den lifdt boc cua B , so bi tren ban se chia cho 3 duf 1, khi do B se khong c6 each nao de tiep tuc duy tri so bi chia cho 3 du" 1,
hay B luon diTa so' bi ve v i tri thang. • Bai toan 11. Tren ban cd 2013 vien bi. A vd B idn luat bdc bi
theo nguyen tdc sau: moi idn duac phep bdc tdi thieu mot vien bi vd khong duac bdc nhieu han nvta sd bi con lai trong ddng. A la ngudi bdc bi trUdc, den luat minh ma ai khong the thUc hien dUdc nude di la ngUdi thua cuoc. Hoi ai se la ngUdi cd chien thudt gidnh chien thang?
Lcfi giai. Bang viec khao sat vdi cac trufdng hdp so' bi nho, ta cd bang phan bo' cac v i tri thang (W) va v i tri thua (L) nhu" sau:
Tiir bang tren ta cd the duf doan r i n g , bat bie'n d cac v i tri thua la so bi cd dang 2*^ - 1. Va nhiT vay, trong bai toan nay, A se la
Bat bie'n vd nvCa bat bien trong cdc bai todn trd chai 57 So bi 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Ke't qua L W L W W W L W W W w W W W L
ngtfdi thang cuoc, v i "2013" la mdt v i tri thang. That vay, ta se chi^ng minh ngi/di chdi A se luon cd the duy tri so' bi con lai cd dang 2 ' = - 1 .
6 liTdt boc dau tien, A boc 990 vien. Den moi liTdt bo'c cua B, so bi tren ban se cd dang 2 * ^ - 1 , khi dd B se du^dc phep bo'c tuf 1 den 2^-^ - 1 vien bi. Nhu" vay, so' bi c6n lai tren ban sau lu-dt bo'c cua B se cd dang 2*=-! - 1 + r, v d i 1 ^ r < 2^'^ - 1. Den liTdt boc cua A, A se boc r vien bi de dam bao so b i con lai la 2'^~^ - 1, day la mot vi tri thua. i''< C]
Nhan xet. Bai toan tren cd mot dang phat bieu hinh hoc kha thii v i nhiT sau: ''Cho mot doan thdng tren true sd ddi N dan vi vdi cdc diem chia nguyen. Avd B Idn luat thUc hien cdc luat chai theo nguyen tdc sau: moi idn cat doan thdng tai mot diem nguyen ndm trong doan de thu duac hai doan con sau dd vat di doan ngan, trao doan ddi cho ngUdi kia. Neu hai doan bang nhau thi vat di mot doan tiiy y. A la ngUdi thuc hien trUdc, den luat minh ma ai khong the thuc hien duac nudc di la ngudi thua cuoc. Hoi ai se la ngUdi cd
chien thudt gidnh chien thang?" \.
Sau day, ta se xet cac bai toan khac cung thuoc Idp cac bai toan bo'c bi nhu'ng luc nay bi du'dc chia lam nhieu do'ng:
Bai toan 12. Tren ban cd hai ddng bi, moi ddng cd 2013 vien bi. A vd B idn luat bdc bi theo nguyen tdc sau: moi idn duac phep chgn mot ddng vd bdc tit ddng dd mot sd bi tuy y. A Id ngUdi bdc trudc, ai la ngudi bdc dugc vien bi cudi cung Id ngUdi thang cuoc. Hoi ai
Id ngudi cd chien thudt gidnh chien thdng? ^, LoTi giai. Chung ta cd the nhan thay ngiTdi chdi B luon cd the duy
tri trang thai hai do'ng b i bang nhau sau moi nvTdc di cua minh.
That vay, khi ngifdi chcJi A boc k vien bi d mot do'ng thi ngu'di chdi B cung se boc k vien b i d do'ng kia. Nhu" vay sau hitu han c i c nirdc di, ngirdi chdi A se phai difa so' bi ve trang thai (0, n ) .
58 Cdc phuang phdp gidi todn qua cdc ky thi Olympic Day la mot v i tri th^ng. Vay ngiTdi chcfi B la ngir^i c6 chien thuat
thang. • B a i toan 13. Tren ban cd hai dong bi, moi dong cd 2013 vien bi.
A vd B idn lUcft boc bi theo nguyen tac sau: moi idn duac phep chon mot dong vd boc til dong do mot so bi la Udc cua so bi d dong kia. A la ngudi boc trUdc, ai la ngadi boc duac vien bi cuoi ciing la ngUdi thdng cuoc. Hoi ai Id ngUdi cd chien thuat gidnh chien thang?
Lcfi giai. V i so bi d ca hai dong deu 1^ so le nen sau khi ngifdi chdi A boc thi so bi d hai dong chac chan se khac tinh chan le. Ngufdi chdi B chi viec boc mot vien bi tijf dong c6 so bi chfn de tie'p tuc duy t n trang thai so bi d ca hai dong deu la so le.
Nhu" vay sau moi lu'dt ngUdi B chdi chac chan ca hai dong deu con b i . B chi can ddi A boc he't bi d mot dong va ngifdi chdi B se
boc he't bi d dong con lai va gianh chien thang. • B a i toan 14. Tren ban cd hai dong bi, dong thvC nhdt cd 2013 vien
bi, dong thvC hai cd 20132013 vien bi. A vd B Ian luat boc bi theo nguyen tac sau: moi idn duac phep chon mot dong vd boc tie dd'ng do tdi thie'u mot vien vd tdi da mot nvta so bi trong dong. A la ngUdi boc trUdc, den luat minh md ai khdng the thUc hien duac nUdc di Id ngUdi thua cuoc. Hoi ai Id ngUdi cd chien thuat gidnh chien thang?
Lcfi giai. Ta xet b^i toan tdng quat vdi so bi d hai dong la m , n. Ta se chufng minh (m, n ) , m ^ n la mot vi tri thua khi m + 1 = 2 ' ' ( n + l ) ,
k G N . (*) Ta se chi^ng minh (*) bang quy nap theo p = /c + n . De thay
(1, 1) la mot v i tri thua nen (*) diing v d i p = 1. Gia suf (*) dung vdi moi p ^ po- Ta xet v i tri (mo, no), mo ^ no thoa man mo + 1 = 2^'" (no + 1), trong do ko + no = po + 1 va den lifdt A boc b i .
• Neu A boc r vien d dong c6 no vien bi thi B boc 2''°r vien d dong kia, so bi d hai dong dufdc diTa ve trang thai (mo - 2*^°r, no - r ) , day la mot vi tri thua theo gia thie't quy nap.
Bat bien vd niica bat bien trong cdc bai todn trd chai 59
• N d u A boc r vien d dong c6 mo vien bi thi B boc tiep 2''°-^ {no + 1) - r vien d dong do, so bi d hai dong diTdc dUa ve trang thai (mo - 2^°'^{no + 1), no), day la mot v i tri thua theo gia thie't quy nap.
;Suy ra cac v i tri (mo, no), mo ^ no thda man mo + 1 = 2^°(no + 1) trong do /co + no = po + 1 la cac v i tri thua. Theo nguyen ly quy nap thi (*) dung v d i moi p = k + n.
Nhvr vay, d bai toan nay, A se la ngiTdi chien thang v i A cd the boc 3633326 vien d dong thu" hai de diTa so bi d hai dong ve vi tri
' ua. • Nhan xet. Bai toan tsen c6 mot dang phat bieu hinh hoc kha
u v i nhir sau: "C/io mot ludi chit nhdt kick thudc n x m dan vi nguyen. A vd B Idn luat thUc hien cdc luat chai theo nguyen tac -au: cat hinh theo mot dudng ke trong ludi di qua mot diem nguyen ren mot canh vd khdng trung vdi dinh de thu duac hai hinh chit 'hat sau do bd di hinh cd dien tich nhd han, trao hinh cd dien tich in han cho ngUdi kia. Neu hai hinh cd dien tich bang nhau thi bd i mot hinh tuy y. A Id ngUdi thUc hien trUdc, den luat minh md ai khdng the thUc hien duac nude di la ngUdi thua cuoc. Hoi ai se Id ngudi cd chien thuat gidnh chien thdng?"
B a i toan 15. Tren ban cd hai dong bi, dong thit nhdt cd 2013 vien ' i, dong thiJt hai cd 3102 vien bi Avd B idn luat boc bi theo nguyen
ic sau: moi Idn duac phep chon mot dong vd boc tif dong do mot
"6 bi tuy y hodc boc mot so bi tuy y bang nhau d cd hai dd'ng. A ngUdi boc trUdc, ai Id ngudi boc duac vien bi cudi cung Id ngUdi hang cuoc. Hoi ai Id ngUdi cd chien thuat gidnh chien thdng?
Lcfi giai. Ta xet hai day (a„) va (6„) dufdc xac dinh nhiT sau:
ằ o i = 1, fci = 2.
• a„ la so nguyen duTdng nhd nha't khong thupc tap hdp
{ a i , a2, . . . , a„_i, 6 i , 62, • • • , ,
ằ 6n = a„ + n .
60 Cdc phucfng phdp gidi todn qua cdc ky thi Olympic
Ta se chiJng minh bang quy nap theo n, (a„, 6„) la vi tri thua.
Vdi n = 1, de thay (1, 2) la mot vi tri thua. Gia suf (a^, la • vi tri thua vdi mpi n ^ fc. Ta chuTng minh: (a^+i, hk+\) la mot vi tri thua.
That vay, gia suT so bi d hai dong dang d vi tri (cfc+i, hk+i) va den liTdt ngu^cJi chdi A boc bi.
• Neu A boc r (r ^ 1) vien ci dong c6 ak+i vien hoac boc + 1 + r (r ^ 1) vien d dong c6 6fc+i vien thi suy ra ton tai i e N* sao cho aj = ak+i - r hoac hj = a^+i - r, khi do B chi can boc mot liTcJng bi vijfa du d dong kia de diTa so bi 6 hai dong ve v i tri (a^, bj).
• Neu A boc r (1 ^ r ^ A;) vien d dong c6 vien thi hieu so bi d hai dong se bang j < A; + 1, khi do B boc d hai dong vdi Cling mot so lu'dng bi nhiT nhau de dtfa so bi d hai dong ve vi tri (oj, hj).
• Neu A boc k + 1 vien d dong cd bk+i vien thi ngiTdi chcJi B chi can boc d moi dong ak+i vien va gianh chien thang. •