Skip to content

Instantly share code, notes, and snippets.

View youqad's full-sized avatar
🇬🇧
Research internship at Cambridge University

Younesse Kaddar youqad

🇬🇧
Research internship at Cambridge University
View GitHub Profile
@youqad
youqad / o1-preview-01928a22-ff39-7540-87f3-a3ff1817c756.json
Last active October 15, 2024 08:28
Chat trace of solutions by o1-preview: pass all tests, but use helper functions (cf. https://github.com/youqad/bit-reversal-trees)
{
"id": "01928a22-ff39-7540-87f3-a3ff1817c756",
"project_id": "ox/bit-reversal-trees",
"op_name": "weave:///ox/bit-reversal-trees/op/chat_completion_request:Qk5KvLtkFOElrMcJeSjrbLNK80b4VOx6o5YsYwdFRf8",
"display_name": null,
"trace_id": "01928a22-ff39-7540-87f3-a40a5e338663",
"parent_id": null,
"started_at": "2024-10-14T08:26:42.361000Z",
"attributes": {
"weave": {
@youqad
youqad / o1-mini-01928789-1b47-74a3-8a72-0cda64404bae.json
Last active October 14, 2024 06:03
Chat trace of solutions by o1-mini: pass all tests, but use helper functions (cf. https://github.com/youqad/bit-reversal-trees)
{
"id": "01928789-1b47-74a3-8a72-0cda64404bae",
"project_id": "ox/bit-reversal-trees",
"op_name": "weave:///ox/bit-reversal-trees/op/chat_completion_request:Q6nynXWSlZUj11g8y7uBuiHYfrNaGSzoyN1mM5CmbTk",
"display_name": null,
"trace_id": "01928789-1b47-74a3-8a72-0ce8abb48729",
"parent_id": null,
"started_at": "2024-10-13T20:19:22.567000Z",
"attributes": {
"weave": {
@youqad
youqad / MontyHall_WebPPL_wlog.js
Last active July 24, 2020 17:02
WebPPL: Monty Hall (Solution 2: without loss of generality, suppose that we originally pick the 1st door and Monty opens the 2nd one)
var MontyHall = function () {
var car = randomInteger({n: 3})
var our_choice = randomInteger({n: 3})
var monty = categorical({vs: filter(
function(d){return d != car & d != our_choice }, [0,1,2])})
condition((our_choice == 0) & (monty == 1))
return car == 2 ? "change wins": "keep wins"
}
@youqad
youqad / MontyHall_WebPPL_no-wlog.js
Last active July 25, 2020 11:11
WebPPL: Monty Hall (Solution 1: doesn't resort to any "without loss of generality" argument)
var MontyHall = function () {
var car = randomInteger({n: 3})
var our_choice = randomInteger({n: 3})
var all_doors_but = function (d1, d2) {
return filter(function(d){return d != d1 & d != d2 }, [0,1,2])
}
var monty = categorical({vs: all_doors_but(car, our_choice)})
var door_not_opened = all_doors_but(monty, our_choice)[0]
return car == door_not_opened ? "change wins": "keep wins"
@youqad
youqad / retina_variance_OOP_3.txt
Created June 8, 2018 05:26
Inferring Space from Sensorimotor dependencies: OOP: varying retina variance (seed=3)
var = 0.1 / dim of compensated mov. = 0 (5 1 6)
var = 0.2 / dim of compensated mov. = 0 (5 1 6)
var = 0.3 / dim of compensated mov. = 0 (5 1 6)
var = 0.4 / dim of compensated mov. = 0 (5 1 6)
var = 0.5 / dim of compensated mov. = 0 (5 1 6)
var = 0.6 / dim of compensated mov. = 0 (5 1 6)
var = 0.7 / dim of compensated mov. = 0 (5 1 6)
var = 0.8 / dim of compensated mov. = 0 (5 1 6)
var = 0.9 / dim of compensated mov. = 0 (5 1 6)
var = 1.0 / dim of compensated mov. = 0 (5 1 6)
@youqad
youqad / retina_variance_2.txt
Created June 7, 2018 07:52
Inferring Space from Sensorimotor dependencies: varying retina variance (seed=2)
var = 0.1 / dim of compensated mov. = 4 (10 6 12)
var = 0.2 / dim of compensated mov. = 4 (10 6 12)
var = 0.3 / dim of compensated mov. = 0 (10 6 16)
var = 0.4 / dim of compensated mov. = 0 (10 6 16)
var = 0.5 / dim of compensated mov. = 11 (10 6 5)
var = 0.6 / dim of compensated mov. = 2 (10 4 12)
var = 0.7 / dim of compensated mov. = 4 (3 4 3)
var = 0.8 / dim of compensated mov. = 4 (3 4 3)
var = 0.9 / dim of compensated mov. = 6 (3 6 3)
var = 1.0 / dim of compensated mov. = 6 (10 6 10)
@youqad
youqad / retina_variance_1.txt
Last active June 7, 2018 06:05
Inferring Space from Sensorimotor dependencies: varying retina variance (seed=1)
var = 0.1 / dim of compensated mov. = -1 (9 2 12)
var = 0.2 / dim of compensated mov. = 3 (9 5 11)
var = 0.3 / dim of compensated mov. = 3 (9 5 11)
var = 0.4 / dim of compensated mov. = -1 (9 5 15)
var = 0.5 / dim of compensated mov. = 3 (9 5 11)
var = 0.6 / dim of compensated mov. = 3 (9 5 11)
var = 0.7 / dim of compensated mov. = 0 (9 2 11)
var = 0.8 / dim of compensated mov. = 3 (9 5 11)
var = 0.9 / dim of compensated mov. = -1 (9 5 15)
var = 1.0 / dim of compensated mov. = 4 (10 5 11)
/*************************************************************
*
* MathJax/extensions/TeX/xypic.js
*
* Implements Xy-pic environment.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2011-2014 Isao Sonobe <[email protected]>.
*
@youqad
youqad / concours-meilleur-dev.py
Created April 4, 2017 16:34
Concours Meilleur Dev : problème final
import sys
from collections import deque
lines = []
for line in sys.stdin:
lines.append(line.rstrip('\n'))
N = int(lines[0])
G = [set() for _ in range(N)]
20
20
3
5
2 3
2 4
2 4
9 3
7 6
5 4 3