A certain performer tries to impress his audience by guessing the birthday date of a volunteer (previously unknown to him).
The volunteer is requested to multiply the numerical value of the month of his birth by 31, to multiply the numerical value of the day by 12, to add the two products and announce the result, say N.
Upon getting the result the performer, considerably quickly, deduces the MM/DD of the relevant birthdate.
a. Devise a way to quickly solve 12*d+31*m=N.
b. Show that there is a unique solution for any N, evaluated as described above.
(In reply to
part a by Paul)
computer implementation of the algorithm shows it works:
For mo = 1 To 12
For da = 1 To 31
DoEvents
rslt = 12 * da + 31 * mo
Text1.Text = Text1.Text & mform(mo, "#0") & mform(da, "##0") & mform(rslt, "##########0")
r = rslt Mod 12
If r Mod 2 = 1 Then r = (r + 6) Mod 12
If r = 0 Then r = 12
d = (rslt - 31 * r) / 12
Text1.Text = Text1.Text & " " & r & Str(d) & crlf
Next
Next
date encoded decoded
1 1 43 1 1
1 2 55 1 2
1 3 67 1 3
1 4 79 1 4
1 5 91 1 5
1 6 103 1 6
1 7 115 1 7
1 8 127 1 8
1 9 139 1 9
1 10 151 1 10
1 11 163 1 11
1 12 175 1 12
1 13 187 1 13
1 14 199 1 14
1 15 211 1 15
1 16 223 1 16
1 17 235 1 17
1 18 247 1 18
1 19 259 1 19
1 20 271 1 20
1 21 283 1 21
1 22 295 1 22
1 23 307 1 23
1 24 319 1 24
1 25 331 1 25
1 26 343 1 26
1 27 355 1 27
1 28 367 1 28
1 29 379 1 29
1 30 391 1 30
1 31 403 1 31
2 1 74 2 1
2 2 86 2 2
2 3 98 2 3
2 4 110 2 4
2 5 122 2 5
2 6 134 2 6
2 7 146 2 7
2 8 158 2 8
2 9 170 2 9
2 10 182 2 10
2 11 194 2 11
2 12 206 2 12
2 13 218 2 13
2 14 230 2 14
2 15 242 2 15
2 16 254 2 16
2 17 266 2 17
2 18 278 2 18
2 19 290 2 19
2 20 302 2 20
2 21 314 2 21
2 22 326 2 22
2 23 338 2 23
2 24 350 2 24
2 25 362 2 25
2 26 374 2 26
2 27 386 2 27
2 28 398 2 28
2 29 410 2 29
2 30 422 2 30
2 31 434 2 31
3 1 105 3 1
3 2 117 3 2
3 3 129 3 3
3 4 141 3 4
3 5 153 3 5
3 6 165 3 6
3 7 177 3 7
3 8 189 3 8
3 9 201 3 9
3 10 213 3 10
3 11 225 3 11
3 12 237 3 12
3 13 249 3 13
3 14 261 3 14
3 15 273 3 15
3 16 285 3 16
3 17 297 3 17
3 18 309 3 18
3 19 321 3 19
3 20 333 3 20
3 21 345 3 21
3 22 357 3 22
3 23 369 3 23
3 24 381 3 24
3 25 393 3 25
3 26 405 3 26
3 27 417 3 27
3 28 429 3 28
3 29 441 3 29
3 30 453 3 30
3 31 465 3 31
4 1 136 4 1
4 2 148 4 2
4 3 160 4 3
4 4 172 4 4
4 5 184 4 5
4 6 196 4 6
4 7 208 4 7
4 8 220 4 8
4 9 232 4 9
4 10 244 4 10
4 11 256 4 11
4 12 268 4 12
4 13 280 4 13
4 14 292 4 14
4 15 304 4 15
4 16 316 4 16
4 17 328 4 17
4 18 340 4 18
4 19 352 4 19
4 20 364 4 20
4 21 376 4 21
4 22 388 4 22
4 23 400 4 23
4 24 412 4 24
4 25 424 4 25
4 26 436 4 26
4 27 448 4 27
4 28 460 4 28
4 29 472 4 29
4 30 484 4 30
4 31 496 4 31
5 1 167 5 1
5 2 179 5 2
5 3 191 5 3
5 4 203 5 4
5 5 215 5 5
5 6 227 5 6
5 7 239 5 7
5 8 251 5 8
5 9 263 5 9
5 10 275 5 10
5 11 287 5 11
5 12 299 5 12
5 13 311 5 13
5 14 323 5 14
5 15 335 5 15
5 16 347 5 16
5 17 359 5 17
5 18 371 5 18
5 19 383 5 19
5 20 395 5 20
5 21 407 5 21
5 22 419 5 22
5 23 431 5 23
5 24 443 5 24
5 25 455 5 25
5 26 467 5 26
5 27 479 5 27
5 28 491 5 28
5 29 503 5 29
5 30 515 5 30
5 31 527 5 31
6 1 198 6 1
6 2 210 6 2
6 3 222 6 3
6 4 234 6 4
6 5 246 6 5
6 6 258 6 6
6 7 270 6 7
6 8 282 6 8
6 9 294 6 9
6 10 306 6 10
6 11 318 6 11
6 12 330 6 12
6 13 342 6 13
6 14 354 6 14
6 15 366 6 15
6 16 378 6 16
6 17 390 6 17
6 18 402 6 18
6 19 414 6 19
6 20 426 6 20
6 21 438 6 21
6 22 450 6 22
6 23 462 6 23
6 24 474 6 24
6 25 486 6 25
6 26 498 6 26
6 27 510 6 27
6 28 522 6 28
6 29 534 6 29
6 30 546 6 30
6 31 558 6 31
7 1 229 7 1
7 2 241 7 2
7 3 253 7 3
7 4 265 7 4
7 5 277 7 5
7 6 289 7 6
7 7 301 7 7
7 8 313 7 8
7 9 325 7 9
7 10 337 7 10
7 11 349 7 11
7 12 361 7 12
7 13 373 7 13
7 14 385 7 14
7 15 397 7 15
7 16 409 7 16
7 17 421 7 17
7 18 433 7 18
7 19 445 7 19
7 20 457 7 20
7 21 469 7 21
7 22 481 7 22
7 23 493 7 23
7 24 505 7 24
7 25 517 7 25
7 26 529 7 26
7 27 541 7 27
7 28 553 7 28
7 29 565 7 29
7 30 577 7 30
7 31 589 7 31
8 1 260 8 1
8 2 272 8 2
8 3 284 8 3
8 4 296 8 4
8 5 308 8 5
8 6 320 8 6
8 7 332 8 7
8 8 344 8 8
8 9 356 8 9
8 10 368 8 10
8 11 380 8 11
8 12 392 8 12
8 13 404 8 13
8 14 416 8 14
8 15 428 8 15
8 16 440 8 16
8 17 452 8 17
8 18 464 8 18
8 19 476 8 19
8 20 488 8 20
8 21 500 8 21
8 22 512 8 22
8 23 524 8 23
8 24 536 8 24
8 25 548 8 25
8 26 560 8 26
8 27 572 8 27
8 28 584 8 28
8 29 596 8 29
8 30 608 8 30
8 31 620 8 31
9 1 291 9 1
9 2 303 9 2
9 3 315 9 3
9 4 327 9 4
9 5 339 9 5
9 6 351 9 6
9 7 363 9 7
9 8 375 9 8
9 9 387 9 9
9 10 399 9 10
9 11 411 9 11
9 12 423 9 12
9 13 435 9 13
9 14 447 9 14
9 15 459 9 15
9 16 471 9 16
9 17 483 9 17
9 18 495 9 18
9 19 507 9 19
9 20 519 9 20
9 21 531 9 21
9 22 543 9 22
9 23 555 9 23
9 24 567 9 24
9 25 579 9 25
9 26 591 9 26
9 27 603 9 27
9 28 615 9 28
9 29 627 9 29
9 30 639 9 30
9 31 651 9 31
10 1 322 10 1
10 2 334 10 2
10 3 346 10 3
10 4 358 10 4
10 5 370 10 5
10 6 382 10 6
10 7 394 10 7
10 8 406 10 8
10 9 418 10 9
10 10 430 10 10
10 11 442 10 11
10 12 454 10 12
10 13 466 10 13
10 14 478 10 14
10 15 490 10 15
10 16 502 10 16
10 17 514 10 17
10 18 526 10 18
10 19 538 10 19
10 20 550 10 20
10 21 562 10 21
10 22 574 10 22
10 23 586 10 23
10 24 598 10 24
10 25 610 10 25
10 26 622 10 26
10 27 634 10 27
10 28 646 10 28
10 29 658 10 29
10 30 670 10 30
10 31 682 10 31
11 1 353 11 1
11 2 365 11 2
11 3 377 11 3
11 4 389 11 4
11 5 401 11 5
11 6 413 11 6
11 7 425 11 7
11 8 437 11 8
11 9 449 11 9
11 10 461 11 10
11 11 473 11 11
11 12 485 11 12
11 13 497 11 13
11 14 509 11 14
11 15 521 11 15
11 16 533 11 16
11 17 545 11 17
11 18 557 11 18
11 19 569 11 19
11 20 581 11 20
11 21 593 11 21
11 22 605 11 22
11 23 617 11 23
11 24 629 11 24
11 25 641 11 25
11 26 653 11 26
11 27 665 11 27
11 28 677 11 28
11 29 689 11 29
11 30 701 11 30
11 31 713 11 31
12 1 384 12 1
12 2 396 12 2
12 3 408 12 3
12 4 420 12 4
12 5 432 12 5
12 6 444 12 6
12 7 456 12 7
12 8 468 12 8
12 9 480 12 9
12 10 492 12 10
12 11 504 12 11
12 12 516 12 12
12 13 528 12 13
12 14 540 12 14
12 15 552 12 15
12 16 564 12 16
12 17 576 12 17
12 18 588 12 18
12 19 600 12 19
12 20 612 12 20
12 21 624 12 21
12 22 636 12 22
12 23 648 12 23
12 24 660 12 24
12 25 672 12 25
12 26 684 12 26
12 27 696 12 27
12 28 708 12 28
12 29 720 12 29
12 30 732 12 30
12 31 744 12 31
|
Posted by Charlie
on 2016-08-19 22:20:11 |